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

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

Issue 1619963002: Add UseCounter for weird body+viewport scrolling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mousewheel-usecounter
Patch Set: Fix typo Created 4 years, 11 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('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 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 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after
1630 } 1630 }
1631 EImageRendering imageRendering = backgroundStyle->imageRendering(); 1631 EImageRendering imageRendering = backgroundStyle->imageRendering();
1632 1632
1633 const ComputedStyle* overflowStyle = nullptr; 1633 const ComputedStyle* overflowStyle = nullptr;
1634 if (Element* element = viewportDefiningElement(documentElementStyle.get())) { 1634 if (Element* element = viewportDefiningElement(documentElementStyle.get())) {
1635 if (element == body) { 1635 if (element == body) {
1636 overflowStyle = bodyStyle.get(); 1636 overflowStyle = bodyStyle.get();
1637 } else { 1637 } else {
1638 ASSERT(element == documentElement()); 1638 ASSERT(element == documentElement());
1639 overflowStyle = documentElementStyle.get(); 1639 overflowStyle = documentElementStyle.get();
1640
1641 // The body element has its own scrolling box, independent from the viewport.
1642 // This is a bit of a weird edge case in the CSS spec that we might want to try to
1643 // eliminate some day (eg. for ScrollTopLeftInterop - see http://crb ug.com/157855).
1644 if (bodyStyle && !bodyStyle->isOverflowVisible())
1645 UseCounter::count(*this, UseCounter::BodyScrollsInAdditionToView port);
1640 } 1646 }
1641 } 1647 }
1642 1648
1643 // Resolved rem units are stored in the matched properties cache so we need to make sure to 1649 // Resolved rem units are stored in the matched properties cache so we need to make sure to
1644 // invalidate the cache if the documentElement needed to reattach or the fon t size changed 1650 // invalidate the cache if the documentElement needed to reattach or the fon t size changed
1645 // and then trigger a full document recalc. We also need to clear it here si nce the 1651 // and then trigger a full document recalc. We also need to clear it here si nce the
1646 // call to styleForElement on the body above can cache bad values for rem un its if the 1652 // call to styleForElement on the body above can cache bad values for rem un its if the
1647 // documentElement's style was dirty. We could keep track of which elements depend on 1653 // documentElement's style was dirty. We could keep track of which elements depend on
1648 // rem units like we do for viewport styles, but we assume root font size ch anges are 1654 // rem units like we do for viewport styles, but we assume root font size ch anges are
1649 // rare and just invalidate the cache for now. 1655 // rare and just invalidate the cache for now.
(...skipping 4266 matching lines...) Expand 10 before | Expand all | Expand 10 after
5916 #ifndef NDEBUG 5922 #ifndef NDEBUG
5917 using namespace blink; 5923 using namespace blink;
5918 void showLiveDocumentInstances() 5924 void showLiveDocumentInstances()
5919 { 5925 {
5920 Document::WeakDocumentSet& set = Document::liveDocumentSet(); 5926 Document::WeakDocumentSet& set = Document::liveDocumentSet();
5921 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5927 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5922 for (Document* document : set) 5928 for (Document* document : set)
5923 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5929 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5924 } 5930 }
5925 #endif 5931 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698