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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 1895323002: Viewport apply scroll should be on the document element not scrollingElement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 579
580 return domWindow()->location(); 580 return domWindow()->location();
581 } 581 }
582 582
583 void Document::childrenChanged(const ChildrenChange& change) 583 void Document::childrenChanged(const ChildrenChange& change)
584 { 584 {
585 ContainerNode::childrenChanged(change); 585 ContainerNode::childrenChanged(change);
586 m_documentElement = ElementTraversal::firstWithin(*this); 586 m_documentElement = ElementTraversal::firstWithin(*this);
587 } 587 }
588 588
589 void Document::updateViewportApplyScroll() 589 void Document::updateViewportApplyScroll()
tdresser 2016/04/19 15:04:09 We shouldn't need to call this nearly as aggressiv
bokan 2016/04/19 17:33:17 Good point. Yah, I've moved this update to happen
590 { 590 {
591 if (!m_documentElement 591 if (!m_documentElement
592 || !m_documentElement->isHTMLElement() 592 || !m_documentElement->isHTMLElement()
593 || ownerElement()) 593 || ownerElement())
594 return; 594 return;
595 595
596 Element* newScrollingElement = scrollingElement(); 596 Element* newScrollingElement = m_documentElement;
597
598 // If there is no scrolling element (in QuirksMode and body is scrollable),
599 // install the viewport scroll callback on the <HTML> element.
600 if (!newScrollingElement)
601 newScrollingElement = m_documentElement;
602 597
603 if (newScrollingElement == m_oldScrollingElement) 598 if (newScrollingElement == m_oldScrollingElement)
604 return; 599 return;
605 600
606 ScrollStateCallback* applyScroll = nullptr; 601 ScrollStateCallback* applyScroll = nullptr;
607 602
608 // If the scrolling element changed, remove the apply scroll from the 603 // If the scrolling element changed, remove the apply scroll from the
609 // old one and keep it to put on the new scrolling element. 604 // old one and keep it to put on the new scrolling element.
610 if (m_oldScrollingElement) { 605 if (m_oldScrollingElement) {
611 applyScroll = m_oldScrollingElement->getApplyScroll(); 606 applyScroll = m_oldScrollingElement->getApplyScroll();
(...skipping 5302 matching lines...) Expand 10 before | Expand all | Expand 10 after
5914 #ifndef NDEBUG 5909 #ifndef NDEBUG
5915 using namespace blink; 5910 using namespace blink;
5916 void showLiveDocumentInstances() 5911 void showLiveDocumentInstances()
5917 { 5912 {
5918 Document::WeakDocumentSet& set = Document::liveDocumentSet(); 5913 Document::WeakDocumentSet& set = Document::liveDocumentSet();
5919 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5914 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5920 for (Document* document : set) 5915 for (Document* document : set)
5921 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 5916 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
5922 } 5917 }
5923 #endif 5918 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | third_party/WebKit/Source/core/input/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698