Fixing several incorrect assumptions with handling isolated inlines.
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jan 2014 21:53:22 +0000 (21:53 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jan 2014 21:53:22 +0000 (21:53 +0000)
commitbafc23956c173035a830398f7a6f89c9a23254bf
tree8ee7d77ba254513feed63c682c9f239167283aaa
parent6ba620689c41d687cb8e1b9f9e11dcaeab56221b
Fixing several incorrect assumptions with handling isolated inlines.
https://bugs.webkit.org/show_bug.cgi?id=127608

Reviewed by Dave Hyatt.

Source/WebCore:

First, when an isolated inline spans multiple lines, we aren't guaranteed
to exit BidiResolver with a nested inline count of zero. Removing the
assert that says otherwise.

Previously in constructBidiRunsForSegment, we called bidiFirst in
an attempt to properly setup the isolatedResolver for any dom/style
that applied, but this only worked on the first line the isolated
inline appeared in. Adding a function that approaches this properly
by recursing through the parents of the starting object for the line
and post-fixing direction attributes to the resolver.

Finally, addressing an issue where the line following a removed isolated
inline (with a continuation) failed to be marked dirty.

Blink: https://chromium.googlesource.com/chromium/blink/+/72698f203b1c50900e535b80945563b92b7eef23
Tests: fast/text/nested-bidi-assert.html
       fast/text/nested-bidi-with-continuation-crash.html

* platform/text/BidiResolver.h:
(WebCore::Run>::~BidiResolver):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::setupResolverToResumeInIsolate):
(WebCore::constructBidiRunsForSegment):
* rendering/RenderLineBoxList.cpp:
(WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):

LayoutTests:

See file-specific info.

Blink: https://chromium.googlesource.com/chromium/blink/+/72698f203b1c50900e535b80945563b92b7eef23
* fast/text/nested-bidi-assert-expected.txt: Added.
* fast/text/nested-bidi-assert.html: Added. Tests that no crash occurs
when an isolated inline spans several lines
* fast/text/nested-bidi-with-continuation-crash-expected.txt: Added.
* fast/text/nested-bidi-with-continuation-crash.html: Added. Tests that
no crash occurs when additional isolates need to be set up for a
continuation

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162956 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/text/nested-bidi-assert-expected.txt [new file with mode: 0644]
LayoutTests/fast/text/nested-bidi-assert.html [new file with mode: 0644]
LayoutTests/fast/text/nested-bidi-with-continuation-crash-expected.txt [new file with mode: 0644]
LayoutTests/fast/text/nested-bidi-with-continuation-crash.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/text/BidiResolver.h
Source/WebCore/rendering/RenderBlockLineLayout.cpp
Source/WebCore/rendering/RenderLineBoxList.cpp