Title: [182033] trunk/Source/WebCore
- Revision
- 182033
- Author
- [email protected]
- Date
- 2015-03-26 16:06:27 -0700 (Thu, 26 Mar 2015)
Log Message
Relevant repainted objects callback is inaccurate and inconsistent for PDF
documents
https://bugs.webkit.org/show_bug.cgi?id=143118
-and corresponding-
rdar://problem/13371582
Reviewed by Tim Horton.
Investigating this bug resulted in finding two things that should change for the
relevant repainted objects heuristic. First, we should not count any objects
painted while updating control tints. And secondly, we should not use it at all
for plugin documents. In other documents, we count the plugin area as “painted”
when we get to paint whether or not the plugin has actually loaded. This is
intentional because it allows us to account for chunks of the page that will be
filled in by possibly slow-loading ads. However, if the plugin is the whole
document, then the heuristic just doesn’t make any sense and it leads to
inconsistent behavior at different window sizes. So we’ll only count plugins when
the document is not a plugin document.
Don’t count objects during this paint!
* page/FrameView.cpp:
(WebCore::FrameView::updateControlTints):
* page/Page.h:
(WebCore::Page::setIsCountingRelevantRepaintedObjects):
Make sure the document is not a plugin document.
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::paint):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (182032 => 182033)
--- trunk/Source/WebCore/ChangeLog 2015-03-26 22:53:46 UTC (rev 182032)
+++ trunk/Source/WebCore/ChangeLog 2015-03-26 23:06:27 UTC (rev 182033)
@@ -1,3 +1,34 @@
+2015-03-26 Beth Dakin <[email protected]>
+
+ Relevant repainted objects callback is inaccurate and inconsistent for PDF
+ documents
+ https://bugs.webkit.org/show_bug.cgi?id=143118
+ -and corresponding-
+ rdar://problem/13371582
+
+ Reviewed by Tim Horton.
+
+ Investigating this bug resulted in finding two things that should change for the
+ relevant repainted objects heuristic. First, we should not count any objects
+ painted while updating control tints. And secondly, we should not use it at all
+ for plugin documents. In other documents, we count the plugin area as “painted”
+ when we get to paint whether or not the plugin has actually loaded. This is
+ intentional because it allows us to account for chunks of the page that will be
+ filled in by possibly slow-loading ads. However, if the plugin is the whole
+ document, then the heuristic just doesn’t make any sense and it leads to
+ inconsistent behavior at different window sizes. So we’ll only count plugins when
+ the document is not a plugin document.
+
+ Don’t count objects during this paint!
+ * page/FrameView.cpp:
+ (WebCore::FrameView::updateControlTints):
+ * page/Page.h:
+ (WebCore::Page::setIsCountingRelevantRepaintedObjects):
+
+ Make sure the document is not a plugin document.
+ * rendering/RenderEmbeddedObject.cpp:
+ (WebCore::RenderEmbeddedObject::paint):
+
2015-03-26 Alex Christensen <[email protected]>
Progress towards CMake on Mac.
Modified: trunk/Source/WebCore/page/FrameView.cpp (182032 => 182033)
--- trunk/Source/WebCore/page/FrameView.cpp 2015-03-26 22:53:46 UTC (rev 182032)
+++ trunk/Source/WebCore/page/FrameView.cpp 2015-03-26 23:06:27 UTC (rev 182033)
@@ -3737,9 +3737,20 @@
if (frame().document()->url().isEmpty())
return;
+ // As noted above, this is a "fake" paint, so we should pause counting relevant repainted objects.
+ Page* page = frame().page();
+ bool isCurrentlyCountingRelevantRepaintedObject = false;
+ if (page) {
+ isCurrentlyCountingRelevantRepaintedObject = page->isCountingRelevantRepaintedObjects();
+ page->setIsCountingRelevantRepaintedObjects(false);
+ }
+
RenderView* renderView = this->renderView();
if ((renderView && renderView->theme().supportsControlTints()) || hasCustomScrollbars())
paintControlTints();
+
+ if (page)
+ page->setIsCountingRelevantRepaintedObjects(isCurrentlyCountingRelevantRepaintedObject);
}
void FrameView::paintControlTints()
Modified: trunk/Source/WebCore/page/Page.h (182032 => 182033)
--- trunk/Source/WebCore/page/Page.h 2015-03-26 22:53:46 UTC (rev 182032)
+++ trunk/Source/WebCore/page/Page.h 2015-03-26 23:06:27 UTC (rev 182033)
@@ -359,6 +359,7 @@
WEBCORE_EXPORT Color pageExtendedBackgroundColor() const;
bool isCountingRelevantRepaintedObjects() const;
+ void setIsCountingRelevantRepaintedObjects(bool isCounting) { m_isCountingRelevantRepaintedObjects = isCounting; }
void startCountingRelevantRepaintedObjects();
void resetRelevantPaintedObjectCounter();
void addRelevantRepaintedObject(RenderObject*, const LayoutRect& objectPaintRect);
Modified: trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp (182032 => 182033)
--- trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp 2015-03-26 22:53:46 UTC (rev 182032)
+++ trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp 2015-03-26 23:06:27 UTC (rev 182033)
@@ -246,14 +246,17 @@
{
Page* page = frame().page();
+ // The relevant repainted object heuristic is not tuned for plugin documents.
+ bool countsTowardsRelevantObjects = page && !document().isPluginDocument() && paintInfo.phase == PaintPhaseForeground;
+
if (isPluginUnavailable()) {
- if (page && paintInfo.phase == PaintPhaseForeground)
+ if (countsTowardsRelevantObjects)
page->addRelevantUnpaintedObject(this, visualOverflowRect());
RenderReplaced::paint(paintInfo, paintOffset);
return;
}
- if (page && paintInfo.phase == PaintPhaseForeground)
+ if (countsTowardsRelevantObjects)
page->addRelevantRepaintedObject(this, visualOverflowRect());
RenderWidget::paint(paintInfo, paintOffset);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes