Skip to content
  • commit-queue@webkit.org's avatar
    Inline continuations create :after generated content on style recalcs · cc0f04f3
    commit-queue@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=93170
    
    Patch by Takashi Sakamoto <tasak@google.com> on 2012-10-05
    Reviewed by Abhishek Arya.
    
    Source/WebCore:
    
    The bug is caused by RenderInline::styleDidChange's setContinuation(0).
    RenderObjectChildList uses continuation to know whether the given
    renderer should have AFTER render object or not.
    However, setContinuation(0) makes RenderObjectChildList to
    misunderstand that all continuations are last continuation.
    To avoid the misunderstanding, added a new flag to class
    RenderObejctChildList to enable/disable updating :after content (and
    also :before content).
    
    Tests: fast/css-generated-content/after-with-inline-continuation.html
           fast/css-generated-content/dynamic-apply-after-for-inline.html
    
    * rendering/RenderInline.cpp:
    (WebCore::RenderInline::styleDidChange):
    Disable upating :after content for continuations which are not
    the last one during setStyle just after setContinuation(0).
    The setStyle invokes RenderInline::styleDidChange and also invokes
    updateBeforeAfterContent via the styleDidChange. This means,
    the last continuation's updateBeforeAfterContent is also invoked
    after setContinuation(0). We have to update :after for the last
    continuation.
    * rendering/RenderObjectChildList.cpp:
    (WebCore):
    (WebCore::RenderObjectChildList::updateBeforeAfterContent):
    If s_updateBeforeAfterContent is false, quickly exit
    updateBeforeAfterContent.
    * rendering/RenderObjectChildList.h:
    (RenderObjectChildList):
    Added a new flag s_enableUpdateBeforeAfterContent to enable/disable
    updating :before or :after content.
    
    LayoutTests:
    
    * fast/css-generated-content/after-with-inline-continuation-expected.html: Added.
    * fast/css-generated-content/after-with-inline-continuation.html: Added.
    * fast/css-generated-content/dynamic-apply-after-for-inline-expected.html: Added.
    * fast/css-generated-content/dynamic-apply-after-for-inline.html: Added.
    * http/tests/misc/acid3-expected.txt:
    The acid3-expected.txt has the duplicate RenderBlock (positioned).
    Two 'layer at(638, 18) size 20x20, ... text run at (0,0) width 20: "X"'
    exist. So did reset-results for acid3-expected.txt.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130555 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    cc0f04f3