Changeset 206821 in webkit


Ignore:
Timestamp:
Oct 5, 2016 11:50:20 AM (8 years ago)
Author:
Alan Bujtas
Message:

Missing quotation mark when <q> gets reparented.
https://bugs.webkit.org/show_bug.cgi?id=162940

Reviewed by Darin Adler.

Source/WebCore:

When an opening RenderQuote gets removed due to some change in the render tree,
we notify the closing RenderQuote so that it can update its content (") accordingly (and vice versa).
However when the same RenderQuote is added back to the render tree (aka reparenting), we fail to
let the other RenderQuote know about it and its content becomes stale.
This patch ensures that when either the opening or closing part of the quotation mark gets reparented,
we inform the other, corresponding opening/closing renderer about it.

Test: fast/css-generated-content/missing-quotes-with-dynamic-content.html

  • dom/PseudoElement.cpp:

(WebCore::PseudoElement::didAttachRenderers):

  • rendering/RenderQuote.cpp:

(WebCore::RenderQuote::insertedIntoTree):

  • rendering/RenderQuote.h:

LayoutTests:

The position of the closing quotation mark is driven by the multicolumn code hence the cover div.

  • fast/css-generated-content/missing-quotes-with-dynamic-content-expected.html: Added.
  • fast/css-generated-content/missing-quotes-with-dynamic-content.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r206813 r206821  
     12016-10-05  Zalan Bujtas  <zalan@apple.com>
     2
     3        Missing quotation mark when <q> gets reparented.
     4        https://bugs.webkit.org/show_bug.cgi?id=162940
     5
     6        Reviewed by Darin Adler.
     7
     8        The position of the closing quotation mark is driven by the multicolumn code hence the cover div.
     9
     10        * fast/css-generated-content/missing-quotes-with-dynamic-content-expected.html: Added.
     11        * fast/css-generated-content/missing-quotes-with-dynamic-content.html: Added.
     12
    1132016-10-05  Daniel Bates  <dabates@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r206819 r206821  
     12016-10-05  Zalan Bujtas  <zalan@apple.com>
     2
     3        Missing quotation mark when <q> gets reparented.
     4        https://bugs.webkit.org/show_bug.cgi?id=162940
     5
     6        Reviewed by Darin Adler.
     7
     8        When an opening RenderQuote gets removed due to some change in the render tree,
     9        we notify the closing RenderQuote so that it can update its content (") accordingly (and vice versa).
     10        However when the same RenderQuote is added back to the render tree (aka reparenting), we fail to
     11        let the other RenderQuote know about it and its content becomes stale. 
     12        This patch ensures that when either the opening or closing part of the quotation mark gets reparented,
     13        we inform the other, corresponding opening/closing renderer about it.
     14
     15        Test: fast/css-generated-content/missing-quotes-with-dynamic-content.html
     16
     17        * dom/PseudoElement.cpp:
     18        (WebCore::PseudoElement::didAttachRenderers):
     19        * rendering/RenderQuote.cpp:
     20        (WebCore::RenderQuote::insertedIntoTree):
     21        * rendering/RenderQuote.h:
     22
    1232016-10-05  Alex Christensen  <achristensen@webkit.org>
    224
  • trunk/Source/WebCore/dom/PseudoElement.cpp

    r200098 r206821  
    9797    for (const ContentData* content = style.contentData(); content; content = content->next()) {
    9898        auto child = content->createContentRenderer(document(), style);
    99         if (renderer->isChildAllowed(*child, style)) {
    100             auto* childPtr = child.get();
     99        if (renderer->isChildAllowed(*child, style))
    101100            renderer->addChild(child.leakPtr());
    102             if (is<RenderQuote>(*childPtr))
    103                 downcast<RenderQuote>(*childPtr).attachQuote();
    104         }
    105101    }
    106102}
  • trunk/Source/WebCore/rendering/RenderQuote.cpp

    r200041 r206821  
    4646    ASSERT(!m_next);
    4747    ASSERT(!m_previous);
     48}
     49
     50void RenderQuote::insertedIntoTree()
     51{
     52    RenderInline::insertedIntoTree();
     53    attachQuote();
    4854}
    4955
  • trunk/Source/WebCore/rendering/RenderQuote.h

    r200041 r206821  
    4141    bool isQuote() const override { return true; }
    4242    void styleDidChange(StyleDifference, const RenderStyle*) override;
     43    void insertedIntoTree() override;
    4344    void willBeRemovedFromTree() override;
    4445
Note: See TracChangeset for help on using the changeset viewer.