REGRESSION (r168868): eBay 'see all' links fail due to different JS bindings conversi...
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Jul 2014 22:36:14 +0000 (22:36 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Jul 2014 22:36:14 +0000 (22:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=134841
<rdar://problem/17577563>

Reviewed by Simon Fraser.

Revert back to type int for Element.scroll* APIs in order to preserve exception handling
behavior.

Source/WebCore:
Test: cssom/non-subpixel-scroll-top-left-values.html

* dom/Element.cpp:
(WebCore::Element::scrollLeft):
(WebCore::Element::scrollTop):
(WebCore::Element::setScrollLeft):
(WebCore::Element::setScrollTop):
(WebCore::Element::scrollWidth):
(WebCore::Element::scrollHeight):
* dom/Element.h:
* dom/Element.idl:
* html/HTMLBodyElement.cpp:
(WebCore::adjustForZoom):
(WebCore::HTMLBodyElement::scrollLeft):
(WebCore::HTMLBodyElement::setScrollLeft):
(WebCore::HTMLBodyElement::scrollTop):
(WebCore::HTMLBodyElement::setScrollTop):
(WebCore::HTMLBodyElement::scrollHeight):
(WebCore::HTMLBodyElement::scrollWidth):
* html/HTMLBodyElement.h:

LayoutTests:
* cssom/non-subpixel-scroll-top-left-values-expected.txt: Added.
* cssom/non-subpixel-scroll-top-left-values.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@171014 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/cssom/non-subpixel-scroll-top-left-values-expected.txt [new file with mode: 0644]
LayoutTests/cssom/non-subpixel-scroll-top-left-values.html [new file with mode: 0644]
LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt
LayoutTests/fast/dom/script-tests/non-numeric-values-numeric-parameters.js
Source/WebCore/ChangeLog
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/Element.idl
Source/WebCore/html/HTMLBodyElement.cpp
Source/WebCore/html/HTMLBodyElement.h

index 66385fd..5240a47 100644 (file)
@@ -1,3 +1,17 @@
+2014-07-11  Zalan Bujtas  <zalan@apple.com>
+
+        REGRESSION (r168868): eBay 'see all' links fail due to different JS bindings conversion behavior.
+        https://bugs.webkit.org/show_bug.cgi?id=134841
+        <rdar://problem/17577563>
+
+        Reviewed by Simon Fraser.
+
+        Revert back to type int for Element.scroll* APIs in order to preserve exception handling
+        behavior.
+
+        * cssom/non-subpixel-scroll-top-left-values-expected.txt: Added.
+        * cssom/non-subpixel-scroll-top-left-values.html: Added.
+
 2014-07-11  Javier Fernandez  <jfernandez@igalia.com>
 
         [CSS Grid Layout] Implement justify-self css property
diff --git a/LayoutTests/cssom/non-subpixel-scroll-top-left-values-expected.txt b/LayoutTests/cssom/non-subpixel-scroll-top-left-values-expected.txt
new file mode 100644 (file)
index 0000000..ac688db
--- /dev/null
@@ -0,0 +1,226 @@
+scrollTop:0.00scrollLeft:0.00
+scrollTop:0.00scrollLeft:0.00
+scrollTop:0.00scrollLeft:0.00
+scrollTop:0.00scrollLeft:0.00
+scrollTop:0.00scrollLeft:0.00
+scrollTop:0.00scrollLeft:0.00
+scrollTop:0.00scrollLeft:0.00
+scrollTop:0.00scrollLeft:0.00
+scrollTop:0.00scrollLeft:0.00
+scrollTop:0.00scrollLeft:0.00
+scrollTop:0.00scrollLeft:0.00
+scrollTop:1.00scrollLeft:1.00
+scrollTop:1.00scrollLeft:1.00
+scrollTop:1.00scrollLeft:1.00
+scrollTop:1.00scrollLeft:1.00
+scrollTop:1.00scrollLeft:1.00
+scrollTop:1.00scrollLeft:1.00
+scrollTop:1.00scrollLeft:1.00
+scrollTop:1.00scrollLeft:1.00
+scrollTop:1.00scrollLeft:1.00
+scrollTop:2.00scrollLeft:2.00
+scrollTop:2.00scrollLeft:2.00
+scrollTop:2.00scrollLeft:2.00
+scrollTop:2.00scrollLeft:2.00
+scrollTop:2.00scrollLeft:2.00
+scrollTop:2.00scrollLeft:2.00
+scrollTop:2.00scrollLeft:2.00
+scrollTop:2.00scrollLeft:2.00
+scrollTop:2.00scrollLeft:2.00
+scrollTop:2.00scrollLeft:2.00
+scrollTop:3.00scrollLeft:3.00
+scrollTop:3.00scrollLeft:3.00
+scrollTop:3.00scrollLeft:3.00
+scrollTop:3.00scrollLeft:3.00
+scrollTop:3.00scrollLeft:3.00
+scrollTop:3.00scrollLeft:3.00
+scrollTop:3.00scrollLeft:3.00
+scrollTop:3.00scrollLeft:3.00
+scrollTop:3.00scrollLeft:3.00
+scrollTop:3.00scrollLeft:3.00
+scrollTop:4.00scrollLeft:4.00
+scrollTop:4.00scrollLeft:4.00
+scrollTop:4.00scrollLeft:4.00
+scrollTop:4.00scrollLeft:4.00
+scrollTop:4.00scrollLeft:4.00
+scrollTop:4.00scrollLeft:4.00
+scrollTop:4.00scrollLeft:4.00
+scrollTop:4.00scrollLeft:4.00
+scrollTop:4.00scrollLeft:4.00
+scrollTop:4.00scrollLeft:4.00
+scrollTop:4.00scrollLeft:4.00
+scrollTop:5.00scrollLeft:5.00
+scrollTop:5.00scrollLeft:5.00
+scrollTop:5.00scrollLeft:5.00
+scrollTop:5.00scrollLeft:5.00
+scrollTop:5.00scrollLeft:5.00
+scrollTop:5.00scrollLeft:5.00
+scrollTop:5.00scrollLeft:5.00
+scrollTop:5.00scrollLeft:5.00
+scrollTop:5.00scrollLeft:5.00
+scrollTop:5.00scrollLeft:5.00
+scrollTop:6.00scrollLeft:6.00
+scrollTop:6.00scrollLeft:6.00
+scrollTop:6.00scrollLeft:6.00
+scrollTop:6.00scrollLeft:6.00
+scrollTop:6.00scrollLeft:6.00
+scrollTop:6.00scrollLeft:6.00
+scrollTop:6.00scrollLeft:6.00
+scrollTop:6.00scrollLeft:6.00
+scrollTop:6.00scrollLeft:6.00
+scrollTop:6.00scrollLeft:6.00
+scrollTop:7.00scrollLeft:7.00
+scrollTop:7.00scrollLeft:7.00
+scrollTop:7.00scrollLeft:7.00
+scrollTop:7.00scrollLeft:7.00
+scrollTop:7.00scrollLeft:7.00
+scrollTop:7.00scrollLeft:7.00
+scrollTop:7.00scrollLeft:7.00
+scrollTop:7.00scrollLeft:7.00
+scrollTop:7.00scrollLeft:7.00
+scrollTop:7.00scrollLeft:7.00
+scrollTop:8.00scrollLeft:8.00
+scrollTop:8.00scrollLeft:8.00
+scrollTop:8.00scrollLeft:8.00
+scrollTop:8.00scrollLeft:8.00
+scrollTop:8.00scrollLeft:8.00
+scrollTop:8.00scrollLeft:8.00
+scrollTop:8.00scrollLeft:8.00
+scrollTop:8.00scrollLeft:8.00
+scrollTop:8.00scrollLeft:8.00
+scrollTop:8.00scrollLeft:8.00
+scrollTop:9.00scrollLeft:9.00
+scrollTop:9.00scrollLeft:9.00
+scrollTop:9.00scrollLeft:9.00
+scrollTop:9.00scrollLeft:9.00
+scrollTop:9.00scrollLeft:9.00
+scrollTop:9.00scrollLeft:9.00
+scrollTop:9.00scrollLeft:9.00
+scrollTop:9.00scrollLeft:9.00
+scrollTop:9.00scrollLeft:9.00
+scrollTop:9.00scrollLeft:9.00
+scrollTop:10.00scrollLeft:10.00
+scrollTop:10.00scrollLeft:10.00
+scrollTop:10.00scrollLeft:10.00
+scrollTop:10.00scrollLeft:10.00
+scrollTop:10.00scrollLeft:10.00
+scrollTop:10.00scrollLeft:10.00
+scrollTop:10.00scrollLeft:10.00
+scrollTop:10.00scrollLeft:10.00
+scrollTop:10.00scrollLeft:10.00
+scrollTop:10.00scrollLeft:10.00
+scrollTop:11.00scrollLeft:11.00
+scrollTop:11.00scrollLeft:11.00
+scrollTop:11.00scrollLeft:11.00
+scrollTop:11.00scrollLeft:11.00
+scrollTop:11.00scrollLeft:11.00
+scrollTop:11.00scrollLeft:11.00
+scrollTop:11.00scrollLeft:11.00
+scrollTop:11.00scrollLeft:11.00
+scrollTop:11.00scrollLeft:11.00
+scrollTop:11.00scrollLeft:11.00
+scrollTop:12.00scrollLeft:12.00
+scrollTop:12.00scrollLeft:12.00
+scrollTop:12.00scrollLeft:12.00
+scrollTop:12.00scrollLeft:12.00
+scrollTop:12.00scrollLeft:12.00
+scrollTop:12.00scrollLeft:12.00
+scrollTop:12.00scrollLeft:12.00
+scrollTop:12.00scrollLeft:12.00
+scrollTop:12.00scrollLeft:12.00
+scrollTop:12.00scrollLeft:12.00
+scrollTop:13.00scrollLeft:13.00
+scrollTop:13.00scrollLeft:13.00
+scrollTop:13.00scrollLeft:13.00
+scrollTop:13.00scrollLeft:13.00
+scrollTop:13.00scrollLeft:13.00
+scrollTop:13.00scrollLeft:13.00
+scrollTop:13.00scrollLeft:13.00
+scrollTop:13.00scrollLeft:13.00
+scrollTop:13.00scrollLeft:13.00
+scrollTop:13.00scrollLeft:13.00
+scrollTop:14.00scrollLeft:14.00
+scrollTop:14.00scrollLeft:14.00
+scrollTop:14.00scrollLeft:14.00
+scrollTop:14.00scrollLeft:14.00
+scrollTop:14.00scrollLeft:14.00
+scrollTop:14.00scrollLeft:14.00
+scrollTop:14.00scrollLeft:14.00
+scrollTop:14.00scrollLeft:14.00
+scrollTop:14.00scrollLeft:14.00
+scrollTop:14.00scrollLeft:14.00
+scrollTop:15.00scrollLeft:15.00
+scrollTop:15.00scrollLeft:15.00
+scrollTop:15.00scrollLeft:15.00
+scrollTop:15.00scrollLeft:15.00
+scrollTop:15.00scrollLeft:15.00
+scrollTop:15.00scrollLeft:15.00
+scrollTop:15.00scrollLeft:15.00
+scrollTop:15.00scrollLeft:15.00
+scrollTop:15.00scrollLeft:15.00
+scrollTop:15.00scrollLeft:15.00
+scrollTop:16.00scrollLeft:16.00
+scrollTop:16.00scrollLeft:16.00
+scrollTop:16.00scrollLeft:16.00
+scrollTop:16.00scrollLeft:16.00
+scrollTop:16.00scrollLeft:16.00
+scrollTop:16.00scrollLeft:16.00
+scrollTop:16.00scrollLeft:16.00
+scrollTop:16.00scrollLeft:16.00
+scrollTop:16.00scrollLeft:16.00
+scrollTop:16.00scrollLeft:16.00
+scrollTop:17.00scrollLeft:17.00
+scrollTop:17.00scrollLeft:17.00
+scrollTop:17.00scrollLeft:17.00
+scrollTop:17.00scrollLeft:17.00
+scrollTop:17.00scrollLeft:17.00
+scrollTop:17.00scrollLeft:17.00
+scrollTop:17.00scrollLeft:17.00
+scrollTop:17.00scrollLeft:17.00
+scrollTop:17.00scrollLeft:17.00
+scrollTop:17.00scrollLeft:17.00
+scrollTop:18.00scrollLeft:18.00
+scrollTop:18.00scrollLeft:18.00
+scrollTop:18.00scrollLeft:18.00
+scrollTop:18.00scrollLeft:18.00
+scrollTop:18.00scrollLeft:18.00
+scrollTop:18.00scrollLeft:18.00
+scrollTop:18.00scrollLeft:18.00
+scrollTop:18.00scrollLeft:18.00
+scrollTop:18.00scrollLeft:18.00
+scrollTop:19.00scrollLeft:19.00
+scrollTop:19.00scrollLeft:19.00
+scrollTop:19.00scrollLeft:19.00
+scrollTop:19.00scrollLeft:19.00
+scrollTop:19.00scrollLeft:19.00
+scrollTop:19.00scrollLeft:19.00
+scrollTop:19.00scrollLeft:19.00
+scrollTop:19.00scrollLeft:19.00
+scrollTop:19.00scrollLeft:19.00
+scrollTop:19.00scrollLeft:19.00
+scrollTop:20.00scrollLeft:20.00
+scrollTop:20.00scrollLeft:20.00
+scrollTop:20.00scrollLeft:20.00
+scrollTop:20.00scrollLeft:20.00
+scrollTop:20.00scrollLeft:20.00
+scrollTop:20.00scrollLeft:20.00
+scrollTop:20.00scrollLeft:20.00
+scrollTop:20.00scrollLeft:20.00
+scrollTop:20.00scrollLeft:20.00
+scrollTop:20.00scrollLeft:20.00
+scrollTop:21.00scrollLeft:21.00
+scrollTop:21.00scrollLeft:21.00
+scrollTop:21.00scrollLeft:21.00
+scrollTop:21.00scrollLeft:21.00
+scrollTop:21.00scrollLeft:21.00
+scrollTop:21.00scrollLeft:21.00
+scrollTop:21.00scrollLeft:21.00
+scrollTop:21.00scrollLeft:21.00
+scrollTop:21.00scrollLeft:21.00
+scrollTop:21.00scrollLeft:21.00
+scrollTop:22.00scrollLeft:22.00
+scrollTop:22.00scrollLeft:22.00
+scrollTop:22.00scrollLeft:22.00
+scrollTop:22.00scrollLeft:22.00
+scrollTop:22.00scrollLeft:22.00
+
diff --git a/LayoutTests/cssom/non-subpixel-scroll-top-left-values.html b/LayoutTests/cssom/non-subpixel-scroll-top-left-values.html
new file mode 100644 (file)
index 0000000..5230e73
--- /dev/null
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that Element.scroll* return integral values.</title>
+<style>
+div { 
+  position: fixed;
+  width: 30px;
+  height: 30px;
+  border: 1px solid red;
+  overflow: scroll;  
+}
+</style>
+</head>
+<body>
+<script>
+  if (window.testRunner)
+    testRunner.dumpAsText();
+    
+  var container = document.body;
+  for (i = 0; i < 15; ++i) {
+    for (j = 0; j < 15; ++j) {
+      var e = document.createElement("div");
+      e.style.top = (30 * i) + "px";
+      e.style.left = (30 * j) + "px";
+      e.innerHTML = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ";
+      container.appendChild(e);
+    }
+  }
+
+  var result = "";
+  var adjustment = 0;
+  var divs = document.getElementsByTagName("div");
+  for (i = 0; i < divs.length; ++i) {
+    var element = divs[i];
+    element.scrollTop = adjustment;
+    element.scrollLeft = adjustment;
+    result += "scrollTop:" + element.scrollTop.toFixed(2) + "scrollLeft:" + element.scrollLeft.toFixed(2) + "<br>";
+    adjustment += 0.1;
+    }
+  document.body.innerHTML = result;  
+</script>
+</body>
+</html>
index 7b5d1af..36f38da 100644 (file)
@@ -23,8 +23,8 @@ PASS nonNumericPolicy('document.elementFromPoint(x, 0)') is 'any type allowed'
 PASS nonNumericPolicy('document.elementFromPoint(0, x)') is 'any type allowed'
 PASS nonNumericPolicy('document.body.scrollByLines(x)') is 'any type allowed'
 PASS nonNumericPolicy('document.body.scrollByPages(x)') is 'any type allowed'
-PASS nonNumericPolicy('document.body.scrollLeft = x') is 'mixed'
-PASS nonNumericPolicy('document.body.scrollTop = x') is 'mixed'
+PASS nonNumericPolicy('document.body.scrollLeft = x') is 'any type allowed'
+PASS nonNumericPolicy('document.body.scrollTop = x') is 'any type allowed'
 PASS nonNumericPolicy('document.images.item(x)') is 'any type allowed'
 PASS nonNumericPolicy('document.createElement("input").setSelectionRange(x, 0)') is 'any type allowed'
 PASS nonNumericPolicy('document.createElement("input").setSelectionRange(0, x)') is 'any type allowed'
index d35f341..8bccf5d 100644 (file)
@@ -226,8 +226,8 @@ shouldBe("nonNumericPolicy('document.elementFromPoint(0, x)')", "'any type allow
 
 shouldBe("nonNumericPolicy('document.body.scrollByLines(x)')", "'any type allowed'");
 shouldBe("nonNumericPolicy('document.body.scrollByPages(x)')", "'any type allowed'");
-shouldBe("nonNumericPolicy('document.body.scrollLeft = x')", "'mixed'");
-shouldBe("nonNumericPolicy('document.body.scrollTop = x')", "'mixed'");
+shouldBe("nonNumericPolicy('document.body.scrollLeft = x')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.body.scrollTop = x')", "'any type allowed'");
 
 // History
 
@@ -392,8 +392,8 @@ Here are other examples of numeric types in function parameters and settable att
 ../../../../WebCore/html/HTMLAppletElement.idl:                 attribute [ConvertFromString] long vspace;
 ../../../../WebCore/html/HTMLAreaElement.idl:        attribute long tabIndex;
 ../../../../WebCore/html/HTMLBaseFontElement.idl:        attribute long size;
-../../../../WebCore/html/HTMLBodyElement.idl:                 attribute float scrollLeft;
-../../../../WebCore/html/HTMLBodyElement.idl:                 attribute float scrollTop;
+../../../../WebCore/html/HTMLBodyElement.idl:                 attribute long scrollLeft;
+../../../../WebCore/html/HTMLBodyElement.idl:                 attribute long scrollTop;
 ../../../../WebCore/html/HTMLButtonElement.idl:                 attribute  long                 tabIndex;
 ../../../../WebCore/html/HTMLCanvasElement.idl:        attribute long width;
 ../../../../WebCore/html/HTMLCanvasElement.idl:        attribute long height;
index b515201..ff43be4 100644 (file)
@@ -1,3 +1,35 @@
+2014-07-11  Zalan Bujtas  <zalan@apple.com>
+
+        REGRESSION (r168868): eBay 'see all' links fail due to different JS bindings conversion behavior.
+        https://bugs.webkit.org/show_bug.cgi?id=134841
+        <rdar://problem/17577563>
+
+        Reviewed by Simon Fraser.
+
+        Revert back to type int for Element.scroll* APIs in order to preserve exception handling
+        behavior.
+
+        Test: cssom/non-subpixel-scroll-top-left-values.html
+
+        * dom/Element.cpp:
+        (WebCore::Element::scrollLeft):
+        (WebCore::Element::scrollTop):
+        (WebCore::Element::setScrollLeft):
+        (WebCore::Element::setScrollTop):
+        (WebCore::Element::scrollWidth):
+        (WebCore::Element::scrollHeight):
+        * dom/Element.h:
+        * dom/Element.idl:
+        * html/HTMLBodyElement.cpp:
+        (WebCore::adjustForZoom):
+        (WebCore::HTMLBodyElement::scrollLeft):
+        (WebCore::HTMLBodyElement::setScrollLeft):
+        (WebCore::HTMLBodyElement::scrollTop):
+        (WebCore::HTMLBodyElement::setScrollTop):
+        (WebCore::HTMLBodyElement::scrollHeight):
+        (WebCore::HTMLBodyElement::scrollWidth):
+        * html/HTMLBodyElement.h:
+
 2014-07-11  Joseph Pecoraro  <pecoraro@apple.com>
 
         Web Inspector: Debugger Pause button does not work
index 57add11..202400b 100644 (file)
@@ -823,7 +823,7 @@ double Element::clientHeight()
     return 0;
 }
 
-double Element::scrollLeft()
+int Element::scrollLeft()
 {
     document().updateLayoutIgnorePendingStylesheets();
 
@@ -832,7 +832,7 @@ double Element::scrollLeft()
     return 0;
 }
 
-double Element::scrollTop()
+int Element::scrollTop()
 {
     document().updateLayoutIgnorePendingStylesheets();
 
@@ -841,29 +841,29 @@ double Element::scrollTop()
     return 0;
 }
 
-void Element::setScrollLeft(double newLeft)
+void Element::setScrollLeft(int newLeft)
 {
     document().updateLayoutIgnorePendingStylesheets();
 
     if (RenderBox* renderer = renderBox()) {
-        renderer->setScrollLeft(round(newLeft * renderer->style().effectiveZoom()));
+        renderer->setScrollLeft(static_cast<int>(newLeft * renderer->style().effectiveZoom()));
         if (auto* scrollableArea = renderer->layer())
             scrollableArea->setScrolledProgrammatically(true);
     }
 }
 
-void Element::setScrollTop(double newTop)
+void Element::setScrollTop(int newTop)
 {
     document().updateLayoutIgnorePendingStylesheets();
 
     if (RenderBox* renderer = renderBox()) {
-        renderer->setScrollTop(round(newTop * renderer->style().effectiveZoom()));
+        renderer->setScrollTop(static_cast<int>(newTop * renderer->style().effectiveZoom()));
         if (auto* scrollableArea = renderer->layer())
             scrollableArea->setScrolledProgrammatically(true);
     }
 }
 
-double Element::scrollWidth()
+int Element::scrollWidth()
 {
     document().updateLayoutIgnorePendingStylesheets();
     if (RenderBox* rend = renderBox())
@@ -871,7 +871,7 @@ double Element::scrollWidth()
     return 0;
 }
 
-double Element::scrollHeight()
+int Element::scrollHeight()
 {
     document().updateLayoutIgnorePendingStylesheets();
     if (RenderBox* rend = renderBox())
index f8f2d71..ae94594 100644 (file)
@@ -220,12 +220,12 @@ public:
     double clientTop();
     double clientWidth();
     double clientHeight();
-    virtual double scrollLeft();
-    virtual double scrollTop();
-    virtual void setScrollLeft(double);
-    virtual void setScrollTop(double);
-    virtual double scrollWidth();
-    virtual double scrollHeight();
+    virtual int scrollLeft();
+    virtual int scrollTop();
+    virtual void setScrollLeft(int);
+    virtual void setScrollTop(int);
+    virtual int scrollWidth();
+    virtual int scrollHeight();
 
     IntRect boundsInRootViewSpace();
 
index 58704b1..7f15869 100644 (file)
     readonly attribute long clientTop;
     readonly attribute long clientWidth;
     readonly attribute long clientHeight;
-    attribute long scrollLeft;
-    attribute long scrollTop;
-    readonly attribute long scrollWidth;
-    readonly attribute long scrollHeight;
 #else
     readonly attribute double offsetLeft;
     readonly attribute double offsetTop;
     readonly attribute double clientTop;
     readonly attribute double clientWidth;
     readonly attribute double clientHeight;
-    attribute double scrollLeft;
-    attribute double scrollTop;
-    readonly attribute double scrollWidth;
-    readonly attribute double scrollHeight;
 #endif
 
+    attribute long scrollLeft;
+    attribute long scrollTop;
+    readonly attribute long scrollWidth;
+    readonly attribute long scrollHeight;
+
     [ImplementedAs=bindingsOffsetParent] readonly attribute Element offsetParent;
 
     void focus();
index 1a46169..0f741b5 100644 (file)
@@ -198,7 +198,7 @@ bool HTMLBodyElement::supportsFocus() const
     return hasEditableStyle() || HTMLElement::supportsFocus();
 }
 
-static double adjustForZoom(int value, const Frame& frame)
+static int adjustForZoom(int value, const Frame& frame)
 {
     double zoomFactor = frame.pageZoomFactor() * frame.frameScaleFactor();
     if (zoomFactor == 1)
@@ -206,10 +206,10 @@ static double adjustForZoom(int value, const Frame& frame)
     // Needed because of truncation (rather than rounding) when scaling up.
     if (zoomFactor > 1)
         value++;
-    return value / zoomFactor;
+    return static_cast<int>(value / zoomFactor);
 }
 
-double HTMLBodyElement::scrollLeft()
+int HTMLBodyElement::scrollLeft()
 {
     document().updateLayoutIgnorePendingStylesheets();
     Frame* frame = document().frame();
@@ -218,10 +218,10 @@ double HTMLBodyElement::scrollLeft()
     FrameView* view = frame->view();
     if (!view)
         return 0;
-    return floor(adjustForZoom(view->contentsScrollPosition().x(), *frame));
+    return adjustForZoom(view->contentsScrollPosition().x(), *frame);
 }
 
-void HTMLBodyElement::setScrollLeft(double scrollLeft)
+void HTMLBodyElement::setScrollLeft(int scrollLeft)
 {
     document().updateLayoutIgnorePendingStylesheets();
     Frame* frame = document().frame();
@@ -233,7 +233,7 @@ void HTMLBodyElement::setScrollLeft(double scrollLeft)
     view->setScrollPosition(IntPoint(static_cast<int>(scrollLeft * frame->pageZoomFactor() * frame->frameScaleFactor()), view->scrollY()));
 }
 
-double HTMLBodyElement::scrollTop()
+int HTMLBodyElement::scrollTop()
 {
     document().updateLayoutIgnorePendingStylesheets();
     Frame* frame = document().frame();
@@ -242,10 +242,10 @@ double HTMLBodyElement::scrollTop()
     FrameView* view = frame->view();
     if (!view)
         return 0;
-    return floor(adjustForZoom(view->contentsScrollPosition().y(), *frame));
+    return adjustForZoom(view->contentsScrollPosition().y(), *frame);
 }
 
-void HTMLBodyElement::setScrollTop(double scrollTop)
+void HTMLBodyElement::setScrollTop(int scrollTop)
 {
     document().updateLayoutIgnorePendingStylesheets();
     Frame* frame = document().frame();
@@ -257,7 +257,7 @@ void HTMLBodyElement::setScrollTop(double scrollTop)
     view->setScrollPosition(IntPoint(view->scrollX(), static_cast<int>(scrollTop * frame->pageZoomFactor() * frame->frameScaleFactor())));
 }
 
-double HTMLBodyElement::scrollHeight()
+int HTMLBodyElement::scrollHeight()
 {
     // Update the document's layout.
     document().updateLayoutIgnorePendingStylesheets();
@@ -267,10 +267,10 @@ double HTMLBodyElement::scrollHeight()
     FrameView* view = frame->view();
     if (!view)
         return 0;
-    return floor(adjustForZoom(view->contentsHeight(), *frame));
+    return adjustForZoom(view->contentsHeight(), *frame);
 }
 
-double HTMLBodyElement::scrollWidth()
+int HTMLBodyElement::scrollWidth()
 {
     // Update the document's layout.
     document().updateLayoutIgnorePendingStylesheets();
@@ -280,7 +280,7 @@ double HTMLBodyElement::scrollWidth()
     FrameView* view = frame->view();
     if (!view)
         return 0;
-    return floor(adjustForZoom(view->contentsWidth(), *frame));
+    return adjustForZoom(view->contentsWidth(), *frame);
 }
 
 void HTMLBodyElement::addSubresourceAttributeURLs(ListHashSet<URL>& urls) const
index 405a52e..017efc2 100644 (file)
@@ -69,14 +69,14 @@ private:
     
     virtual bool supportsFocus() const override;
 
-    virtual double scrollLeft() override;
-    virtual void setScrollLeft(double) override;
+    virtual int scrollLeft() override;
+    virtual void setScrollLeft(int) override;
     
-    virtual double scrollTop() override;
-    virtual void setScrollTop(double) override;
+    virtual int scrollTop() override;
+    virtual void setScrollTop(int) override;
     
-    virtual double scrollHeight() override;
-    virtual double scrollWidth() override;
+    virtual int scrollHeight() override;
+    virtual int scrollWidth() override;
     
     virtual void addSubresourceAttributeURLs(ListHashSet<URL>&) const override;
 };