Changeset 156742 in webkit


Ignore:
Timestamp:
Oct 1, 2013 3:47:49 PM (11 years ago)
Author:
joone.hur@intel.com
Message:

Quirksmode: CSS1: WebKit fails dynamic :first-letter test
https://bugs.webkit.org/show_bug.cgi?id=15602

Reviewed by David Hyatt.

Source/WebCore:

CSS first-letter property does not work properly when the first letter is changed
by DOM scripting.
This patch allows to check if the existing first-letter is no longer the
first-letter. In this case, it deletes the old first-letter object and creates
a new one. For the remaining text, the oldRemainingText object is used
again for containing the full text(first letter + remaining text).

Test: fast/css/first-letter-block-change.html

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::updateFirstLetter):

LayoutTests:

Add a test case that ensures that CSS first-letter property should work
properly when the first letter is changed by DOM scripting.

  • fast/css/first-letter-block-change.html: Added.
  • platform/efl/TestExpectations:
  • platform/gtk-wk1/fast/css/first-letter-block-change-expected.png: Added.
  • platform/gtk-wk2/fast/css/first-letter-block-change-expected.png: Added.
  • platform/gtk/fast/css/first-letter-block-change-expected.txt: Added.
  • platform/mac/TestExpectations:
Location:
trunk
Files:
5 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r156741 r156742  
     12013-10-01  Joone Hur  <joone.hur@intel.com>
     2
     3        Quirksmode: CSS1: WebKit fails dynamic :first-letter test
     4        https://bugs.webkit.org/show_bug.cgi?id=15602
     5
     6        Reviewed by David Hyatt.
     7
     8        Add a test case that ensures that CSS first-letter property should work
     9        properly when the first letter is changed by DOM scripting.
     10
     11        * fast/css/first-letter-block-change.html: Added.
     12        * platform/efl/TestExpectations:
     13        * platform/gtk-wk1/fast/css/first-letter-block-change-expected.png: Added.
     14        * platform/gtk-wk2/fast/css/first-letter-block-change-expected.png: Added.
     15        * platform/gtk/fast/css/first-letter-block-change-expected.txt: Added.
     16        * platform/mac/TestExpectations:
     17
    1182013-10-01  Brent Fulgham  <bfulgham@apple.com>
    219
  • trunk/LayoutTests/platform/efl/TestExpectations

    r156692 r156742  
    16561656webkit.org/b/119782 fast/forms/search-styled.html [ Failure ]
    16571657
     1658# This test case needs to be rebaselined.
     1659webkit.org/b/15602 fast/css/first-letter-block-change.html [ Failure ]
  • trunk/LayoutTests/platform/mac/TestExpectations

    r156692 r156742  
    13641364
    13651365webkit.org/b/122042 media/media-controller-playback.html [ Pass Failure ]
     1366
     1367# This test case needs to be rebaselined.
     1368webkit.org/b/15602 fast/css/first-letter-block-change.html [ Failure ]
  • trunk/Source/WebCore/ChangeLog

    r156738 r156742  
     12013-10-01  Joone Hur  <joone.hur@intel.com>
     2
     3        Quirksmode: CSS1: WebKit fails dynamic :first-letter test
     4        https://bugs.webkit.org/show_bug.cgi?id=15602
     5
     6        Reviewed by David Hyatt.
     7
     8        CSS first-letter property does not work properly when the first letter is changed
     9        by DOM scripting.
     10        This patch allows to check if the existing first-letter is no longer the
     11        first-letter. In this case, it deletes the old first-letter object and creates
     12        a new one. For the remaining text, the oldRemainingText object is used
     13        again for containing the full text(first letter + remaining text).
     14
     15        Test: fast/css/first-letter-block-change.html
     16
     17        * rendering/RenderBlock.cpp:
     18        (WebCore::RenderBlock::updateFirstLetter):
     19
    1202013-10-01  Antti Koivisto  <antti@apple.com>
    221
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r156738 r156742  
    59555955        return;
    59565956
    5957     // FIXME: We need to destroy the first-letter object if it is no longer the first child. Need to find
    5958     // an efficient way to check for that situation though before implementing anything.
    59595957    RenderElement* firstLetterBlock = findFirstLetterBlock(this);
    59605958    if (!firstLetterBlock)
     
    59885986        return;
    59895987
    5990     // If the child already has style, then it has already been created, so we just want
    5991     // to update it.
    59925988    if (descendant->parent()->style()->styleType() == FIRST_LETTER) {
     5989        // Destroy the first-letter object if it is no longer the first child.
     5990        RenderObject* remainingText = descendant->parent()->nextSibling();
     5991        if (remainingText && descendant->node() != remainingText->node()) {
     5992            if (!remainingText->isText() || remainingText->isBR())
     5993                return;
     5994
     5995            LayoutStateDisabler layoutStateDisabler(&view());
     5996
     5997            if (RenderObject* oldRemainingText = toRenderBoxModelObject(descendant->parent())->firstLetterRemainingText())
     5998                toRenderText(oldRemainingText)->setText(toText(oldRemainingText->node())->data().impl());
     5999
     6000            createFirstLetterRenderer(firstLetterBlock, toRenderText(remainingText));
     6001            return;
     6002        }   
     6003
     6004        // If the child already has style, then it has already been created, so we just want
     6005        // to update it.
    59936006        updateFirstLetterStyle(firstLetterBlock, descendant);
    59946007        return;
Note: See TracChangeset for help on using the changeset viewer.