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

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

Issue 2825343003: Clean compositing inputs for location APIs for sticky-affected elements. (Closed)
Patch Set: Rebase Created 3 years, 7 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 2363 matching lines...) Expand 10 before | Expand all | Expand 10 after
2374 2374
2375 return EnsureStyleResolver().StyleForElement(element, parent_style, 2375 return EnsureStyleResolver().StyleForElement(element, parent_style,
2376 layout_parent_style); 2376 layout_parent_style);
2377 } 2377 }
2378 2378
2379 PassRefPtr<ComputedStyle> Document::StyleForPage(int page_index) { 2379 PassRefPtr<ComputedStyle> Document::StyleForPage(int page_index) {
2380 UpdateDistribution(); 2380 UpdateDistribution();
2381 return EnsureStyleResolver().StyleForPage(page_index); 2381 return EnsureStyleResolver().StyleForPage(page_index);
2382 } 2382 }
2383 2383
2384 void Document::EnsurePaintLocationDataValidForNode(const Node* node) {
2385 DCHECK(node);
2386 if (!node->InActiveDocument())
2387 return;
2388
2389 // For all nodes we must have up-to-date style and have performed layout to do
2390 // any location-based calculation.
2391 UpdateStyleAndLayoutIgnorePendingStylesheets();
2392
2393 // The location of elements that are position: sticky is not known until
2394 // compositing inputs are cleaned. Therefore, for any elements that are either
2395 // sticky or are in a sticky sub-tree (e.g. are affected by a sticky element),
2396 // we need to also clean compositing inputs.
2397 if (View() && node->GetLayoutObject() &&
2398 node->GetLayoutObject()->StyleRef().SubtreeIsSticky()) {
2399 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
2400 // In SPv2, compositing inputs are cleaned as part of PrePaint.
2401 View()->UpdateAllLifecyclePhasesExceptPaint();
2402 } else {
2403 View()->UpdateLifecycleToCompositingInputsClean();
2404 }
2405 }
2406 }
2407
2384 bool Document::IsPageBoxVisible(int page_index) { 2408 bool Document::IsPageBoxVisible(int page_index) {
2385 return StyleForPage(page_index)->Visibility() != 2409 return StyleForPage(page_index)->Visibility() !=
2386 EVisibility::kHidden; // display property doesn't apply to @page. 2410 EVisibility::kHidden; // display property doesn't apply to @page.
2387 } 2411 }
2388 2412
2389 void Document::PageSizeAndMarginsInPixels(int page_index, 2413 void Document::PageSizeAndMarginsInPixels(int page_index,
2390 DoubleSize& page_size, 2414 DoubleSize& page_size,
2391 int& margin_top, 2415 int& margin_top,
2392 int& margin_right, 2416 int& margin_right,
2393 int& margin_bottom, 2417 int& margin_bottom,
(...skipping 4396 matching lines...) Expand 10 before | Expand all | Expand 10 after
6790 } 6814 }
6791 6815
6792 void showLiveDocumentInstances() { 6816 void showLiveDocumentInstances() {
6793 WeakDocumentSet& set = liveDocumentSet(); 6817 WeakDocumentSet& set = liveDocumentSet();
6794 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6818 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6795 for (blink::Document* document : set) 6819 for (blink::Document* document : set)
6796 fprintf(stderr, "- Document %p URL: %s\n", document, 6820 fprintf(stderr, "- Document %p URL: %s\n", document,
6797 document->Url().GetString().Utf8().data()); 6821 document->Url().GetString().Utf8().data());
6798 } 6822 }
6799 #endif 6823 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/DocumentTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698