Add isContinuation bit
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Oct 2017 10:38:37 +0000 (10:38 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Oct 2017 10:38:37 +0000 (10:38 +0000)
commitec9c9ea06f60f5f3032904c8157f30d8868e1f0c
treea1ba61d898d3b192098dea9690c9af28fb670e81
parent424adf1d0b04c36b12853e505b8e0b5edee347a3
Add isContinuation bit
https://bugs.webkit.org/show_bug.cgi?id=178084

Reviewed by Zalan Bujtas.

Currently continuations are identified indirectly by comparing renderer pointer with the element renderer pointer.
This is bug prone and fails to cover anonymous continuations.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::firstChildConsideringContinuation):
(WebCore::startOfContinuations):
(WebCore::firstChildIsInlineContinuation):
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):

    Ignore first-letter fragment. This worked before because first-letter renderers
    were mistakenly considered inline element continuations (see below).

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::setContinuation):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::RenderElement):
* rendering/RenderElement.h:
(WebCore::RenderElement::hasContinuation const):
(WebCore::RenderElement::isContinuation const):
(WebCore::RenderElement::setIsContinuation):

    The new bit.

(WebCore::RenderElement::isElementContinuation const):
(WebCore::RenderElement::isInlineElementContinuation const):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::addChildIgnoringContinuation):
(WebCore::RenderInline::cloneAsContinuation const):
(WebCore::RenderInline::splitInlines):
(WebCore::RenderInline::childBecameNonInline):
(WebCore::RenderInline::clone const): Deleted.
* rendering/RenderInline.h:
* rendering/RenderObject.h:
(WebCore::RenderObject::isAnonymousBlock const):
(WebCore::RenderObject::isElementContinuation const): Deleted.

    The old continuation test was 'node() && node()->renderer() != this'
    This was fragile as nulling the renderer will make it fail.
    It was also wrong for first-letter renderers (isElementContinuation was true for them).

(WebCore::RenderObject::isInlineElementContinuation const): Deleted.

    Move to RenderElement.

(WebCore::RenderObject::isBlockElementContinuation const): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223127 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderElement.h
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/RenderInline.h
Source/WebCore/rendering/RenderObject.h