diff options
author | ojan@chromium.org <ojan@chromium.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2014-02-05 08:58:53 +0000 |
---|---|---|
committer | ojan@chromium.org <ojan@chromium.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2014-02-05 08:58:53 +0000 |
commit | 5def7f80ecef792ee23e5900b23e5f2dbc0bc570 (patch) | |
tree | 11be8e500651b21919bcbc9523fb9e7674a0b868 | |
parent | 7a3635f275779dcecd822e9c804403bf21ba4d00 (diff) | |
download | chromium_src-5def7f80ecef792ee23e5900b23e5f2dbc0bc570.zip chromium_src-5def7f80ecef792ee23e5900b23e5f2dbc0bc570.tar.gz chromium_src-5def7f80ecef792ee23e5900b23e5f2dbc0bc570.tar.bz2 |
We don't have any API that calls setPagination. This was from
Apple's use of WebKit.
With setPagination gone, we no longer need to keep bits on both
Page and FrameView for pagination. We just keep the FrameView one,
which you can actually set via CSS (i.e. see
FrameView::applyPaginationToViewport).
Also, fixes a bug in paginationModeForRenderStyle to keep the
tests passing.
I changed fast/multicol/hit-test-gap-between-pages-flipped.html a bit
so that it would still spit out PASS even though I believe it now
exposes a bug in caretRangeFromPoint combined with pagination
and horizontal-bt writing mode.
Finally, the virtual calcColumnWidth can be removed as the version
in RenderBlock works for the RenderView now.
Review URL: https://codereview.chromium.org/150413007
git-svn-id: svn://svn.chromium.org/blink/trunk@166475 bbb929c8-8fbe-4397-9dbb-9b2b20218538
26 files changed, 60 insertions, 204 deletions
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index d633999..8b5299f 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations @@ -875,10 +875,12 @@ crbug.com/339174 fast/writing-mode/Kusa-Makura-background-canvas.html [ Pass Fai crbug.com/339252 inspector/timeline/timeline-window-filter.html [ Pass Timeout ] crbug.com/339259 fast/flexbox/box-orient-button.html [ Pass Failure ] crbug.com/339238 inspector/layer-tree-model.html [ Pass Failure ] -crbug.com/339394 [ Win Debug ] virtual/threaded/animations/animation-matrix-negative-scale-unmatrix.html [ Pass Failure ] +crbug.com/339394 [ Win Debug ] virtual/threaded/animations/animation-matrix-negative-scale-unmatrix.html [ Pass Failure ] crbug.com/339592 media/track/opera/interfaces/TextTrackList/onaddtrack.html [ Pass Crash ] crbug.com/339597 http/tests/navigation/back-to-redirect-with-frame.php [ Pass Timeout ] +Bug(ojan) fast/multicol/shrink-to-column-height-for-pagination.html [ NeedsRebaseline ] + # Disable failing tests for the new WebSocket implementation crbug.com/339373 http/tests/security/contentSecurityPolicy/connect-src-websocket-allowed.html [ Skip ] crbug.com/339373 http/tests/inspector/websocket/websocket-frame.html [ Skip ] diff --git a/third_party/WebKit/LayoutTests/compositing/columns/composited-in-paginated.html b/third_party/WebKit/LayoutTests/compositing/columns/composited-in-paginated.html index dd208aa..e08a31b 100644 --- a/third_party/WebKit/LayoutTests/compositing/columns/composited-in-paginated.html +++ b/third_party/WebKit/LayoutTests/compositing/columns/composited-in-paginated.html @@ -1,12 +1,9 @@ -<html> +<html style="overflow: -webkit-paged-x;"> <head> <script> if (window.testRunner) testRunner.dumpAsText(); - if (window.internals) - internals.setPagination(document, "LeftToRightPaginated", 0); - function dumpLayers() { if (window.testRunner) @@ -21,7 +18,7 @@ margin: 10px; background-color: silver; } - + .box { height: 100px; width: 100px; diff --git a/third_party/WebKit/LayoutTests/compositing/columns/geometry-map-paginated-assert.html b/third_party/WebKit/LayoutTests/compositing/columns/geometry-map-paginated-assert.html index 30ac50c..e8f547e 100644 --- a/third_party/WebKit/LayoutTests/compositing/columns/geometry-map-paginated-assert.html +++ b/third_party/WebKit/LayoutTests/compositing/columns/geometry-map-paginated-assert.html @@ -1,11 +1,8 @@ -<html> +<html style="overflow: -webkit-paged-x;"> <head> <script> if (window.testRunner) testRunner.dumpAsText(); - - if (window.internals) - internals.setPagination(document, "LeftToRightPaginated", 0); </script> <style> .spacer { @@ -14,7 +11,7 @@ margin: 10px; background-color: silver; } - + .box { height: 100px; width: 100px; diff --git a/third_party/WebKit/LayoutTests/fast/multicol/hit-test-gap-between-pages-flipped.html b/third_party/WebKit/LayoutTests/fast/multicol/hit-test-gap-between-pages-flipped.html index 158e573..829f529 100644 --- a/third_party/WebKit/LayoutTests/fast/multicol/hit-test-gap-between-pages-flipped.html +++ b/third_party/WebKit/LayoutTests/fast/multicol/hit-test-gap-between-pages-flipped.html @@ -1,17 +1,17 @@ <html> - <body style="margin: 0; -webkit-writing-mode: horizontal-bt;"> - <div style="height: 50%;"></div> - <div style="height: 50%;"></div> - <div id="target" style="height: 50%;"></div> - <div style="height: 50%;"></div> - <div id="result">FAIL: Test did not run (DumpRenderTree or WebKitTestRunner needed)</div> + <body style="margin: 0;"> + <div style="-webkit-writing-mode: horizontal-bt; overflow: -webkit-paged-x; -webkit-column-gap: 20px; height: 600px; width: 100px;"> + <div style="height: 50%;"></div> + <div style="height: 50%;"></div> + <div style="height: 50%;"></div> + <div id="target" style="height: 50%;"></div> + <div id="result"></div> + </div> <script> - if (window.testRunner) { + if (window.testRunner) testRunner.dumpAsText(); - internals.setPagination(document, "LeftToRightPaginated", 20, 100); - document.getElementById("result").innerText = document.caretRangeFromPoint(115, 550).startContainer === document.getElementById("target") - ? "PASS" : "FAIL"; - } + // FIXME: This is incorrect. The startContainer should be the 3rd div, not the 4th. + document.getElementById("result").innerText = document.caretRangeFromPoint(115, 550).startContainer === document.getElementById("target") ? "PASS" : "FAIL"; </script> </body> </html> diff --git a/third_party/WebKit/LayoutTests/fast/multicol/hit-test-gap-between-pages.html b/third_party/WebKit/LayoutTests/fast/multicol/hit-test-gap-between-pages.html index bce92b8..83ddb05 100644 --- a/third_party/WebKit/LayoutTests/fast/multicol/hit-test-gap-between-pages.html +++ b/third_party/WebKit/LayoutTests/fast/multicol/hit-test-gap-between-pages.html @@ -1,17 +1,16 @@ <html> <body style="margin: 0;"> - <div style="height: 50%;"></div> - <div style="height: 50%;"></div> - <div id="target" style="height: 50%;"></div> - <div style="height: 50%;"></div> - <div id="result">FAIL: Test did not run (DumpRenderTree or WebKitTestRunner needed)</div> + <div style="overflow: -webkit-paged-x; -webkit-column-gap: 20px; height: 300px; width: 100px; "> + <div id=a style="height: 50%;"></div> + <div id=b style="height: 50%;"></div> + <div id="target" style="height: 50%;"></div> + <div id=c style="height: 50%;"></div> + <div id="result"></div> + </div> <script> - if (window.testRunner) { + if (window.testRunner) testRunner.dumpAsText(); - internals.setPagination(document, "LeftToRightPaginated", 20, 100); - document.getElementById("result").innerText = document.caretRangeFromPoint(115, 50).startContainer === document.getElementById("target") - ? "PASS" : "FAIL"; - } + document.getElementById("result").innerText = document.caretRangeFromPoint(115, 50).startContainer === document.getElementById("target") ? "PASS" : "FAIL"; </script> </body> </html> diff --git a/third_party/WebKit/LayoutTests/fast/multicol/pagination-h-horizontal-bt.html b/third_party/WebKit/LayoutTests/fast/multicol/pagination-h-horizontal-bt.html index 0764e5c..a358079 100644 --- a/third_party/WebKit/LayoutTests/fast/multicol/pagination-h-horizontal-bt.html +++ b/third_party/WebKit/LayoutTests/fast/multicol/pagination-h-horizontal-bt.html @@ -1,10 +1,4 @@ -<html style="-webkit-writing-mode: horizontal-bt;"> -<head> - <script> - if (window.internals) - internals.setPagination(document, "LeftToRightPaginated", 0); - </script> -</head> +<html style="-webkit-writing-mode: horizontal-bt; overflow: -webkit-paged-x;"> <body> <div style="border: solid; height: 900px; font: 50px ahem; -webkit-font-smoothing: none;"> <br><br><br><br><br><br><br><br><br><br> diff --git a/third_party/WebKit/LayoutTests/fast/multicol/pagination-h-horizontal-tb.html b/third_party/WebKit/LayoutTests/fast/multicol/pagination-h-horizontal-tb.html index b9828fa..966e841 100644 --- a/third_party/WebKit/LayoutTests/fast/multicol/pagination-h-horizontal-tb.html +++ b/third_party/WebKit/LayoutTests/fast/multicol/pagination-h-horizontal-tb.html @@ -1,10 +1,4 @@ -<html style="-webkit-writing-mode: horizontal-tb;"> -<head> - <script> - if (window.internals) - internals.setPagination(document, "LeftToRightPaginated", 0); - </script> -</head> +<html style="-webkit-writing-mode: horizontal-tb; overflow: -webkit-paged-x;"> <body> <div style="border: solid; height: 900px; font: 50px ahem; -webkit-font-smoothing: none;"> <br><br><br><br><br><br><br><br><br><br> diff --git a/third_party/WebKit/LayoutTests/fast/multicol/pagination-h-vertical-lr.html b/third_party/WebKit/LayoutTests/fast/multicol/pagination-h-vertical-lr.html index e0e7300..e8dd329 100644 --- a/third_party/WebKit/LayoutTests/fast/multicol/pagination-h-vertical-lr.html +++ b/third_party/WebKit/LayoutTests/fast/multicol/pagination-h-vertical-lr.html @@ -1,10 +1,4 @@ -<html style="-webkit-writing-mode: vertical-lr;"> -<head> - <script> - if (window.internals) - internals.setPagination(document, "LeftToRightPaginated", 0); - </script> -</head> +<html style="-webkit-writing-mode: vertical-lr; overflow: -webkit-paged-x;"> <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> diff --git a/third_party/WebKit/LayoutTests/fast/multicol/pagination-h-vertical-rl.html b/third_party/WebKit/LayoutTests/fast/multicol/pagination-h-vertical-rl.html index 6412da5..8eeb96d 100644 --- a/third_party/WebKit/LayoutTests/fast/multicol/pagination-h-vertical-rl.html +++ b/third_party/WebKit/LayoutTests/fast/multicol/pagination-h-vertical-rl.html @@ -1,10 +1,4 @@ -<html style="-webkit-writing-mode: vertical-rl;"> -<head> - <script> - if (window.internals) - internals.setPagination(document, "RightToLeftPaginated", 0); - </script> -</head> +<html style="-webkit-writing-mode: vertical-rl; overflow: -webkit-paged-x;"> <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> diff --git a/third_party/WebKit/LayoutTests/fast/multicol/pagination-v-horizontal-bt.html b/third_party/WebKit/LayoutTests/fast/multicol/pagination-v-horizontal-bt.html index 9a67328..ac2e49e 100644 --- a/third_party/WebKit/LayoutTests/fast/multicol/pagination-v-horizontal-bt.html +++ b/third_party/WebKit/LayoutTests/fast/multicol/pagination-v-horizontal-bt.html @@ -1,10 +1,4 @@ -<html style="-webkit-writing-mode: horizontal-bt;"> -<head> - <script> - if (window.internals) - internals.setPagination(document, "BottomToTopPaginated", 0); - </script> -</head> +<html style="-webkit-writing-mode: horizontal-bt; overflow: -webkit-paged-y;"> <body> <div style="border: solid; height: 900px; font: 50px ahem; -webkit-font-smoothing: none;"> <br><br><br><br><br><br><br><br><br><br> diff --git a/third_party/WebKit/LayoutTests/fast/multicol/pagination-v-horizontal-tb.html b/third_party/WebKit/LayoutTests/fast/multicol/pagination-v-horizontal-tb.html index e0496f6..7b66bc9 100644 --- a/third_party/WebKit/LayoutTests/fast/multicol/pagination-v-horizontal-tb.html +++ b/third_party/WebKit/LayoutTests/fast/multicol/pagination-v-horizontal-tb.html @@ -1,10 +1,4 @@ -<html style="-webkit-writing-mode: horizontal-tb;"> -<head> - <script> - if (window.internals) - internals.setPagination(document, "TopToBottomPaginated", 0); - </script> -</head> +<html style="-webkit-writing-mode: horizontal-tb; overflow: -webkit-paged-y;"> <body> <div style="border: solid; height: 900px; font: 50px ahem; -webkit-font-smoothing: none;"> <br><br><br><br><br><br><br><br><br><br> diff --git a/third_party/WebKit/LayoutTests/fast/multicol/pagination-v-vertical-lr.html b/third_party/WebKit/LayoutTests/fast/multicol/pagination-v-vertical-lr.html index 0f8d3bb..1f1b2d9 100644 --- a/third_party/WebKit/LayoutTests/fast/multicol/pagination-v-vertical-lr.html +++ b/third_party/WebKit/LayoutTests/fast/multicol/pagination-v-vertical-lr.html @@ -1,10 +1,4 @@ -<html style="-webkit-writing-mode: vertical-lr;"> -<head> - <script> - if (window.internals) - internals.setPagination(document, "TopToBottomPaginated", 0); - </script> -</head> +<html style="-webkit-writing-mode: vertical-lr; overflow: -webkit-paged-y;"> <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> diff --git a/third_party/WebKit/LayoutTests/fast/multicol/pagination-v-vertical-rl.html b/third_party/WebKit/LayoutTests/fast/multicol/pagination-v-vertical-rl.html index a4c85f1..c57bac1 100644 --- a/third_party/WebKit/LayoutTests/fast/multicol/pagination-v-vertical-rl.html +++ b/third_party/WebKit/LayoutTests/fast/multicol/pagination-v-vertical-rl.html @@ -1,10 +1,4 @@ -<html style="-webkit-writing-mode: vertical-rl;"> -<head> - <script> - if (window.internals) - internals.setPagination(document, "TopToBottomPaginated", 0); - </script> -</head> +<html style="-webkit-writing-mode: vertical-rl; overflow: -webkit-paged-y;"> <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> diff --git a/third_party/WebKit/LayoutTests/fast/multicol/shrink-to-column-height-for-pagination-expected.txt b/third_party/WebKit/LayoutTests/fast/multicol/shrink-to-column-height-for-pagination-expected.txt index ded30a7..d3e4fa9 100644 --- a/third_party/WebKit/LayoutTests/fast/multicol/shrink-to-column-height-for-pagination-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/multicol/shrink-to-column-height-for-pagination-expected.txt @@ -1,8 +1,10 @@ layer at (0,0) size 800x600 - RenderView at (0,0) size 400x600 -layer at (-16,0) size 416x600 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600 outlineClip at (0,0) size 800x600 - RenderBlock {HTML} at (0,0) size 416x600 - RenderBody {BODY} at (8,8) size 400x600 - RenderBlock {DIV} at (0,0) size 400x600 - RenderImage {IMG} at (392,0) size 400x600 - RenderText {#text} at (0,0) size 0x0 + RenderView at (0,0) size 800x600 +layer at (0,0) size 800x600 + RenderBlock {HTML} at (0,0) size 800x600 + RenderBody {BODY} at (0,0) size 800x600 +layer at (0,0) size 400x600 clip at (0,0) size 400x585 scrollWidth 816 + RenderBlock {DIV} at (0,0) size 400x600 + RenderBlock {DIV} at (8,8) size 400x585 + RenderImage {IMG} at (392,0) size 400x585 + RenderText {#text} at (0,0) size 0x0 diff --git a/third_party/WebKit/LayoutTests/fast/multicol/shrink-to-column-height-for-pagination.html b/third_party/WebKit/LayoutTests/fast/multicol/shrink-to-column-height-for-pagination.html index 517f813..30ec100 100644 --- a/third_party/WebKit/LayoutTests/fast/multicol/shrink-to-column-height-for-pagination.html +++ b/third_party/WebKit/LayoutTests/fast/multicol/shrink-to-column-height-for-pagination.html @@ -1,18 +1,16 @@ -<html style="-webkit-writing-mode: vertical-rl;"> +<html> <head> <script> - if (window.internals) - internals.setPagination(document, "RightToLeftPaginated", 0, 400); - - if (window.testRunner) { + if (window.testRunner) testRunner.waitUntilDone(); - setTimeout('scrollTo(-400, 0); testRunner.notifyDone();', 0); - } + setTimeout('document.getElementById("container").scrollLeft = -400; if (window.testRunner) testRunner.notifyDone();', 0); </script> </head> -<body style="width:100%; height:100%;"> - <div style="width:100%; height:100%;"> - <img src="resources/big-green.png" style="width:100%; height:100%; max-width:100%; max-height:100%;"/> +<body style="margin:0;"> + <div id="container" style="width:400px; overflow:-webkit-paged-x; -webkit-writing-mode:vertical-rl;"> + <div style="width:100%; height:100%; margin:8px;"> + <img src="resources/big-green.png" style="width:100%; height:100%; max-width:100%; max-height:100%;"/> + </div> </div> </body> -</html> +</html>
\ No newline at end of file diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp index 4820c31..7e36f9e 100644 --- a/third_party/WebKit/Source/core/frame/FrameView.cpp +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp @@ -128,7 +128,7 @@ Pagination::Mode paginationModeForRenderStyle(RenderStyle* style) // paged-y always corresponds to TopToBottomPaginated or BottomToTopPaginated. If the WritingMode // is horizontal, then the direction of the horizontality dictates the choice. If the WritingMode // is vertical, then we use TextDirection to choose between those options. - if (writingMode == TopToBottomWritingMode || (!isHorizontalWritingMode && textDirection == RTL)) + if (writingMode == TopToBottomWritingMode || (!isHorizontalWritingMode && textDirection == LTR)) return Pagination::TopToBottomPaginated; return Pagination::BottomToTopPaginated; } @@ -2261,24 +2261,12 @@ void FrameView::updateOverflowStatus(bool horizontalOverflow, bool verticalOverf } -const Pagination& FrameView::pagination() const -{ - if (m_pagination != Pagination()) - return m_pagination; - - if (isMainFrame()) - return m_frame->page()->pagination(); - - return m_pagination; -} - void FrameView::setPagination(const Pagination& pagination) { if (m_pagination == pagination) return; m_pagination = pagination; - m_frame->document()->styleResolverChanged(RecalcStyleDeferred); } diff --git a/third_party/WebKit/Source/core/frame/FrameView.h b/third_party/WebKit/Source/core/frame/FrameView.h index a2c9834..4464733 100644 --- a/third_party/WebKit/Source/core/frame/FrameView.h +++ b/third_party/WebKit/Source/core/frame/FrameView.h @@ -295,14 +295,7 @@ public: // we need this function in order to do the scroll ourselves. bool wheelEvent(const PlatformWheelEvent&); - // Page and FrameView both store a Pagination value. Page::pagination() is set only by API, - // and FrameView::pagination() is set only by CSS. Page::pagination() will affect all - // FrameViews in the page cache, but FrameView::pagination() only affects the current - // FrameView. FrameView::pagination() will return m_pagination if it has been set. Otherwise, - // it will return Page::pagination() since currently there are no callers that need to - // distinguish between the two. - const Pagination& pagination() const; - void setPagination(const Pagination&); + const Pagination& pagination() const { return m_pagination; } bool inProgrammaticScroll() const { return m_inProgrammaticScroll; } void setInProgrammaticScroll(bool programmaticScroll) { m_inProgrammaticScroll = programmaticScroll; } @@ -345,6 +338,7 @@ private: void applyOverflowToViewportAndSetRenderer(RenderObject*, ScrollbarMode& hMode, ScrollbarMode& vMode); void applyPaginationToViewport(); + void setPagination(const Pagination&); void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow); diff --git a/third_party/WebKit/Source/core/page/Page.cpp b/third_party/WebKit/Source/core/page/Page.cpp index 53d206614..085e642 100644 --- a/third_party/WebKit/Source/core/page/Page.cpp +++ b/third_party/WebKit/Source/core/page/Page.cpp @@ -364,16 +364,6 @@ void Page::setDeviceScaleFactor(float scaleFactor) } } -void Page::setPagination(const Pagination& pagination) -{ - if (m_pagination == pagination) - return; - - m_pagination = pagination; - - setNeedsRecalcStyleInAllFrames(); -} - void Page::allVisitedStateChanged() { HashSet<Page*>::iterator pagesEnd = allPages().end(); diff --git a/third_party/WebKit/Source/core/page/Page.h b/third_party/WebKit/Source/core/page/Page.h index 78eeb5a..7fa6d09 100644 --- a/third_party/WebKit/Source/core/page/Page.h +++ b/third_party/WebKit/Source/core/page/Page.h @@ -188,13 +188,6 @@ public: float deviceScaleFactor() const { return m_deviceScaleFactor; } void setDeviceScaleFactor(float); - // Page and FrameView both store a Pagination value. Page::pagination() is set only by API, - // and FrameView::pagination() is set only by CSS. Page::pagination() will affect all - // FrameViews in the page cache, but FrameView::pagination() only affects the current - // FrameView. - const Pagination& pagination() const { return m_pagination; } - void setPagination(const Pagination&); - static void allVisitedStateChanged(); static void visitedStateChanged(LinkHash visitedHash); @@ -283,8 +276,6 @@ private: float m_pageScaleFactor; float m_deviceScaleFactor; - Pagination m_pagination; - RefPtr<PageGroup> m_group; OwnPtr<StorageNamespace> m_sessionStorage; diff --git a/third_party/WebKit/Source/core/rendering/Pagination.h b/third_party/WebKit/Source/core/rendering/Pagination.h index ce695f7..3af1f11 100644 --- a/third_party/WebKit/Source/core/rendering/Pagination.h +++ b/third_party/WebKit/Source/core/rendering/Pagination.h @@ -36,24 +36,22 @@ struct Pagination { Pagination() : mode(Unpaginated) , behavesLikeColumns(false) - , pageLength(0) , gap(0) { }; bool operator==(const Pagination& other) const { - return mode == other.mode && behavesLikeColumns == other.behavesLikeColumns && pageLength == other.pageLength && gap == other.gap; + return mode == other.mode && behavesLikeColumns == other.behavesLikeColumns && gap == other.gap; } bool operator!=(const Pagination& other) const { - return mode != other.mode || behavesLikeColumns != other.behavesLikeColumns || pageLength != other.pageLength || gap != other.gap; + return mode != other.mode || behavesLikeColumns != other.behavesLikeColumns || gap != other.gap; } Mode mode; bool behavesLikeColumns; - unsigned pageLength; unsigned gap; static void setStylesForPaginationMode(Mode, RenderStyle*); diff --git a/third_party/WebKit/Source/core/rendering/RenderBlock.h b/third_party/WebKit/Source/core/rendering/RenderBlock.h index 319f94a..a99bba6 100644 --- a/third_party/WebKit/Source/core/rendering/RenderBlock.h +++ b/third_party/WebKit/Source/core/rendering/RenderBlock.h @@ -503,7 +503,7 @@ private: Position positionForBox(InlineBox*, bool start = true) const; PositionWithAffinity positionForPointWithInlineChildren(const LayoutPoint&); - virtual void calcColumnWidth(); + void calcColumnWidth(); void makeChildrenAnonymousColumnBlocks(RenderObject* beforeChild, RenderBlockFlow* newBlockBox, RenderObject* newChild); void splitBlocks(RenderBlock* fromBlock, RenderBlock* toBlock, RenderBlock* middleBlock, diff --git a/third_party/WebKit/Source/core/rendering/RenderView.cpp b/third_party/WebKit/Source/core/rendering/RenderView.cpp index 24f1d9f..8530849 100644 --- a/third_party/WebKit/Source/core/rendering/RenderView.cpp +++ b/third_party/WebKit/Source/core/rendering/RenderView.cpp @@ -392,16 +392,6 @@ bool RenderView::requiresColumns(int desiredColumnCount) const return RenderBlock::requiresColumns(desiredColumnCount); } -void RenderView::calcColumnWidth() -{ - int columnWidth = contentLogicalWidth(); - if (m_frameView && style()->hasInlineColumnAxis()) { - if (int pageLength = m_frameView->pagination().pageLength) - columnWidth = pageLength; - } - setDesiredColumnCountAndWidth(1, columnWidth); -} - ColumnInfo::PaginationUnit RenderView::paginationUnit() const { if (m_frameView) @@ -956,14 +946,7 @@ int RenderView::viewWidth(ScrollableArea::IncludeScrollbarsInRect scrollbarInclu int RenderView::viewLogicalHeight() const { - int height = style()->isHorizontalWritingMode() ? viewHeight(ScrollableArea::ExcludeScrollbars) : viewWidth(ScrollableArea::ExcludeScrollbars); - - if (hasColumns() && !style()->hasInlineColumnAxis()) { - if (int pageLength = m_frameView->pagination().pageLength) - height = pageLength; - } - - return height; + return style()->isHorizontalWritingMode() ? viewHeight(ScrollableArea::ExcludeScrollbars) : viewWidth(ScrollableArea::ExcludeScrollbars); } float RenderView::zoomFactor() const diff --git a/third_party/WebKit/Source/core/rendering/RenderView.h b/third_party/WebKit/Source/core/rendering/RenderView.h index 17b2413..140ef12 100644 --- a/third_party/WebKit/Source/core/rendering/RenderView.h +++ b/third_party/WebKit/Source/core/rendering/RenderView.h @@ -207,7 +207,6 @@ private: void initializeLayoutState(LayoutState&); - virtual void calcColumnWidth() OVERRIDE; virtual ColumnInfo::PaginationUnit paginationUnit() const OVERRIDE; bool shouldRepaint(const LayoutRect&) const; diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp index 8f14886..f6136ed 100644 --- a/third_party/WebKit/Source/core/testing/Internals.cpp +++ b/third_party/WebKit/Source/core/testing/Internals.cpp @@ -199,7 +199,6 @@ void Internals::resetToConsistentState(Page* page) page->setDeviceScaleFactor(1); page->setIsCursorVisible(true); page->setPageScaleFactor(1, IntPoint(0, 0)); - page->setPagination(Pagination()); TextRun::setAllowsRoundingHacks(false); WebCore::overrideUserPreferredLanguages(Vector<AtomicString>()); delete s_pagePopupDriver; @@ -951,35 +950,6 @@ void Internals::setScrollViewPosition(Document* document, long x, long y, Except frameView->setConstrainsScrollingToContentEdge(constrainsScrollingToContentEdgeOldValue); } -void Internals::setPagination(Document* document, const String& mode, int gap, int pageLength, ExceptionState& exceptionState) -{ - if (!document || !document->page()) { - exceptionState.throwDOMException(InvalidAccessError, document ? "The document's page cannot be retrieved." : "The document provided is invalid."); - return; - } - Page* page = document->page(); - - Pagination pagination; - if (mode == "Unpaginated") - pagination.mode = Pagination::Unpaginated; - else if (mode == "LeftToRightPaginated") - pagination.mode = Pagination::LeftToRightPaginated; - else if (mode == "RightToLeftPaginated") - pagination.mode = Pagination::RightToLeftPaginated; - else if (mode == "TopToBottomPaginated") - pagination.mode = Pagination::TopToBottomPaginated; - else if (mode == "BottomToTopPaginated") - pagination.mode = Pagination::BottomToTopPaginated; - else { - exceptionState.throwDOMException(SyntaxError, "The pagination mode provided ('" + mode + "') is invalid."); - return; - } - - pagination.gap = gap; - pagination.pageLength = pageLength; - page->setPagination(pagination); -} - String Internals::viewportAsText(Document* document, float, int availableWidth, int availableHeight, ExceptionState& exceptionState) { if (!document || !document->page()) { diff --git a/third_party/WebKit/Source/core/testing/Internals.h b/third_party/WebKit/Source/core/testing/Internals.h index 27372c0..85f626a 100644 --- a/third_party/WebKit/Source/core/testing/Internals.h +++ b/third_party/WebKit/Source/core/testing/Internals.h @@ -157,8 +157,6 @@ public: void setMarkersActive(Node*, unsigned startOffset, unsigned endOffset, bool, ExceptionState&); void setScrollViewPosition(Document*, long x, long y, ExceptionState&); - void setPagination(Document* document, const String& mode, int gap, ExceptionState& ec) { setPagination(document, mode, gap, 0, ec); } - void setPagination(Document*, const String& mode, int gap, int pageLength, ExceptionState&); String viewportAsText(Document*, float devicePixelRatio, int availableWidth, int availableHeight, ExceptionState&); bool wasLastChangeUserEdit(Element* textField, ExceptionState&); diff --git a/third_party/WebKit/Source/core/testing/Internals.idl b/third_party/WebKit/Source/core/testing/Internals.idl index a7a95ff..5ce427e 100644 --- a/third_party/WebKit/Source/core/testing/Internals.idl +++ b/third_party/WebKit/Source/core/testing/Internals.idl @@ -110,8 +110,6 @@ [RaisesException] void setScrollViewPosition(Document document, long x, long y); - [RaisesException] void setPagination(Document document, DOMString mode, long gap, optional long pageLength); - [RaisesException] DOMString viewportAsText(Document document, float devicePixelRatio, long availableWidth, |