Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: Fix README.md Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp b/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
index 214c5e57195ff36402510100de76d59a25a30f5c..2558ed33ab52b4e7e6919a608c794f3ed32b599a 100644
--- a/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
+++ b/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
@@ -53,7 +53,7 @@ class ScrollAnchorTest : public RenderingTest {
update();
}
- void scrollLayoutViewport(DoubleSize delta) {
+ void scrollLayoutViewport(ScrollOffset delta) {
Element* scrollingElement = document().scrollingElement();
if (delta.width())
scrollingElement->setScrollLeft(scrollingElement->scrollLeft() +
@@ -76,7 +76,7 @@ TEST_F(ScrollAnchorTest, UMAMetricUpdated) {
ScrollableArea* viewport = layoutViewport();
// Scroll position not adjusted, metric not updated.
- scrollLayoutViewport(DoubleSize(0, 150));
+ scrollLayoutViewport(ScrollOffset(0, 150));
histogramTester.expectTotalCount("Layout.ScrollAnchor.AdjustedScrollOffset",
0);
@@ -85,7 +85,7 @@ TEST_F(ScrollAnchorTest, UMAMetricUpdated) {
histogramTester.expectUniqueSample("Layout.ScrollAnchor.AdjustedScrollOffset",
1, 1);
- EXPECT_EQ(250, viewport->scrollPosition().y());
+ EXPECT_EQ(250, viewport->scrollOffsetInt().height());
EXPECT_EQ(document().getElementById("block2")->layoutObject(),
scrollAnchor(viewport).anchorObject());
}
@@ -101,10 +101,10 @@ TEST_F(ScrollAnchorTest, Basic) {
// No anchor at origin (0,0).
EXPECT_EQ(nullptr, scrollAnchor(viewport).anchorObject());
- scrollLayoutViewport(DoubleSize(0, 150));
+ scrollLayoutViewport(ScrollOffset(0, 150));
setHeight(document().getElementById("block1"), 200);
- EXPECT_EQ(250, viewport->scrollPosition().y());
+ EXPECT_EQ(250, viewport->scrollOffsetInt().height());
EXPECT_EQ(document().getElementById("block2")->layoutObject(),
scrollAnchor(viewport).anchorObject());
@@ -137,12 +137,12 @@ TEST_F(ScrollAnchorTest, VisualViewportAnchors) {
setHeight(document().getElementById("div"), 10);
EXPECT_EQ(document().getElementById("text")->layoutObject(),
scrollAnchor(lViewport).anchorObject());
- EXPECT_EQ(top - 90, vViewport.scrollPosition().y());
+ EXPECT_EQ(top - 90, vViewport.scrollOffsetInt().height());
setHeight(document().getElementById("div"), 100);
EXPECT_EQ(document().getElementById("text")->layoutObject(),
scrollAnchor(lViewport).anchorObject());
- EXPECT_EQ(top, vViewport.scrollPosition().y());
+ EXPECT_EQ(top, vViewport.scrollOffsetInt().height());
// Scrolling the visual viewport should clear the anchor.
vViewport.setLocation(FloatPoint(0, 0));
@@ -175,15 +175,15 @@ TEST_F(ScrollAnchorTest, ClippedScrollersSkipped) {
ScrollableArea* viewport = layoutViewport();
document().getElementById("scroller")->setScrollTop(100);
- scrollLayoutViewport(DoubleSize(0, 350));
+ scrollLayoutViewport(ScrollOffset(0, 350));
setHeight(document().getElementById("innerChanger"), 200);
setHeight(document().getElementById("outerChanger"), 150);
- EXPECT_EQ(300, scroller->scrollPosition().y());
+ EXPECT_EQ(300, scroller->scrollOffsetInt().height());
EXPECT_EQ(document().getElementById("innerAnchor")->layoutObject(),
scrollAnchor(scroller).anchorObject());
- EXPECT_EQ(500, viewport->scrollPosition().y());
+ EXPECT_EQ(500, viewport->scrollOffsetInt().height());
EXPECT_EQ(document().getElementById("outerAnchor")->layoutObject(),
scrollAnchor(viewport).anchorObject());
}
@@ -202,11 +202,11 @@ TEST_F(ScrollAnchorTest, AnchoringWhenContentRemoved) {
"<div id='anchor'></div>");
ScrollableArea* viewport = layoutViewport();
- scrollLayoutViewport(DoubleSize(0, 1600));
+ scrollLayoutViewport(ScrollOffset(0, 1600));
setHeight(document().getElementById("changer"), 0);
- EXPECT_EQ(100, viewport->scrollPosition().y());
+ EXPECT_EQ(100, viewport->scrollOffsetInt().height());
EXPECT_EQ(document().getElementById("anchor")->layoutObject(),
scrollAnchor(viewport).anchorObject());
}
@@ -235,7 +235,7 @@ TEST_F(ScrollAnchorTest, AnchoringWhenContentRemovedFromScrollingDiv) {
setHeight(document().getElementById("changer"), 0);
- EXPECT_EQ(100, scroller->scrollPosition().y());
+ EXPECT_EQ(100, scroller->scrollOffsetInt().height());
EXPECT_EQ(document().getElementById("anchor")->layoutObject(),
scrollAnchor(scroller).anchorObject());
}
@@ -247,13 +247,13 @@ TEST_F(ScrollAnchorTest, FractionalOffsetsAreRoundedBeforeComparing) {
"<div id='block2' style='height: 100px'>def</div>");
ScrollableArea* viewport = layoutViewport();
- scrollLayoutViewport(DoubleSize(0, 100));
+ scrollLayoutViewport(ScrollOffset(0, 100));
document().getElementById("block1")->setAttribute(HTMLNames::styleAttr,
"height: 50.6px");
update();
- EXPECT_EQ(101, viewport->scrollPosition().y());
+ EXPECT_EQ(101, viewport->scrollOffsetInt().height());
}
TEST_F(ScrollAnchorTest, AnchorWithLayerInScrollingDiv) {
@@ -274,17 +274,17 @@ TEST_F(ScrollAnchorTest, AnchorWithLayerInScrollingDiv) {
Element* block1 = document().getElementById("block1");
Element* block2 = document().getElementById("block2");
- scroller->scrollBy(DoubleSize(0, 150), UserScroll);
+ scroller->scrollBy(ScrollOffset(0, 150), UserScroll);
// In this layout pass we will anchor to #block2 which has its own PaintLayer.
setHeight(block1, 200);
- EXPECT_EQ(250, scroller->scrollPosition().y());
+ EXPECT_EQ(250, scroller->scrollOffsetInt().height());
EXPECT_EQ(block2->layoutObject(), scrollAnchor(scroller).anchorObject());
// Test that the anchor object can be destroyed without affecting the scroll position.
block2->remove();
update();
- EXPECT_EQ(250, scroller->scrollPosition().y());
+ EXPECT_EQ(250, scroller->scrollOffsetInt().height());
}
TEST_F(ScrollAnchorTest, ExcludeAnonymousCandidates) {
@@ -335,7 +335,7 @@ TEST_F(ScrollAnchorTest, FullyContainedInlineBlock) {
" <span id=ib2>def</span>"
"</span>");
- scrollLayoutViewport(DoubleSize(0, 150));
+ scrollLayoutViewport(ScrollOffset(0, 150));
Element* ib1 = document().getElementById("ib1");
ib1->setAttribute(HTMLNames::styleAttr, "line-height: 150px");
@@ -358,7 +358,7 @@ TEST_F(ScrollAnchorTest, TextBounds) {
"abc <b id=b>def</b> ghi"
"<div id=a>after</div>");
- scrollLayoutViewport(DoubleSize(0, 150));
+ scrollLayoutViewport(ScrollOffset(0, 150));
setHeight(document().getElementById("a"), 100);
EXPECT_EQ(document().getElementById("b")->layoutObject()->slowFirstChild(),
@@ -376,7 +376,7 @@ TEST_F(ScrollAnchorTest, ExcludeFixedPosition) {
"<div id=c>content</div>"
"<div id=a>after</div>");
- scrollLayoutViewport(DoubleSize(0, 50));
+ scrollLayoutViewport(ScrollOffset(0, 50));
setHeight(document().getElementById("a"), 100);
EXPECT_EQ(document().getElementById("c")->layoutObject(),
@@ -411,7 +411,7 @@ TEST_F(ScrollAnchorTest, ExcludeAbsolutePositionThatSticksToViewport) {
Element* absPos = document().getElementById("abs");
Element* relPos = document().getElementById("rel");
- scroller->scrollBy(DoubleSize(0, 25), UserScroll);
+ scroller->scrollBy(ScrollOffset(0, 25), UserScroll);
setHeight(document().getElementById("a"), 100);
// When the scroller is position:static, the anchor cannot be position:absolute.
@@ -419,7 +419,7 @@ TEST_F(ScrollAnchorTest, ExcludeAbsolutePositionThatSticksToViewport) {
scrollerElement->setAttribute(HTMLNames::styleAttr, "position: relative");
update();
- scroller->scrollBy(DoubleSize(0, 25), UserScroll);
+ scroller->scrollBy(ScrollOffset(0, 25), UserScroll);
setHeight(document().getElementById("a"), 125);
// When the scroller is position:relative, the anchor may be position:absolute.
@@ -445,10 +445,10 @@ TEST_F(ScrollAnchorTest, DescendsIntoContainerWithOverflow) {
ScrollableArea* viewport = layoutViewport();
- scrollLayoutViewport(DoubleSize(0, 200));
+ scrollLayoutViewport(ScrollOffset(0, 200));
setHeight(document().getElementById("changer"), 200);
- EXPECT_EQ(300, viewport->scrollPosition().y());
+ EXPECT_EQ(300, viewport->scrollOffsetInt().height());
EXPECT_EQ(document().getElementById("bottom")->layoutObject(),
scrollAnchor(viewport).anchorObject());
}
@@ -482,10 +482,10 @@ TEST_F(ScrollAnchorTest, DescendsIntoContainerWithFloat) {
ScrollableArea* viewport = layoutViewport();
- scrollLayoutViewport(DoubleSize(0, 200));
+ scrollLayoutViewport(ScrollOffset(0, 200));
setHeight(document().getElementById("a"), 100);
- EXPECT_EQ(200, viewport->scrollPosition().y());
+ EXPECT_EQ(200, viewport->scrollOffsetInt().height());
EXPECT_EQ(document().getElementById("float")->layoutObject(),
scrollAnchor(viewport).anchorObject());
}
@@ -503,13 +503,13 @@ TEST_F(ScrollAnchorTest, ChangeInFlowStateDisablesAnchoringForMainScroller) {
"<div id='content'></div>");
ScrollableArea* viewport = layoutViewport();
- scrollLayoutViewport(DoubleSize(0, 200));
+ scrollLayoutViewport(ScrollOffset(0, 200));
document().getElementById("header")->setAttribute(HTMLNames::styleAttr,
"position: fixed;");
update();
- EXPECT_EQ(200, viewport->scrollPosition().y());
+ EXPECT_EQ(200, viewport->scrollOffsetInt().height());
}
// This test verifies that scroll anchoring is disabled when any element within
@@ -537,7 +537,7 @@ TEST_F(ScrollAnchorTest, ChangeInFlowStateDisablesAnchoringForScrollingDiv) {
"position: absolute;");
update();
- EXPECT_EQ(100, scroller->scrollPosition().y());
+ EXPECT_EQ(100, scroller->scrollOffsetInt().height());
}
TEST_F(ScrollAnchorTest, FlexboxDelayedClampingAlsoDelaysAdjustment) {
@@ -567,7 +567,7 @@ TEST_F(ScrollAnchorTest, FlexboxDelayedClampingAlsoDelaysAdjustment) {
scroller->setScrollTop(100);
setHeight(document().getElementById("before"), 100);
- EXPECT_EQ(150, scrollerForElement(scroller)->scrollPosition().y());
+ EXPECT_EQ(150, scrollerForElement(scroller)->scrollOffsetInt().height());
}
TEST_F(ScrollAnchorTest, FlexboxDelayedAdjustmentRespectsSANACLAP) {
@@ -598,7 +598,7 @@ TEST_F(ScrollAnchorTest, FlexboxDelayedAdjustmentRespectsSANACLAP) {
document().getElementById("spacer")->setAttribute(HTMLNames::styleAttr,
"margin-top: 50px");
update();
- EXPECT_EQ(100, scrollerForElement(scroller)->scrollPosition().y());
+ EXPECT_EQ(100, scrollerForElement(scroller)->scrollOffsetInt().height());
}
// Test then an element and its children are not selected as the anchor when
@@ -621,16 +621,16 @@ TEST_F(ScrollAnchorTest, OptOutElement) {
"<div class='div' id='secondDiv'></div>");
ScrollableArea* viewport = layoutViewport();
- scrollLayoutViewport(DoubleSize(0, 50));
+ scrollLayoutViewport(ScrollOffset(0, 50));
// No opt-out.
setHeight(document().getElementById("changer"), 100);
- EXPECT_EQ(150, viewport->scrollPosition().y());
+ EXPECT_EQ(150, viewport->scrollOffsetInt().height());
EXPECT_EQ(document().getElementById("innerDiv")->layoutObject(),
scrollAnchor(viewport).anchorObject());
// Clear anchor and opt-out element.
- scrollLayoutViewport(DoubleSize(0, 10));
+ scrollLayoutViewport(ScrollOffset(0, 10));
document()
.getElementById("firstDiv")
->setAttribute(HTMLNames::styleAttr,
@@ -639,7 +639,7 @@ TEST_F(ScrollAnchorTest, OptOutElement) {
// Opted out element and it's children skipped.
setHeight(document().getElementById("changer"), 200);
- EXPECT_EQ(260, viewport->scrollPosition().y());
+ EXPECT_EQ(260, viewport->scrollOffsetInt().height());
EXPECT_EQ(document().getElementById("secondDiv")->layoutObject(),
scrollAnchor(viewport).anchorObject());
}
@@ -652,11 +652,11 @@ TEST_F(ScrollAnchorTest,
ScrollableArea* viewport = layoutViewport();
- scrollLayoutViewport(DoubleSize(0, 50));
+ scrollLayoutViewport(ScrollOffset(0, 50));
document().body()->setAttribute(HTMLNames::styleAttr, "padding-top: 20px");
update();
- EXPECT_EQ(50, viewport->scrollPosition().y());
+ EXPECT_EQ(50, viewport->scrollOffsetInt().height());
EXPECT_EQ(nullptr, scrollAnchor(viewport).anchorObject());
}
@@ -667,12 +667,12 @@ TEST_F(ScrollAnchorTest, AnchorNodeAncestorChangingNonLayoutAffectingProperty) {
"<div id='block2'>def</div>");
ScrollableArea* viewport = layoutViewport();
- scrollLayoutViewport(DoubleSize(0, 150));
+ scrollLayoutViewport(ScrollOffset(0, 150));
document().body()->setAttribute(HTMLNames::styleAttr, "color: red");
setHeight(document().getElementById("block1"), 200);
- EXPECT_EQ(250, viewport->scrollPosition().y());
+ EXPECT_EQ(250, viewport->scrollOffsetInt().height());
EXPECT_EQ(document().getElementById("block2")->layoutObject(),
scrollAnchor(viewport).anchorObject());
}
@@ -688,7 +688,7 @@ TEST_F(ScrollAnchorTest, TransformIsLayoutAffecting) {
ScrollableArea* viewport = layoutViewport();
- scrollLayoutViewport(DoubleSize(0, 50));
+ scrollLayoutViewport(ScrollOffset(0, 50));
document().getElementById("block1")->setAttribute(
HTMLNames::styleAttr, "transform: matrix(1, 0, 0, 1, 25, 25);");
update();
@@ -698,7 +698,7 @@ TEST_F(ScrollAnchorTest, TransformIsLayoutAffecting) {
setHeight(document().getElementById("a"), 100);
update();
- EXPECT_EQ(50, viewport->scrollPosition().y());
+ EXPECT_EQ(50, viewport->scrollOffsetInt().height());
EXPECT_EQ(nullptr, scrollAnchor(viewport).anchorObject());
}
@@ -726,17 +726,17 @@ TEST_F(ScrollAnchorTest, OptOutBody) {
ScrollableArea* viewport = layoutViewport();
document().getElementById("scroller")->setScrollTop(100);
- scrollLayoutViewport(DoubleSize(0, 100));
+ scrollLayoutViewport(ScrollOffset(0, 100));
setHeight(document().getElementById("innerChanger"), 200);
setHeight(document().getElementById("outerChanger"), 150);
// Scroll anchoring should apply within #scroller.
- EXPECT_EQ(300, scroller->scrollPosition().y());
+ EXPECT_EQ(300, scroller->scrollOffsetInt().height());
EXPECT_EQ(document().getElementById("innerAnchor")->layoutObject(),
scrollAnchor(scroller).anchorObject());
// Scroll anchoring should not apply within main frame.
- EXPECT_EQ(100, viewport->scrollPosition().y());
+ EXPECT_EQ(100, viewport->scrollOffsetInt().height());
EXPECT_EQ(nullptr, scrollAnchor(viewport).anchorObject());
}
@@ -767,16 +767,16 @@ TEST_F(ScrollAnchorTest, OptOutScrollingDiv) {
ScrollableArea* viewport = layoutViewport();
document().getElementById("scroller")->setScrollTop(100);
- scrollLayoutViewport(DoubleSize(0, 100));
+ scrollLayoutViewport(ScrollOffset(0, 100));
setHeight(document().getElementById("innerChanger"), 200);
setHeight(document().getElementById("outerChanger"), 150);
// Scroll anchoring should not apply within #scroller.
- EXPECT_EQ(100, scroller->scrollPosition().y());
+ EXPECT_EQ(100, scroller->scrollOffsetInt().height());
EXPECT_EQ(nullptr, scrollAnchor(scroller).anchorObject());
// Scroll anchoring should apply within main frame.
- EXPECT_EQ(250, viewport->scrollPosition().y());
+ EXPECT_EQ(250, viewport->scrollOffsetInt().height());
EXPECT_EQ(document().getElementById("outerAnchor")->layoutObject(),
scrollAnchor(viewport).anchorObject());
}
@@ -828,30 +828,30 @@ TEST_F(ScrollAnchorTest, NonDefaultRootScroller) {
setHeight(document().getElementById("firstChild"), 1000);
// Scroll anchoring should be applied to #rootScroller.
- EXPECT_EQ(1000, scroller->scrollPosition().y());
+ EXPECT_EQ(1000, scroller->scrollOffset().height());
EXPECT_EQ(document().getElementById("target")->layoutObject(),
scrollAnchor(scroller).anchorObject());
// Scroll anchoring should not apply within main frame.
- EXPECT_EQ(0, layoutViewport()->scrollPosition().y());
+ EXPECT_EQ(0, layoutViewport()->scrollOffset().height());
EXPECT_EQ(nullptr, scrollAnchor(layoutViewport()).anchorObject());
}
class ScrollAnchorCornerTest : public ScrollAnchorTest {
protected:
void checkCorner(Corner corner,
- DoublePoint startPos,
- DoubleSize expectedAdjustment) {
+ ScrollOffset startOffset,
+ ScrollOffset expectedAdjustment) {
ScrollableArea* viewport = layoutViewport();
Element* element = document().getElementById("changer");
- viewport->setScrollPosition(startPos, UserScroll);
+ viewport->setScrollOffset(startOffset, UserScroll);
element->setAttribute(HTMLNames::classAttr, "change");
update();
- DoublePoint endPos = startPos;
- endPos.move(expectedAdjustment);
+ ScrollOffset endPos = startOffset;
+ endPos += expectedAdjustment;
- EXPECT_EQ(endPos, viewport->scrollPositionDouble());
+ EXPECT_EQ(endPos, viewport->scrollOffset());
EXPECT_EQ(document().getElementById("a")->layoutObject(),
scrollAnchor(viewport).anchorObject());
EXPECT_EQ(corner, scrollAnchor(viewport).corner());
@@ -872,7 +872,7 @@ TEST_F(ScrollAnchorCornerTest, CornersLTR) {
"<div id='changer'></div>"
"<div id='a'></div>");
- checkCorner(Corner::TopLeft, DoublePoint(20, 20), DoubleSize(0, 100));
+ checkCorner(Corner::TopLeft, ScrollOffset(20, 20), ScrollOffset(0, 100));
}
// Verify that we anchor to the top left corner of an anchor element for
@@ -888,7 +888,7 @@ TEST_F(ScrollAnchorCornerTest, CornersVerticalLR) {
"<div id='changer'></div>"
"<div id='a'></div>");
- checkCorner(Corner::TopLeft, DoublePoint(20, 20), DoubleSize(100, 0));
+ checkCorner(Corner::TopLeft, ScrollOffset(20, 20), ScrollOffset(100, 0));
}
// Verify that we anchor to the top right corner of an anchor element for RTL.
@@ -903,7 +903,7 @@ TEST_F(ScrollAnchorCornerTest, CornersRTL) {
"<div id='changer'></div>"
"<div id='a'></div>");
- checkCorner(Corner::TopRight, DoublePoint(-20, 20), DoubleSize(0, 100));
+ checkCorner(Corner::TopRight, ScrollOffset(-20, 20), ScrollOffset(0, 100));
}
// Verify that we anchor to the top right corner of an anchor element for
@@ -919,7 +919,7 @@ TEST_F(ScrollAnchorCornerTest, CornersVerticalRL) {
"<div id='changer'></div>"
"<div id='a'></div>");
- checkCorner(Corner::TopRight, DoublePoint(-20, 20), DoubleSize(-100, 0));
+ checkCorner(Corner::TopRight, ScrollOffset(-20, 20), ScrollOffset(-100, 0));
}
TEST_F(ScrollAnchorTest, IgnoreNonBlockLayoutAxis) {
@@ -940,7 +940,7 @@ TEST_F(ScrollAnchorTest, IgnoreNonBlockLayoutAxis) {
"<div id='b'></div><div id='c'></div>");
ScrollableArea* viewport = layoutViewport();
- scrollLayoutViewport(DoubleSize(150, 0));
+ scrollLayoutViewport(ScrollOffset(150, 0));
Element* a = document().getElementById("a");
Element* b = document().getElementById("b");
@@ -948,15 +948,15 @@ TEST_F(ScrollAnchorTest, IgnoreNonBlockLayoutAxis) {
a->setAttribute(HTMLNames::styleAttr, "height: 150px");
update();
- EXPECT_EQ(DoublePoint(150, 0), viewport->scrollPositionDouble());
+ EXPECT_EQ(ScrollOffset(150, 0), viewport->scrollOffset());
EXPECT_EQ(nullptr, scrollAnchor(viewport).anchorObject());
- scrollLayoutViewport(DoubleSize(0, 50));
+ scrollLayoutViewport(ScrollOffset(0, 50));
a->setAttribute(HTMLNames::styleAttr, "height: 200px");
b->setAttribute(HTMLNames::styleAttr, "width: 150px");
update();
- EXPECT_EQ(DoublePoint(150, 100), viewport->scrollPositionDouble());
+ EXPECT_EQ(ScrollOffset(150, 100), viewport->scrollOffset());
EXPECT_EQ(c->layoutObject(), scrollAnchor(viewport).anchorObject());
a->setAttribute(HTMLNames::styleAttr, "height: 100px");
@@ -965,19 +965,19 @@ TEST_F(ScrollAnchorTest, IgnoreNonBlockLayoutAxis) {
"writing-mode: vertical-rl");
document().scrollingElement()->setScrollLeft(0);
document().scrollingElement()->setScrollTop(0);
- scrollLayoutViewport(DoubleSize(0, 150));
+ scrollLayoutViewport(ScrollOffset(0, 150));
a->setAttribute(HTMLNames::styleAttr, "width: 150px");
update();
- EXPECT_EQ(DoublePoint(0, 150), viewport->scrollPositionDouble());
+ EXPECT_EQ(ScrollOffset(0, 150), viewport->scrollOffset());
EXPECT_EQ(nullptr, scrollAnchor(viewport).anchorObject());
- scrollLayoutViewport(DoubleSize(-50, 0));
+ scrollLayoutViewport(ScrollOffset(-50, 0));
a->setAttribute(HTMLNames::styleAttr, "width: 200px");
b->setAttribute(HTMLNames::styleAttr, "height: 150px");
update();
- EXPECT_EQ(DoublePoint(-100, 150), viewport->scrollPositionDouble());
+ EXPECT_EQ(ScrollOffset(-100, 150), viewport->scrollOffset());
EXPECT_EQ(c->layoutObject(), scrollAnchor(viewport).anchorObject());
}
}

Powered by Google App Engine
This is Rietveld 408576698