Changeset 171014 in webkit
- Timestamp:
- Jul 11, 2014 3:36:14 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r171010 r171014 1 2014-07-11 Zalan Bujtas <zalan@apple.com> 2 3 REGRESSION (r168868): eBay 'see all' links fail due to different JS bindings conversion behavior. 4 https://bugs.webkit.org/show_bug.cgi?id=134841 5 <rdar://problem/17577563> 6 7 Reviewed by Simon Fraser. 8 9 Revert back to type int for Element.scroll* APIs in order to preserve exception handling 10 behavior. 11 12 * cssom/non-subpixel-scroll-top-left-values-expected.txt: Added. 13 * cssom/non-subpixel-scroll-top-left-values.html: Added. 14 1 15 2014-07-11 Javier Fernandez <jfernandez@igalia.com> 2 16 -
trunk/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt
r168868 r171014 24 24 PASS nonNumericPolicy('document.body.scrollByLines(x)') is 'any type allowed' 25 25 PASS nonNumericPolicy('document.body.scrollByPages(x)') is 'any type allowed' 26 PASS nonNumericPolicy('document.body.scrollLeft = x') is ' mixed'27 PASS nonNumericPolicy('document.body.scrollTop = x') is ' mixed'26 PASS nonNumericPolicy('document.body.scrollLeft = x') is 'any type allowed' 27 PASS nonNumericPolicy('document.body.scrollTop = x') is 'any type allowed' 28 28 PASS nonNumericPolicy('document.images.item(x)') is 'any type allowed' 29 29 PASS nonNumericPolicy('document.createElement("input").setSelectionRange(x, 0)') is 'any type allowed' -
trunk/LayoutTests/fast/dom/script-tests/non-numeric-values-numeric-parameters.js
r168868 r171014 227 227 shouldBe("nonNumericPolicy('document.body.scrollByLines(x)')", "'any type allowed'"); 228 228 shouldBe("nonNumericPolicy('document.body.scrollByPages(x)')", "'any type allowed'"); 229 shouldBe("nonNumericPolicy('document.body.scrollLeft = x')", "' mixed'");230 shouldBe("nonNumericPolicy('document.body.scrollTop = x')", "' mixed'");229 shouldBe("nonNumericPolicy('document.body.scrollLeft = x')", "'any type allowed'"); 230 shouldBe("nonNumericPolicy('document.body.scrollTop = x')", "'any type allowed'"); 231 231 232 232 // History … … 393 393 ../../../../WebCore/html/HTMLAreaElement.idl: attribute long tabIndex; 394 394 ../../../../WebCore/html/HTMLBaseFontElement.idl: attribute long size; 395 ../../../../WebCore/html/HTMLBodyElement.idl: attribute floatscrollLeft;396 ../../../../WebCore/html/HTMLBodyElement.idl: attribute floatscrollTop;395 ../../../../WebCore/html/HTMLBodyElement.idl: attribute long scrollLeft; 396 ../../../../WebCore/html/HTMLBodyElement.idl: attribute long scrollTop; 397 397 ../../../../WebCore/html/HTMLButtonElement.idl: attribute long tabIndex; 398 398 ../../../../WebCore/html/HTMLCanvasElement.idl: attribute long width; -
trunk/Source/WebCore/ChangeLog
r171013 r171014 1 2014-07-11 Zalan Bujtas <zalan@apple.com> 2 3 REGRESSION (r168868): eBay 'see all' links fail due to different JS bindings conversion behavior. 4 https://bugs.webkit.org/show_bug.cgi?id=134841 5 <rdar://problem/17577563> 6 7 Reviewed by Simon Fraser. 8 9 Revert back to type int for Element.scroll* APIs in order to preserve exception handling 10 behavior. 11 12 Test: cssom/non-subpixel-scroll-top-left-values.html 13 14 * dom/Element.cpp: 15 (WebCore::Element::scrollLeft): 16 (WebCore::Element::scrollTop): 17 (WebCore::Element::setScrollLeft): 18 (WebCore::Element::setScrollTop): 19 (WebCore::Element::scrollWidth): 20 (WebCore::Element::scrollHeight): 21 * dom/Element.h: 22 * dom/Element.idl: 23 * html/HTMLBodyElement.cpp: 24 (WebCore::adjustForZoom): 25 (WebCore::HTMLBodyElement::scrollLeft): 26 (WebCore::HTMLBodyElement::setScrollLeft): 27 (WebCore::HTMLBodyElement::scrollTop): 28 (WebCore::HTMLBodyElement::setScrollTop): 29 (WebCore::HTMLBodyElement::scrollHeight): 30 (WebCore::HTMLBodyElement::scrollWidth): 31 * html/HTMLBodyElement.h: 32 1 33 2014-07-11 Joseph Pecoraro <pecoraro@apple.com> 2 34 -
trunk/Source/WebCore/dom/Element.cpp
r171001 r171014 824 824 } 825 825 826 doubleElement::scrollLeft()826 int Element::scrollLeft() 827 827 { 828 828 document().updateLayoutIgnorePendingStylesheets(); … … 833 833 } 834 834 835 doubleElement::scrollTop()835 int Element::scrollTop() 836 836 { 837 837 document().updateLayoutIgnorePendingStylesheets(); … … 842 842 } 843 843 844 void Element::setScrollLeft( doublenewLeft)844 void Element::setScrollLeft(int newLeft) 845 845 { 846 846 document().updateLayoutIgnorePendingStylesheets(); 847 847 848 848 if (RenderBox* renderer = renderBox()) { 849 renderer->setScrollLeft( round(newLeft * renderer->style().effectiveZoom()));849 renderer->setScrollLeft(static_cast<int>(newLeft * renderer->style().effectiveZoom())); 850 850 if (auto* scrollableArea = renderer->layer()) 851 851 scrollableArea->setScrolledProgrammatically(true); … … 853 853 } 854 854 855 void Element::setScrollTop( doublenewTop)855 void Element::setScrollTop(int newTop) 856 856 { 857 857 document().updateLayoutIgnorePendingStylesheets(); 858 858 859 859 if (RenderBox* renderer = renderBox()) { 860 renderer->setScrollTop( round(newTop * renderer->style().effectiveZoom()));860 renderer->setScrollTop(static_cast<int>(newTop * renderer->style().effectiveZoom())); 861 861 if (auto* scrollableArea = renderer->layer()) 862 862 scrollableArea->setScrolledProgrammatically(true); … … 864 864 } 865 865 866 doubleElement::scrollWidth()866 int Element::scrollWidth() 867 867 { 868 868 document().updateLayoutIgnorePendingStylesheets(); … … 872 872 } 873 873 874 doubleElement::scrollHeight()874 int Element::scrollHeight() 875 875 { 876 876 document().updateLayoutIgnorePendingStylesheets(); -
trunk/Source/WebCore/dom/Element.h
r170585 r171014 221 221 double clientWidth(); 222 222 double clientHeight(); 223 virtual doublescrollLeft();224 virtual doublescrollTop();225 virtual void setScrollLeft( double);226 virtual void setScrollTop( double);227 virtual doublescrollWidth();228 virtual doublescrollHeight();223 virtual int scrollLeft(); 224 virtual int scrollTop(); 225 virtual void setScrollLeft(int); 226 virtual void setScrollTop(int); 227 virtual int scrollWidth(); 228 virtual int scrollHeight(); 229 229 230 230 IntRect boundsInRootViewSpace(); -
trunk/Source/WebCore/dom/Element.idl
r170585 r171014 79 79 readonly attribute long clientWidth; 80 80 readonly attribute long clientHeight; 81 attribute long scrollLeft;82 attribute long scrollTop;83 readonly attribute long scrollWidth;84 readonly attribute long scrollHeight;85 81 #else 86 82 readonly attribute double offsetLeft; … … 92 88 readonly attribute double clientWidth; 93 89 readonly attribute double clientHeight; 94 attribute double scrollLeft; 95 attribute double scrollTop; 96 readonly attribute double scrollWidth; 97 readonly attribute double scrollHeight; 98 #endif 90 #endif 91 92 attribute long scrollLeft; 93 attribute long scrollTop; 94 readonly attribute long scrollWidth; 95 readonly attribute long scrollHeight; 99 96 100 97 [ImplementedAs=bindingsOffsetParent] readonly attribute Element offsetParent; -
trunk/Source/WebCore/html/HTMLBodyElement.cpp
r170774 r171014 199 199 } 200 200 201 static doubleadjustForZoom(int value, const Frame& frame)201 static int adjustForZoom(int value, const Frame& frame) 202 202 { 203 203 double zoomFactor = frame.pageZoomFactor() * frame.frameScaleFactor(); … … 207 207 if (zoomFactor > 1) 208 208 value++; 209 return value / zoomFactor;210 } 211 212 doubleHTMLBodyElement::scrollLeft()213 { 214 document().updateLayoutIgnorePendingStylesheets(); 215 Frame* frame = document().frame(); 216 if (!frame) 217 return 0; 218 FrameView* view = frame->view(); 219 if (!view) 220 return 0; 221 return floor(adjustForZoom(view->contentsScrollPosition().x(), *frame));222 } 223 224 void HTMLBodyElement::setScrollLeft( doublescrollLeft)209 return static_cast<int>(value / zoomFactor); 210 } 211 212 int HTMLBodyElement::scrollLeft() 213 { 214 document().updateLayoutIgnorePendingStylesheets(); 215 Frame* frame = document().frame(); 216 if (!frame) 217 return 0; 218 FrameView* view = frame->view(); 219 if (!view) 220 return 0; 221 return adjustForZoom(view->contentsScrollPosition().x(), *frame); 222 } 223 224 void HTMLBodyElement::setScrollLeft(int scrollLeft) 225 225 { 226 226 document().updateLayoutIgnorePendingStylesheets(); … … 234 234 } 235 235 236 doubleHTMLBodyElement::scrollTop()237 { 238 document().updateLayoutIgnorePendingStylesheets(); 239 Frame* frame = document().frame(); 240 if (!frame) 241 return 0; 242 FrameView* view = frame->view(); 243 if (!view) 244 return 0; 245 return floor(adjustForZoom(view->contentsScrollPosition().y(), *frame));246 } 247 248 void HTMLBodyElement::setScrollTop( doublescrollTop)236 int HTMLBodyElement::scrollTop() 237 { 238 document().updateLayoutIgnorePendingStylesheets(); 239 Frame* frame = document().frame(); 240 if (!frame) 241 return 0; 242 FrameView* view = frame->view(); 243 if (!view) 244 return 0; 245 return adjustForZoom(view->contentsScrollPosition().y(), *frame); 246 } 247 248 void HTMLBodyElement::setScrollTop(int scrollTop) 249 249 { 250 250 document().updateLayoutIgnorePendingStylesheets(); … … 258 258 } 259 259 260 doubleHTMLBodyElement::scrollHeight()260 int HTMLBodyElement::scrollHeight() 261 261 { 262 262 // Update the document's layout. … … 268 268 if (!view) 269 269 return 0; 270 return floor(adjustForZoom(view->contentsHeight(), *frame));271 } 272 273 doubleHTMLBodyElement::scrollWidth()270 return adjustForZoom(view->contentsHeight(), *frame); 271 } 272 273 int HTMLBodyElement::scrollWidth() 274 274 { 275 275 // Update the document's layout. … … 281 281 if (!view) 282 282 return 0; 283 return floor(adjustForZoom(view->contentsWidth(), *frame));283 return adjustForZoom(view->contentsWidth(), *frame); 284 284 } 285 285 -
trunk/Source/WebCore/html/HTMLBodyElement.h
r168868 r171014 70 70 virtual bool supportsFocus() const override; 71 71 72 virtual doublescrollLeft() override;73 virtual void setScrollLeft( double) override;72 virtual int scrollLeft() override; 73 virtual void setScrollLeft(int) override; 74 74 75 virtual doublescrollTop() override;76 virtual void setScrollTop( double) override;75 virtual int scrollTop() override; 76 virtual void setScrollTop(int) override; 77 77 78 virtual doublescrollHeight() override;79 virtual doublescrollWidth() override;78 virtual int scrollHeight() override; 79 virtual int scrollWidth() override; 80 80 81 81 virtual void addSubresourceAttributeURLs(ListHashSet<URL>&) const override;
Note: See TracChangeset
for help on using the changeset viewer.