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

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

Issue 25767003: Revert "document.documentElement.scrollTop/Left is zero" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/rubberbanding/momentum-reset.html ('k') | Source/core/html/HTMLBodyElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 } 679 }
680 680
681 if (RenderBox* renderer = renderBox()) 681 if (RenderBox* renderer = renderBox())
682 return adjustLayoutUnitForAbsoluteZoom(renderer->pixelSnappedClientHeigh t(), renderer).round(); 682 return adjustLayoutUnitForAbsoluteZoom(renderer->pixelSnappedClientHeigh t(), renderer).round();
683 return 0; 683 return 0;
684 } 684 }
685 685
686 int Element::scrollLeft() 686 int Element::scrollLeft()
687 { 687 {
688 document().updateLayoutIgnorePendingStylesheets(); 688 document().updateLayoutIgnorePendingStylesheets();
689
690 if (document().documentElement() == this) {
691 if (document().inQuirksMode())
692 return 0;
693
694 if (FrameView* view = document().view()) {
695 if (RenderView* renderView = document().renderView())
696 return adjustForAbsoluteZoom(view->scrollX(), renderView);
697 }
698 }
699
700 if (RenderBox* rend = renderBox()) 689 if (RenderBox* rend = renderBox())
701 return adjustForAbsoluteZoom(rend->scrollLeft(), rend); 690 return adjustForAbsoluteZoom(rend->scrollLeft(), rend);
702 return 0; 691 return 0;
703 } 692 }
704 693
705 int Element::scrollTop() 694 int Element::scrollTop()
706 { 695 {
707 document().updateLayoutIgnorePendingStylesheets(); 696 document().updateLayoutIgnorePendingStylesheets();
708
709 if (document().documentElement() == this) {
710 if (document().inQuirksMode())
711 return 0;
712
713 if (FrameView* view = document().view()) {
714 if (RenderView* renderView = document().renderView())
715 return adjustForAbsoluteZoom(view->scrollY(), renderView);
716 }
717 }
718
719 if (RenderBox* rend = renderBox()) 697 if (RenderBox* rend = renderBox())
720 return adjustForAbsoluteZoom(rend->scrollTop(), rend); 698 return adjustForAbsoluteZoom(rend->scrollTop(), rend);
721 return 0; 699 return 0;
722 } 700 }
723 701
724 void Element::setScrollLeft(int newLeft) 702 void Element::setScrollLeft(int newLeft)
725 { 703 {
726 document().updateLayoutIgnorePendingStylesheets(); 704 document().updateLayoutIgnorePendingStylesheets();
727 if (RenderBox* rend = renderBox()) 705 if (RenderBox* rend = renderBox())
728 rend->setScrollLeft(static_cast<int>(newLeft * rend->style()->effectiveZ oom())); 706 rend->setScrollLeft(static_cast<int>(newLeft * rend->style()->effectiveZ oom()));
(...skipping 2967 matching lines...) Expand 10 before | Expand all | Expand 10 after
3696 return 0; 3674 return 0;
3697 } 3675 }
3698 3676
3699 Attribute* UniqueElementData::attributeItem(unsigned index) 3677 Attribute* UniqueElementData::attributeItem(unsigned index)
3700 { 3678 {
3701 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); 3679 ASSERT_WITH_SECURITY_IMPLICATION(index < length());
3702 return &m_attributeVector.at(index); 3680 return &m_attributeVector.at(index);
3703 } 3681 }
3704 3682
3705 } // namespace WebCore 3683 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/rubberbanding/momentum-reset.html ('k') | Source/core/html/HTMLBodyElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698