Changeset 179944 in webkit


Ignore:
Timestamp:
Feb 11, 2015 12:13:03 PM (9 years ago)
Author:
ChangSeok Oh
Message:

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

Reviewed by Ryosuke Niwa.

Source/WebCore:

RenderFlexibleBox should be treated as a candidate for visible position. Visible selection
in an editable area is recalculated whenever an inner value of div is changed. If the inner value
is empty, the visible selection recalculated with DeleteSelectionCommand::m_endingPostion
is not correct. Because RenderBlockFlow is only considered but not RenderFlexibleBox
in Position::isCandidate so that a calculated ending VisiblePosition for an editable div
having "display : flex" goes weird and VisibleSelection is empty accordingly.

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

  • dom/Position.cpp:

(WebCore::Position::isCandidate):

LayoutTests:

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

  • fast/events/key-events-in-editable-flexbox-expected.txt: Added.
  • fast/events/key-events-in-editable-flexbox.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r179936 r179944  
     12015-02-11  ChangSeok Oh  <changseok.oh@collabora.com>
     2
     3        Div having contentEditable and display:flex cannot be edited if it is empty.
     4        https://bugs.webkit.org/show_bug.cgi?id=141218
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        This tests if an editable flexbox can be reedited after erasing all texts in it.
     9
     10        * fast/events/key-events-in-editable-flexbox-expected.txt: Added.
     11        * fast/events/key-events-in-editable-flexbox.html: Added.
     12
    1132015-02-11  Sam Weinig  <sam@webkit.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r179942 r179944  
     12015-02-11  ChangSeok Oh  <changseok.oh@collabora.com>
     2
     3        Div having contentEditable and display:flex cannot be edited if it is empty.
     4        https://bugs.webkit.org/show_bug.cgi?id=141218
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        RenderFlexibleBox should be treated as a candidate for visible position. Visible selection
     9        in an editable area is recalculated whenever an inner value of div is changed. If the inner value
     10        is empty, the visible selection recalculated with DeleteSelectionCommand::m_endingPostion
     11        is not correct. Because RenderBlockFlow is only considered but not RenderFlexibleBox
     12        in Position::isCandidate so that a calculated ending VisiblePosition for an editable div
     13        having "display : flex" goes weird and VisibleSelection is empty accordingly.
     14
     15        Test: fast/events/key-events-in-editable-flexbox.html
     16
     17        * dom/Position.cpp:
     18        (WebCore::Position::isCandidate):
     19
    1202015-02-11  ChangSeok Oh  <changseok.oh@collabora.com>
    221
  • trunk/Source/WebCore/dom/Position.cpp

    r179926 r179944  
    3636#include "PositionIterator.h"
    3737#include "RenderBlock.h"
     38#include "RenderFlexibleBox.h"
    3839#include "RenderInline.h"
    3940#include "RenderIterator.h"
     
    935936    if (m_anchorNode->hasTagName(htmlTag))
    936937        return false;
    937        
    938     if (is<RenderBlockFlow>(*renderer)) {
    939         RenderBlockFlow& block = downcast<RenderBlockFlow>(*renderer);
     938
     939    if (is<RenderBlockFlow>(*renderer) || is<RenderFlexibleBox>(*renderer)) {
     940        RenderBlock& block = downcast<RenderBlock>(*renderer);
    940941        if (block.logicalHeight() || m_anchorNode->hasTagName(bodyTag)) {
    941942            if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(block))
Note: See TracChangeset for help on using the changeset viewer.