Changeset 217238 in webkit


Ignore:
Timestamp:
May 22, 2017 12:43:39 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

Don't unconditionally reset TextIterator::m_handledChildren for display: contents nodes.
https://bugs.webkit.org/show_bug.cgi?id=172443

This avoids an infinite hang when enabling display: contents in bug 171984.

Patch by Emilio Cobos Álvarez <ecobos@igalia.com> on 2017-05-22
Reviewed by Antti Koivisto.

No new tests. Relanding bug 171984 will add test coverage for this.

  • editing/TextIterator.cpp:

(WebCore::hasDisplayContents):
(WebCore::fullyClipsContents):
(WebCore::TextIterator::advance):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r217237 r217238  
     12017-05-22  Emilio Cobos Álvarez  <ecobos@igalia.com>
     2
     3        Don't unconditionally reset TextIterator::m_handledChildren for display: contents nodes.
     4        https://bugs.webkit.org/show_bug.cgi?id=172443
     5
     6        This avoids an infinite hang when enabling display: contents in bug 171984.
     7
     8        Reviewed by Antti Koivisto.
     9
     10        No new tests. Relanding bug 171984 will add test coverage for this.
     11
     12        * editing/TextIterator.cpp:
     13        (WebCore::hasDisplayContents):
     14        (WebCore::fullyClipsContents):
     15        (WebCore::TextIterator::advance):
     16
    1172017-05-22  Sam Weinig  <sam@webkit.org>
    218
  • trunk/Source/WebCore/editing/TextIterator.cpp

    r217019 r217238  
    445445}
    446446
     447static inline bool hasDisplayContents(Node& node)
     448{
     449    return is<Element>(node) && downcast<Element>(node).hasDisplayContents();
     450}
     451
    447452void TextIterator::advance()
    448453{
     
    492497       
    493498        auto* renderer = m_node->renderer();
    494         if (!renderer) {
    495             m_handledNode = true;
    496             m_handledChildren = !(is<Element>(*m_node) && downcast<Element>(*m_node).hasDisplayContents());
    497         } else {
    498             // handle current node according to its type
    499             if (!m_handledNode) {
     499        if (!m_handledNode) {
     500            if (!renderer) {
     501                m_handledNode = true;
     502                m_handledChildren = !hasDisplayContents(*m_node);
     503            } else {
     504                // handle current node according to its type
    500505                if (renderer->isText() && m_node->isTextNode())
    501506                    m_handledNode = handleTextNode();
Note: See TracChangeset for help on using the changeset viewer.