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

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

Issue 2618323004: Don't force-update style and layout in Document::scrollingElement (Closed)
Patch Set: none Created 3 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
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 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after
1338 PositionWithAffinity positionWithAffinity = result.position(); 1338 PositionWithAffinity positionWithAffinity = result.position();
1339 if (positionWithAffinity.isNull()) 1339 if (positionWithAffinity.isNull())
1340 return nullptr; 1340 return nullptr;
1341 1341
1342 Position rangeCompliantPosition = 1342 Position rangeCompliantPosition =
1343 positionWithAffinity.position().parentAnchoredEquivalent(); 1343 positionWithAffinity.position().parentAnchoredEquivalent();
1344 return Range::createAdjustedToTreeScope(*this, rangeCompliantPosition); 1344 return Range::createAdjustedToTreeScope(*this, rangeCompliantPosition);
1345 } 1345 }
1346 1346
1347 Element* Document::scrollingElement() { 1347 Element* Document::scrollingElement() {
1348 if (RuntimeEnabledFeatures::scrollTopLeftInteropEnabled() && inQuirksMode())
1349 updateStyleAndLayoutTree();
1350 return scrollingElementInternal();
1351 }
1352
1353 Element* Document::scrollingElementInternal() {
1348 if (RuntimeEnabledFeatures::scrollTopLeftInteropEnabled()) { 1354 if (RuntimeEnabledFeatures::scrollTopLeftInteropEnabled()) {
wkorman 2017/01/11 03:56:39 Maybe add a DCHECK to ensure we're at LayoutClean?
chrishtr 2017/01/11 04:09:09 Done.
1349 if (inQuirksMode()) { 1355 if (inQuirksMode()) {
1350 updateStyleAndLayoutTree();
1351 HTMLBodyElement* body = firstBodyElement(); 1356 HTMLBodyElement* body = firstBodyElement();
1352 if (body && body->layoutObject() && 1357 if (body && body->layoutObject() &&
1353 body->layoutObject()->hasOverflowClip()) 1358 body->layoutObject()->hasOverflowClip())
1354 return nullptr; 1359 return nullptr;
1355 1360
1356 return body; 1361 return body;
1357 } 1362 }
1358 1363
1359 return documentElement(); 1364 return documentElement();
1360 } 1365 }
(...skipping 5222 matching lines...) Expand 10 before | Expand all | Expand 10 after
6583 } 6588 }
6584 6589
6585 void showLiveDocumentInstances() { 6590 void showLiveDocumentInstances() {
6586 WeakDocumentSet& set = liveDocumentSet(); 6591 WeakDocumentSet& set = liveDocumentSet();
6587 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6592 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6588 for (Document* document : set) 6593 for (Document* document : set)
6589 fprintf(stderr, "- Document %p URL: %s\n", document, 6594 fprintf(stderr, "- Document %p URL: %s\n", document,
6590 document->url().getString().utf8().data()); 6595 document->url().getString().utf8().data());
6591 } 6596 }
6592 #endif 6597 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698