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

Side by Side Diff: Source/core/dom/Element.cpp

Issue 1007013002: Make scrollWidth and scrollHeight match other DOM measurement APIs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add additional test expectation Created 5 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 792
793 if (LocalDOMWindow* window = document().domWindow()) 793 if (LocalDOMWindow* window = document().domWindow())
794 window->scrollTo(window->scrollX(), newTop); 794 window->scrollTo(window->scrollX(), newTop);
795 } 795 }
796 } 796 }
797 797
798 int Element::scrollWidth() 798 int Element::scrollWidth()
799 { 799 {
800 document().updateLayoutIgnorePendingStylesheets(); 800 document().updateLayoutIgnorePendingStylesheets();
801 if (LayoutBox* box = layoutBox()) 801 if (LayoutBox* box = layoutBox())
802 return adjustLayoutUnitForAbsoluteZoom(box->scrollWidth(), *box).toDoubl e(); 802 return adjustLayoutUnitForAbsoluteZoom(box->scrollWidth(), *box).round() ;
803 return 0; 803 return 0;
804 } 804 }
805 805
806 int Element::scrollHeight() 806 int Element::scrollHeight()
807 { 807 {
808 document().updateLayoutIgnorePendingStylesheets(); 808 document().updateLayoutIgnorePendingStylesheets();
809 if (LayoutBox* box = layoutBox()) 809 if (LayoutBox* box = layoutBox())
810 return adjustLayoutUnitForAbsoluteZoom(box->scrollHeight(), *box).toDoub le(); 810 return adjustLayoutUnitForAbsoluteZoom(box->scrollHeight(), *box).round( );
811 return 0; 811 return 0;
812 } 812 }
813 813
814 void Element::scrollBy(double x, double y) 814 void Element::scrollBy(double x, double y)
815 { 815 {
816 ScrollToOptions scrollToOptions; 816 ScrollToOptions scrollToOptions;
817 scrollToOptions.setLeft(x); 817 scrollToOptions.setLeft(x);
818 scrollToOptions.setTop(y); 818 scrollToOptions.setTop(y);
819 scrollBy(scrollToOptions); 819 scrollBy(scrollToOptions);
820 } 820 }
(...skipping 2675 matching lines...) Expand 10 before | Expand all | Expand 10 after
3496 { 3496 {
3497 #if ENABLE(OILPAN) 3497 #if ENABLE(OILPAN)
3498 if (hasRareData()) 3498 if (hasRareData())
3499 visitor->trace(elementRareData()); 3499 visitor->trace(elementRareData());
3500 visitor->trace(m_elementData); 3500 visitor->trace(m_elementData);
3501 #endif 3501 #endif
3502 ContainerNode::trace(visitor); 3502 ContainerNode::trace(visitor);
3503 } 3503 }
3504 3504
3505 } // namespace blink 3505 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698