Ignore:
Timestamp:
Feb 13, 2015, 9:15:50 AM (11 years ago)
Author:
ChangSeok Oh
Message:

Div having contentEditable and display:grid cannot be edited if it is empty.
https://bugs.webkit.org/show_bug.cgi?id=141465

Reviewed by Ryosuke Niwa.

Source/WebCore:

This bug is quite similar to webkit.org/b/141218. RenderGrid should be also treated as a candidate
for visible position as like RenderFlexibleBox. The only different situation between them is
that RenderGrid has a bug setting "0px" for logicalHeight when it is empty. RenderGrid should also have
a minimum height of a single line if it is editable as well as RenderFlexibleBox does.

Test: fast/events/key-events-in-editable-gridbox.html

  • dom/Position.cpp:

(WebCore::Position::isCandidate):
(WebCore::Position::isRenderedCharacter):

  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::layoutGridItems):

LayoutTests:

This tests if an editable grid box can be reedited after erasing all texts in it.

  • fast/events/key-events-in-editable-gridbox-expected.txt: Added.
  • fast/events/key-events-in-editable-gridbox.html: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/rendering/RenderGrid.cpp

    r180003 r180050  
    10001000    // min / max logical height is handled in updateLogicalHeight().
    10011001    setLogicalHeight(logicalHeight() + borderAndPaddingLogicalHeight());
     1002    if (hasLineIfEmpty()) {
     1003        LayoutUnit minHeight = borderAndPaddingLogicalHeight()
     1004            + lineHeight(true, isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes)
     1005            + scrollbarLogicalHeight();
     1006        if (height() < minHeight)
     1007            setLogicalHeight(minHeight);
     1008    }
     1009
    10021010    clearGrid();
    10031011}
Note: See TracChangeset for help on using the changeset viewer.