https://bugs.webkit.org/show_bug.cgi?id=71840
Source/WebCore:
Reviewed by Simon Fraser.
Tests: fast/multicol/pagination-h-horizontal-bt.html
fast/multicol/pagination-h-horizontal-tb.html
fast/multicol/pagination-h-vertical-lr.html
fast/multicol/pagination-h-vertical-rl.html
fast/multicol/pagination-v-horizontal-bt.html
fast/multicol/pagination-v-horizontal-tb.html
fast/multicol/pagination-v-vertical-lr.html
fast/multicol/pagination-v-vertical-rl.html
* WebCore.exp.in: Export Page::setPagination() for WebCoreTestSupport.
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::styleForDocument): Set the column axis and the column gap in the
document style if the view is paginated.
* page/Page.cpp:
(WebCore::Page::setPagination): Added this setter.
* page/Page.h:
(WebCore::Page::Pagination::Pagination):
(WebCore::Page::pagination): Added this getter.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::requiresColumns): Added and moved some logic to here from...
(WebCore::RenderBlock::setDesiredColumnCountAndWidth): ...here.
* rendering/RenderBlock.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintRootBoxFillLayers): Changed to use the new RenderView::backgroundRect()
instead of unscaledDocumentRect().
* rendering/RenderView.cpp:
(WebCore::RenderView::requiresColumns): Added this override that always returns true if the view
is paginated.
(WebCore::RenderView::backgroundRect): Added. In the paginated case, returns a rectangle stretching
across all columns.
* rendering/RenderView.h:
* testing/Internals.cpp:
(WebCore::Internals::reset): Also reset pagination.
(WebCore::Internals::setPagination): Added this setter for testing.
* testing/Internals.h:
* testing/Internals.idl:
Source/WebKit2:
* win/WebKit2.def: Export Page::setPagination() for WebCoreTestSupport.
LayoutTests:
Reviewed by Simon Fraser.
* fast/multicol/pagination-h-horizontal-bt.html: Added.
* fast/multicol/pagination-h-horizontal-tb.html: Added.
* fast/multicol/pagination-h-vertical-lr.html: Added.
* fast/multicol/pagination-h-vertical-rl.html: Added.
* fast/multicol/pagination-v-horizontal-bt.html: Added.
* fast/multicol/pagination-v-horizontal-tb.html: Added.
* fast/multicol/pagination-v-vertical-lr.html: Added.
* fast/multicol/pagination-v-vertical-rl.html: Added.
* platform/mac/fast/multicol/pagination-h-horizontal-bt-expected.png: Added.
* platform/mac/fast/multicol/pagination-h-horizontal-bt-expected.txt: Added.
* platform/mac/fast/multicol/pagination-h-horizontal-tb-expected.png: Added.
* platform/mac/fast/multicol/pagination-h-horizontal-tb-expected.txt: Added.
* platform/mac/fast/multicol/pagination-h-vertical-lr-expected.png: Added.
* platform/mac/fast/multicol/pagination-h-vertical-lr-expected.txt: Added.
* platform/mac/fast/multicol/pagination-h-vertical-rl-expected.png: Added.
* platform/mac/fast/multicol/pagination-h-vertical-rl-expected.txt: Added.
* platform/mac/fast/multicol/pagination-v-horizontal-bt-expected.png: Added.
* platform/mac/fast/multicol/pagination-v-horizontal-bt-expected.txt: Added.
* platform/mac/fast/multicol/pagination-v-horizontal-tb-expected.png: Added.
* platform/mac/fast/multicol/pagination-v-horizontal-tb-expected.txt: Added.
* platform/mac/fast/multicol/pagination-v-vertical-lr-expected.png: Added.
* platform/mac/fast/multicol/pagination-v-vertical-lr-expected.txt: Added.
* platform/mac/fast/multicol/pagination-v-vertical-rl-expected.png: Added.
* platform/mac/fast/multicol/pagination-v-vertical-rl-expected.txt: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@99613
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-11-08 Dan Bernstein <mitz@apple.com>
+
+ <rdar://problem/10262225> Allow RenderView to have columns
+ https://bugs.webkit.org/show_bug.cgi?id=71840
+
+ Reviewed by Simon Fraser.
+
+ * fast/multicol/pagination-h-horizontal-bt.html: Added.
+ * fast/multicol/pagination-h-horizontal-tb.html: Added.
+ * fast/multicol/pagination-h-vertical-lr.html: Added.
+ * fast/multicol/pagination-h-vertical-rl.html: Added.
+ * fast/multicol/pagination-v-horizontal-bt.html: Added.
+ * fast/multicol/pagination-v-horizontal-tb.html: Added.
+ * fast/multicol/pagination-v-vertical-lr.html: Added.
+ * fast/multicol/pagination-v-vertical-rl.html: Added.
+ * platform/mac/fast/multicol/pagination-h-horizontal-bt-expected.png: Added.
+ * platform/mac/fast/multicol/pagination-h-horizontal-bt-expected.txt: Added.
+ * platform/mac/fast/multicol/pagination-h-horizontal-tb-expected.png: Added.
+ * platform/mac/fast/multicol/pagination-h-horizontal-tb-expected.txt: Added.
+ * platform/mac/fast/multicol/pagination-h-vertical-lr-expected.png: Added.
+ * platform/mac/fast/multicol/pagination-h-vertical-lr-expected.txt: Added.
+ * platform/mac/fast/multicol/pagination-h-vertical-rl-expected.png: Added.
+ * platform/mac/fast/multicol/pagination-h-vertical-rl-expected.txt: Added.
+ * platform/mac/fast/multicol/pagination-v-horizontal-bt-expected.png: Added.
+ * platform/mac/fast/multicol/pagination-v-horizontal-bt-expected.txt: Added.
+ * platform/mac/fast/multicol/pagination-v-horizontal-tb-expected.png: Added.
+ * platform/mac/fast/multicol/pagination-v-horizontal-tb-expected.txt: Added.
+ * platform/mac/fast/multicol/pagination-v-vertical-lr-expected.png: Added.
+ * platform/mac/fast/multicol/pagination-v-vertical-lr-expected.txt: Added.
+ * platform/mac/fast/multicol/pagination-v-vertical-rl-expected.png: Added.
+ * platform/mac/fast/multicol/pagination-v-vertical-rl-expected.txt: Added.
+
2011-11-08 Vineet Chaudhary <vineet.chaudhary@motorola.com>
Document.importNode's 'deep' argument should default to true.
--- /dev/null
+<html style="-webkit-writing-mode: horizontal-bt;">
+<head>
+ <script>
+ if (window.internals)
+ internals.setPagination(document, "HorizontallyPaginated", 0);
+ </script>
+</head>
+<body>
+ <div style="border: solid; height: 900px; font: 50px ahem; -webkit-font-smoothing: none;">
+ <br><br><br><br><br><br><br><br><br><br>
+ Lorem<br>
+ <span style="color: red;">ipsum</br>
+ </div>
+</body>
+</html>
--- /dev/null
+<html style="-webkit-writing-mode: horizontal-tb;">
+<head>
+ <script>
+ if (window.internals)
+ internals.setPagination(document, "HorizontallyPaginated", 0);
+ </script>
+</head>
+<body>
+ <div style="border: solid; height: 900px; font: 50px ahem; -webkit-font-smoothing: none;">
+ <br><br><br><br><br><br><br><br><br><br>
+ Lorem<br>
+ <span style="color: red;">ipsum</br>
+ </div>
+</body>
+</html>
--- /dev/null
+<html style="-webkit-writing-mode: vertical-lr;">
+<head>
+ <script>
+ if (window.internals)
+ internals.setPagination(document, "HorizontallyPaginated", 0);
+ </script>
+</head>
+<body>
+ <div style="border: solid; width: 1200px; font: 50px ahem; -webkit-font-smoothing: none;">
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br>
+ Lorem<br>
+ <span style="color: red;">ipsum</br>
+ </div>
+</body>
+</html>
--- /dev/null
+<html style="-webkit-writing-mode: vertical-rl;">
+<head>
+ <script>
+ if (window.internals)
+ internals.setPagination(document, "HorizontallyPaginated", 0);
+ </script>
+</head>
+<body>
+ <div style="border: solid; width: 1200px; font: 50px ahem; -webkit-font-smoothing: none;">
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br>
+ Lorem<br>
+ <span style="color: red;">ipsum</br>
+ </div>
+</body>
+</html>
--- /dev/null
+<html style="-webkit-writing-mode: horizontal-bt;">
+<head>
+ <script>
+ if (window.internals)
+ internals.setPagination(document, "VerticallyPaginated", 0);
+ </script>
+</head>
+<body>
+ <div style="border: solid; height: 900px; font: 50px ahem; -webkit-font-smoothing: none;">
+ <br><br><br><br><br><br><br><br><br><br>
+ Lorem<br>
+ <span style="color: red;">ipsum</br>
+ </div>
+</body>
+</html>
--- /dev/null
+<html style="-webkit-writing-mode: horizontal-tb;">
+<head>
+ <script>
+ if (window.internals)
+ internals.setPagination(document, "VerticallyPaginated", 0);
+ </script>
+</head>
+<body>
+ <div style="border: solid; height: 900px; font: 50px ahem; -webkit-font-smoothing: none;">
+ <br><br><br><br><br><br><br><br><br><br>
+ Lorem<br>
+ <span style="color: red;">ipsum</br>
+ </div>
+</body>
+</html>
--- /dev/null
+<html style="-webkit-writing-mode: vertical-lr;">
+<head>
+ <script>
+ if (window.internals)
+ internals.setPagination(document, "VerticallyPaginated", 0);
+ </script>
+</head>
+<body>
+ <div style="border: solid; width: 1200px; font: 50px ahem; -webkit-font-smoothing: none;">
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br>
+ Lorem<br>
+ <span style="color: red;">ipsum</br>
+ </div>
+</body>
+</html>
--- /dev/null
+<html style="-webkit-writing-mode: vertical-rl;">
+<head>
+ <script>
+ if (window.internals)
+ internals.setPagination(document, "VerticallyPaginated", 0);
+ </script>
+</head>
+<body>
+ <div style="border: solid; width: 1200px; font: 50px ahem; -webkit-font-smoothing: none;">
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br>
+ Lorem<br>
+ <span style="color: red;">ipsum</br>
+ </div>
+</body>
+</html>
--- /dev/null
+layer at (0,0) size 1600x585
+ RenderView at (0,0) size 800x585
+layer at (0,-337) size 800x922 backgroundClip at (0,0) size 1600x585 clip at (0,0) size 1600x585 outlineClip at (0,0) size 1600x585
+ RenderBlock {HTML} at (0,0) size 800x922
+ RenderBody {BODY} at (8,8) size 784x906
+ RenderBlock {DIV} at (0,0) size 784x906 [border: (3px solid #000000)]
+ RenderBR {BR} at (3,3) size 0x50
+ RenderBR {BR} at (3,53) size 0x50
+ RenderBR {BR} at (3,103) size 0x50
+ RenderBR {BR} at (3,153) size 0x50
+ RenderBR {BR} at (3,203) size 0x50
+ RenderBR {BR} at (3,253) size 0x50
+ RenderBR {BR} at (3,303) size 0x50
+ RenderBR {BR} at (3,353) size 0x50
+ RenderBR {BR} at (3,403) size 0x50
+ RenderBR {BR} at (3,453) size 0x50
+ RenderText {#text} at (3,503) size 250x50
+ text run at (3,503) width 250: "Lorem"
+ RenderBR {BR} at (253,513) size 0x0
+ RenderInline {SPAN} at (0,0) size 250x50 [color=#FF0000]
+ RenderText {#text} at (3,577) size 250x50
+ text run at (3,577) width 250: "ipsum"
+ RenderBR {BR} at (253,587) size 0x0
--- /dev/null
+layer at (0,0) size 1600x585
+ RenderView at (0,0) size 800x585
+layer at (0,0) size 800x922 backgroundClip at (0,0) size 1600x585 clip at (0,0) size 1600x585 outlineClip at (0,0) size 1600x585
+ RenderBlock {HTML} at (0,0) size 800x922
+ RenderBody {BODY} at (8,8) size 784x906
+ RenderBlock {DIV} at (0,0) size 784x906 [border: (3px solid #000000)]
+ RenderBR {BR} at (3,3) size 0x50
+ RenderBR {BR} at (3,53) size 0x50
+ RenderBR {BR} at (3,103) size 0x50
+ RenderBR {BR} at (3,153) size 0x50
+ RenderBR {BR} at (3,203) size 0x50
+ RenderBR {BR} at (3,253) size 0x50
+ RenderBR {BR} at (3,303) size 0x50
+ RenderBR {BR} at (3,353) size 0x50
+ RenderBR {BR} at (3,403) size 0x50
+ RenderBR {BR} at (3,453) size 0x50
+ RenderText {#text} at (3,503) size 250x50
+ text run at (3,503) width 250: "Lorem"
+ RenderBR {BR} at (253,543) size 0x0
+ RenderInline {SPAN} at (0,0) size 250x50 [color=#FF0000]
+ RenderText {#text} at (3,577) size 250x50
+ text run at (3,577) width 250: "ipsum"
+ RenderBR {BR} at (253,617) size 0x0
--- /dev/null
+layer at (0,0) size 1600x585
+ RenderView at (0,0) size 800x585
+layer at (0,0) size 1222x585
+ RenderBlock {HTML} at (0,0) size 1222x585
+ RenderBody {BODY} at (8,8) size 1206x569
+ RenderBlock {DIV} at (0,0) size 1206x569 [border: (3px solid #000000)]
+ RenderBR {BR} at (3,3) size 50x0
+ RenderBR {BR} at (53,3) size 50x0
+ RenderBR {BR} at (103,3) size 50x0
+ RenderBR {BR} at (153,3) size 50x0
+ RenderBR {BR} at (203,3) size 50x0
+ RenderBR {BR} at (253,3) size 50x0
+ RenderBR {BR} at (303,3) size 50x0
+ RenderBR {BR} at (353,3) size 50x0
+ RenderBR {BR} at (403,3) size 50x0
+ RenderBR {BR} at (453,3) size 50x0
+ RenderBR {BR} at (503,3) size 50x0
+ RenderBR {BR} at (553,3) size 50x0
+ RenderBR {BR} at (603,3) size 50x0
+ RenderBR {BR} at (653,3) size 50x0
+ RenderText {#text} at (703,3) size 50x250
+ text run at (703,3) width 250: "Lorem"
+ RenderBR {BR} at (713,253) size 0x0
+ RenderInline {SPAN} at (0,0) size 50x250 [color=#FF0000]
+ RenderText {#text} at (792,3) size 50x250
+ text run at (792,3) width 250: "ipsum"
+ RenderBR {BR} at (802,253) size 0x0
--- /dev/null
+layer at (0,0) size 1600x585
+ RenderView at (0,0) size 800x585
+layer at (-422,0) size 1222x585 backgroundClip at (0,0) size 1600x585 clip at (0,0) size 1600x585 outlineClip at (0,0) size 1600x585
+ RenderBlock {HTML} at (0,0) size 1222x585
+ RenderBody {BODY} at (8,8) size 1206x569
+ RenderBlock {DIV} at (0,0) size 1206x569 [border: (3px solid #000000)]
+ RenderBR {BR} at (3,3) size 50x0
+ RenderBR {BR} at (53,3) size 50x0
+ RenderBR {BR} at (103,3) size 50x0
+ RenderBR {BR} at (153,3) size 50x0
+ RenderBR {BR} at (203,3) size 50x0
+ RenderBR {BR} at (253,3) size 50x0
+ RenderBR {BR} at (303,3) size 50x0
+ RenderBR {BR} at (353,3) size 50x0
+ RenderBR {BR} at (403,3) size 50x0
+ RenderBR {BR} at (453,3) size 50x0
+ RenderBR {BR} at (503,3) size 50x0
+ RenderBR {BR} at (553,3) size 50x0
+ RenderBR {BR} at (603,3) size 50x0
+ RenderBR {BR} at (653,3) size 50x0
+ RenderText {#text} at (703,3) size 50x250
+ text run at (703,3) width 250: "Lorem"
+ RenderBR {BR} at (743,253) size 0x0
+ RenderInline {SPAN} at (0,0) size 50x250 [color=#FF0000]
+ RenderText {#text} at (792,3) size 50x250
+ text run at (792,3) width 250: "ipsum"
+ RenderBR {BR} at (832,253) size 0x0
--- /dev/null
+layer at (0,0) size 785x1200
+ RenderView at (0,0) size 785x600
+layer at (0,-322) size 785x922 backgroundClip at (0,0) size 785x1200 clip at (0,0) size 785x1200 outlineClip at (0,0) size 785x1200
+ RenderBlock {HTML} at (0,0) size 785x922
+ RenderBody {BODY} at (8,8) size 769x906
+ RenderBlock {DIV} at (0,0) size 769x906 [border: (3px solid #000000)]
+ RenderBR {BR} at (3,3) size 0x50
+ RenderBR {BR} at (3,53) size 0x50
+ RenderBR {BR} at (3,103) size 0x50
+ RenderBR {BR} at (3,153) size 0x50
+ RenderBR {BR} at (3,203) size 0x50
+ RenderBR {BR} at (3,253) size 0x50
+ RenderBR {BR} at (3,303) size 0x50
+ RenderBR {BR} at (3,353) size 0x50
+ RenderBR {BR} at (3,403) size 0x50
+ RenderBR {BR} at (3,453) size 0x50
+ RenderText {#text} at (3,503) size 250x50
+ text run at (3,503) width 250: "Lorem"
+ RenderBR {BR} at (253,513) size 0x0
+ RenderInline {SPAN} at (0,0) size 250x50 [color=#FF0000]
+ RenderText {#text} at (3,592) size 250x50
+ text run at (3,592) width 250: "ipsum"
+ RenderBR {BR} at (253,602) size 0x0
--- /dev/null
+layer at (0,0) size 785x1200
+ RenderView at (0,0) size 785x600
+layer at (0,0) size 785x922
+ RenderBlock {HTML} at (0,0) size 785x922
+ RenderBody {BODY} at (8,8) size 769x906
+ RenderBlock {DIV} at (0,0) size 769x906 [border: (3px solid #000000)]
+ RenderBR {BR} at (3,3) size 0x50
+ RenderBR {BR} at (3,53) size 0x50
+ RenderBR {BR} at (3,103) size 0x50
+ RenderBR {BR} at (3,153) size 0x50
+ RenderBR {BR} at (3,203) size 0x50
+ RenderBR {BR} at (3,253) size 0x50
+ RenderBR {BR} at (3,303) size 0x50
+ RenderBR {BR} at (3,353) size 0x50
+ RenderBR {BR} at (3,403) size 0x50
+ RenderBR {BR} at (3,453) size 0x50
+ RenderText {#text} at (3,503) size 250x50
+ text run at (3,503) width 250: "Lorem"
+ RenderBR {BR} at (253,543) size 0x0
+ RenderInline {SPAN} at (0,0) size 250x50 [color=#FF0000]
+ RenderText {#text} at (3,592) size 250x50
+ text run at (3,592) width 250: "ipsum"
+ RenderBR {BR} at (253,632) size 0x0
--- /dev/null
+layer at (0,0) size 785x1200
+ RenderView at (0,0) size 785x600
+layer at (0,0) size 1222x600 backgroundClip at (0,0) size 785x1200 clip at (0,0) size 785x1200 outlineClip at (0,0) size 785x1200
+ RenderBlock {HTML} at (0,0) size 1222x600
+ RenderBody {BODY} at (8,8) size 1206x584
+ RenderBlock {DIV} at (0,0) size 1206x584 [border: (3px solid #000000)]
+ RenderBR {BR} at (3,3) size 50x0
+ RenderBR {BR} at (53,3) size 50x0
+ RenderBR {BR} at (103,3) size 50x0
+ RenderBR {BR} at (153,3) size 50x0
+ RenderBR {BR} at (203,3) size 50x0
+ RenderBR {BR} at (253,3) size 50x0
+ RenderBR {BR} at (303,3) size 50x0
+ RenderBR {BR} at (353,3) size 50x0
+ RenderBR {BR} at (403,3) size 50x0
+ RenderBR {BR} at (453,3) size 50x0
+ RenderBR {BR} at (503,3) size 50x0
+ RenderBR {BR} at (553,3) size 50x0
+ RenderBR {BR} at (603,3) size 50x0
+ RenderBR {BR} at (653,3) size 50x0
+ RenderText {#text} at (703,3) size 50x250
+ text run at (703,3) width 250: "Lorem"
+ RenderBR {BR} at (713,253) size 0x0
+ RenderInline {SPAN} at (0,0) size 50x250 [color=#FF0000]
+ RenderText {#text} at (777,3) size 50x250
+ text run at (777,3) width 250: "ipsum"
+ RenderBR {BR} at (787,253) size 0x0
--- /dev/null
+layer at (0,0) size 785x1200
+ RenderView at (0,0) size 785x600
+layer at (-437,0) size 1222x600 backgroundClip at (0,0) size 785x1200 clip at (0,0) size 785x1200 outlineClip at (0,0) size 785x1200
+ RenderBlock {HTML} at (0,0) size 1222x600
+ RenderBody {BODY} at (8,8) size 1206x584
+ RenderBlock {DIV} at (0,0) size 1206x584 [border: (3px solid #000000)]
+ RenderBR {BR} at (3,3) size 50x0
+ RenderBR {BR} at (53,3) size 50x0
+ RenderBR {BR} at (103,3) size 50x0
+ RenderBR {BR} at (153,3) size 50x0
+ RenderBR {BR} at (203,3) size 50x0
+ RenderBR {BR} at (253,3) size 50x0
+ RenderBR {BR} at (303,3) size 50x0
+ RenderBR {BR} at (353,3) size 50x0
+ RenderBR {BR} at (403,3) size 50x0
+ RenderBR {BR} at (453,3) size 50x0
+ RenderBR {BR} at (503,3) size 50x0
+ RenderBR {BR} at (553,3) size 50x0
+ RenderBR {BR} at (603,3) size 50x0
+ RenderBR {BR} at (653,3) size 50x0
+ RenderText {#text} at (703,3) size 50x250
+ text run at (703,3) width 250: "Lorem"
+ RenderBR {BR} at (743,253) size 0x0
+ RenderInline {SPAN} at (0,0) size 50x250 [color=#FF0000]
+ RenderText {#text} at (777,3) size 50x250
+ text run at (777,3) width 250: "ipsum"
+ RenderBR {BR} at (817,253) size 0x0
+2011-11-08 Dan Bernstein <mitz@apple.com>
+
+ <rdar://problem/10262225> Allow RenderView to have columns
+ https://bugs.webkit.org/show_bug.cgi?id=71840
+
+ Reviewed by Simon Fraser.
+
+ Tests: fast/multicol/pagination-h-horizontal-bt.html
+ fast/multicol/pagination-h-horizontal-tb.html
+ fast/multicol/pagination-h-vertical-lr.html
+ fast/multicol/pagination-h-vertical-rl.html
+ fast/multicol/pagination-v-horizontal-bt.html
+ fast/multicol/pagination-v-horizontal-tb.html
+ fast/multicol/pagination-v-vertical-lr.html
+ fast/multicol/pagination-v-vertical-rl.html
+
+ * WebCore.exp.in: Export Page::setPagination() for WebCoreTestSupport.
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::styleForDocument): Set the column axis and the column gap in the
+ document style if the view is paginated.
+ * page/Page.cpp:
+ (WebCore::Page::setPagination): Added this setter.
+ * page/Page.h:
+ (WebCore::Page::Pagination::Pagination):
+ (WebCore::Page::pagination): Added this getter.
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::requiresColumns): Added and moved some logic to here from...
+ (WebCore::RenderBlock::setDesiredColumnCountAndWidth): ...here.
+ * rendering/RenderBlock.h:
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::paintRootBoxFillLayers): Changed to use the new RenderView::backgroundRect()
+ instead of unscaledDocumentRect().
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::requiresColumns): Added this override that always returns true if the view
+ is paginated.
+ (WebCore::RenderView::backgroundRect): Added. In the paginated case, returns a rectangle stretching
+ across all columns.
+ * rendering/RenderView.h:
+ * testing/Internals.cpp:
+ (WebCore::Internals::reset): Also reset pagination.
+ (WebCore::Internals::setPagination): Added this setter for testing.
+ * testing/Internals.h:
+ * testing/Internals.idl:
+
2011-11-08 Vineet Chaudhary <vineet.chaudhary@motorola.com>
Document.importNode's 'deep' argument should default to true.
__ZN7WebCore4Page11PageClientsD1Ev
__ZN7WebCore4Page12setGroupNameERKN3WTF6StringE
__ZN7WebCore4Page13rangeOfStringERKN3WTF6StringEPNS_5RangeEj
+__ZN7WebCore4Page13setPaginationERKNS0_10PaginationE
__ZN7WebCore4Page14setMediaVolumeEf
__ZN7WebCore4Page15addSchedulePairEN3WTF10PassRefPtrINS_12SchedulePairEEE
__ZN7WebCore4Page15didMoveOnscreenEv
documentStyle->setDirection(docElementRenderer->style()->direction());
}
+ if (frame) {
+ if (Page* page = frame->page()) {
+ const Page::Pagination& pagination = page->pagination();
+ if (pagination.mode != Page::Pagination::Unpaginated) {
+ documentStyle->setColumnAxis(pagination.mode == Page::Pagination::HorizontallyPaginated ? HorizontalColumnAxis : VerticalColumnAxis);
+ documentStyle->setColumnGap(pagination.gap);
+ }
+ }
+ }
+
FontDescription fontDescription;
fontDescription.setUsePrinterFont(document->printing());
if (Settings* settings = document->settings()) {
backForward()->markPagesForFullStyleRecalc();
}
+void Page::setPagination(const Pagination& pagination)
+{
+ if (m_pagination.mode == pagination.mode && m_pagination.gap == pagination.gap)
+ return;
+
+ m_pagination = pagination;
+
+ setNeedsRecalcStyleInAllFrames();
+ backForward()->markPagesForFullStyleRecalc();
+}
+
void Page::didMoveOnscreen()
{
for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) {
float deviceScaleFactor() const { return m_deviceScaleFactor; }
void setDeviceScaleFactor(float);
+ struct Pagination {
+ enum Mode { Unpaginated, HorizontallyPaginated, VerticallyPaginated };
+
+ Pagination()
+ : mode(Unpaginated)
+ , gap(0)
+ {
+ };
+
+ Mode mode;
+ unsigned gap;
+ };
+
+ const Pagination& pagination() const { return m_pagination; }
+ void setPagination(const Pagination&);
+
// Notifications when the Page starts and stops being presented via a native window.
void didMoveOnscreen();
void willMoveOffscreen();
float m_pageScaleFactor;
float m_deviceScaleFactor;
+ Pagination m_pagination;
+
bool m_javaScriptURLsAreAllowed;
String m_userStyleSheetPath;
setDesiredColumnCountAndWidth(desiredColumnCount, desiredColumnWidth);
}
+bool RenderBlock::requiresColumns(int desiredColumnCount) const
+{
+ return firstChild()
+ && (desiredColumnCount != 1 || !style()->hasAutoColumnWidth() || !style()->hasInlineColumnAxis())
+ && !firstChild()->isAnonymousColumnsBlock()
+ && !firstChild()->isAnonymousColumnSpanBlock();
+}
+
void RenderBlock::setDesiredColumnCountAndWidth(int count, LayoutUnit width)
{
- bool destroyColumns = !firstChild()
- || (count == 1 && style()->hasAutoColumnWidth() && style()->hasInlineColumnAxis())
- || firstChild()->isAnonymousColumnsBlock()
- || firstChild()->isAnonymousColumnSpanBlock();
+ bool destroyColumns = !requiresColumns(count);
if (destroyColumns) {
if (hasColumns()) {
delete gColumnInfoMap->take(this);
bool lineWidthForPaginatedLineChanged(RootInlineBox*, LayoutUnit lineDelta = 0) const;
bool logicalWidthChangedInRegions() const;
-
+
+ virtual bool requiresColumns(int desiredColumnCount) const;
+
public:
LayoutUnit offsetFromLogicalTopOfFirstPage() const;
RenderRegion* regionAtBlockOffset(LayoutUnit) const;
}
}
- // The background of the box generated by the root element covers the entire canvas, so just use
- // the RenderView's unscaledDocumentRect accessor.
- paintFillLayers(paintInfo, bgColor, bgLayer, view()->unscaledDocumentRect(), BackgroundBleedNone, CompositeSourceOver, bodyObject);
+ RenderView* view = this->view();
+ LayoutRect backgroundRect = view->backgroundRect();
+ flipForWritingMode(backgroundRect);
+ paintFillLayers(paintInfo, bgColor, bgLayer, backgroundRect, BackgroundBleedNone, CompositeSourceOver, bodyObject);
}
BackgroundBleedAvoidance RenderBox::determineBackgroundBleedAvoidance(GraphicsContext* context) const
#include "config.h"
#include "RenderView.h"
+#include "ColumnInfo.h"
#include "Document.h"
#include "Element.h"
#include "FloatQuad.h"
}
}
+bool RenderView::requiresColumns(int desiredColumnCount) const
+{
+ if (m_frameView) {
+ if (Frame* frame = m_frameView->frame()) {
+ if (Page* page = frame->page())
+ return frame == page->mainFrame() && page->pagination().mode != Page::Pagination::Unpaginated;
+ }
+ }
+ return RenderBlock::requiresColumns(desiredColumnCount);
+}
+
void RenderView::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
// If we ever require layout but receive a paint anyway, something has gone horribly wrong.
return overflowRect;
}
+LayoutRect RenderView::backgroundRect() const
+{
+ if (!hasColumns())
+ return unscaledDocumentRect();
+
+ ColumnInfo* columnInfo = this->columnInfo();
+ LayoutRect backgroundRect(0, 0, columnInfo->desiredColumnWidth(), columnInfo->columnHeight() * columnInfo->columnCount());
+ if (!isHorizontalWritingMode())
+ backgroundRect = backgroundRect.transposedRect();
+ return backgroundRect;
+}
+
IntRect RenderView::documentRect() const
{
IntRect overflowRect(unscaledDocumentRect());
#endif
IntRect unscaledDocumentRect() const;
+ LayoutRect backgroundRect() const;
IntRect documentRect() const;
protected:
virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&, bool* wasFixed = 0) const;
virtual void mapAbsoluteToLocalPoint(bool fixed, bool useTransforms, TransformState&) const;
+ virtual bool requiresColumns(int desiredColumnCount) const OVERRIDE;
private:
bool shouldRepaint(const IntRect& r) const;
frameView->setConstrainsScrollingToContentEdge(constrainsScrollingToContentEdgeOldValue);
}
+void Internals::setPagination(Document* document, const String& mode, int gap, ExceptionCode& ec)
+{
+ if (!document || !document->page()) {
+ ec = INVALID_ACCESS_ERR;
+ return;
+ }
+
+ Page::Pagination pagination;
+ if (mode == "Unpaginated")
+ pagination.mode = Page::Pagination::Unpaginated;
+ else if (mode == "HorizontallyPaginated")
+ pagination.mode = Page::Pagination::HorizontallyPaginated;
+ else if (mode == "VerticallyPaginated")
+ pagination.mode = Page::Pagination::VerticallyPaginated;
+ else {
+ ec = SYNTAX_ERR;
+ return;
+ }
+
+ pagination.gap = gap;
+
+ document->page()->setPagination(pagination);
+}
+
void Internals::reset(Document* document)
{
if (!document || !document->settings())
document->settings()->setPasswordEchoEnabled(passwordEchoEnabledBackup);
passwordEchoEnabledBackedUp = false;
}
+
+ if (Page* page = document->page())
+ page->setPagination(Page::Pagination());
}
bool Internals::wasLastChangeUserEdit(Element* textField, ExceptionCode& ec)
void setScrollViewPosition(Document*, long x, long y, ExceptionCode&);
+ void setPagination(Document*, const String& mode, int gap, ExceptionCode&);
+
bool wasLastChangeUserEdit(Element* textField, ExceptionCode&);
String suggestedValue(Element* inputElement, ExceptionCode&);
void setSuggestedValue(Element* inputElement, const String&, ExceptionCode&);
void setScrollViewPosition(in Document document, in long x, in long y) raises(DOMException);
+ void setPagination(in Document document, in DOMString mode, in long gap) raises(DOMException);
+
boolean wasLastChangeUserEdit(in Element textField) raises (DOMException);
DOMString suggestedValue(in Element inputElement) raises (DOMException);
void setSuggestedValue(in Element inputElement, in DOMString value) raises (DOMException);
+2011-11-08 Dan Bernstein <mitz@apple.com>
+
+ <rdar://problem/10262225> Allow RenderView to have columns
+ https://bugs.webkit.org/show_bug.cgi?id=71840
+
+ * win/WebKit2.def: Export Page::setPagination() for WebCoreTestSupport.
+
2011-11-08 Jon Lee <jonlee@apple.com>
[WK2] Expose acceptMIMETypes for file inputs
?removeShadowRoot@Element@WebCore@@QAEXXZ
?scrollElementToRect@FrameView@WebCore@@QAEXPAVElement@2@ABVIntRect@2@@Z
?setDOMException@WebCore@@YAXPAVExecState@JSC@@H@Z
+ ?setPagination@Page@WebCore@@QAEXABUPagination@12@@Z
?setResourcesDataSizeLimitsFromInternals@InspectorController@WebCore@@QAEXHH@Z
?setScrollbarsSuppressed@ScrollView@WebCore@@QAEX_N0@Z
?setScrollOffsetFromInternals@ScrollableArea@WebCore@@QAEXABVIntPoint@2@@Z