<https://webkit.org/b/119795> Propagate writing-mode from the first region to the...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Aug 2013 12:31:39 +0000 (12:31 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Aug 2013 12:31:39 +0000 (12:31 +0000)
commitc5cea9758287a0c86ce180845cc9c7743e336f91
tree0383d6350659589fc4fb83ac8aa90948a0ff2cd9
parente7c578dcc0ccbce86dcc568085585e7342d2e953
<https://webkit.org/b/119795> Propagate writing-mode from the first region to the flow thread

Patch by Morten Stenshorne <mstensho@opera.com> on 2013-08-17
Reviewed by Darin Adler.

Source/WebCore:

Since the flow thread is a direct child of RenderView, it doesn't inherit
proper writing-mode automatically. It should be mentioned that if the thread's
contents' writing-mode differs from that of the first region, things are
typically going to look useless (although perhaps that's how it should be),
but as long as writing-mode is only specified on a common parent of the
thread's contents and the regions, things look fine, and also, we're now
following what the spec has to say on the matter:

http://www.w3.org/TR/2013/WD-css3-regions-20130528/#the-flow-into-property

    "The first region defines the principal writing mode for the entire flow.
     The writing mode on subsequent regions is ignored."

This is a back-port of the fix for Blink bug 257965.
Reviewed by esprehn and mihnea there.
Blink review URL: https://chromiumcodereview.appspot.com/18374008

Tests: fast/regions/changing-writing-mode-2.html
       fast/regions/changing-writing-mode-3.html
       fast/regions/changing-writing-mode-4.html
       fast/regions/changing-writing-mode-5.html
       fast/regions/changing-writing-mode.html
       fast/regions/invalid-first-region-with-writing-mode-2.html
       fast/regions/invalid-first-region-with-writing-mode.html
       fast/regions/subtree-with-horiz-bt.html
       fast/regions/subtree-with-horiz-tb.html
       fast/regions/subtree-with-vert-lr.html
       fast/regions/subtree-with-vert-rl.html

* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::styleDidChange):
* rendering/RenderFlowThread.h:
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::updateWritingMode):
(WebCore::RenderNamedFlowThread::addRegionToNamedFlowThread):
(WebCore::RenderNamedFlowThread::removeRegionFromThread):
(WebCore::RenderNamedFlowThread::regionChangedWritingMode):
* rendering/RenderNamedFlowThread.h:
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::styleDidChange):

LayoutTests:

* fast/regions/changing-writing-mode-2-expected.html: Added.
* fast/regions/changing-writing-mode-2.html: Added.
* fast/regions/changing-writing-mode-3-expected.html: Added.
* fast/regions/changing-writing-mode-3.html: Added.
* fast/regions/changing-writing-mode-4-expected.html: Added.
* fast/regions/changing-writing-mode-4.html: Added.
* fast/regions/changing-writing-mode-5-expected.html: Added.
* fast/regions/changing-writing-mode-5.html: Added.
* fast/regions/changing-writing-mode-expected.html: Added.
* fast/regions/changing-writing-mode.html: Added.
* fast/regions/invalid-first-region-with-writing-mode-2-expected.html: Added.
* fast/regions/invalid-first-region-with-writing-mode-2.html: Added.
* fast/regions/invalid-first-region-with-writing-mode-expected.html: Added.
* fast/regions/invalid-first-region-with-writing-mode.html: Added.
* fast/regions/subtree-with-horiz-bt-expected.html: Added.
* fast/regions/subtree-with-horiz-bt.html: Added.
* fast/regions/subtree-with-horiz-tb-expected.html: Added.
* fast/regions/subtree-with-horiz-tb.html: Added.
* fast/regions/subtree-with-vert-lr-expected.html: Added.
* fast/regions/subtree-with-vert-lr.html: Added.
* fast/regions/subtree-with-vert-rl-expected.html: Added.
* fast/regions/subtree-with-vert-rl.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154221 268f45cc-cd09-0410-ab3c-d52691b4dbfc
29 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/regions/changing-writing-mode-2-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/changing-writing-mode-2.html [new file with mode: 0644]
LayoutTests/fast/regions/changing-writing-mode-3-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/changing-writing-mode-3.html [new file with mode: 0644]
LayoutTests/fast/regions/changing-writing-mode-4-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/changing-writing-mode-4.html [new file with mode: 0644]
LayoutTests/fast/regions/changing-writing-mode-5-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/changing-writing-mode-5.html [new file with mode: 0644]
LayoutTests/fast/regions/changing-writing-mode-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/changing-writing-mode.html [new file with mode: 0644]
LayoutTests/fast/regions/invalid-first-region-with-writing-mode-2-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/invalid-first-region-with-writing-mode-2.html [new file with mode: 0644]
LayoutTests/fast/regions/invalid-first-region-with-writing-mode-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/invalid-first-region-with-writing-mode.html [new file with mode: 0644]
LayoutTests/fast/regions/subtree-with-horiz-bt-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/subtree-with-horiz-bt.html [new file with mode: 0644]
LayoutTests/fast/regions/subtree-with-horiz-tb-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/subtree-with-horiz-tb.html [new file with mode: 0644]
LayoutTests/fast/regions/subtree-with-vert-lr-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/subtree-with-vert-lr.html [new file with mode: 0644]
LayoutTests/fast/regions/subtree-with-vert-rl-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/subtree-with-vert-rl.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderFlowThread.cpp
Source/WebCore/rendering/RenderFlowThread.h
Source/WebCore/rendering/RenderNamedFlowThread.cpp
Source/WebCore/rendering/RenderNamedFlowThread.h
Source/WebCore/rendering/RenderRegion.cpp