[webkit-changes] [135064] trunk/Source/WebCore

2012-11-17 Thread simon . fraser
Title: [135064] trunk/Source/WebCore








Revision 135064
Author simon.fra...@apple.com
Date 2012-11-17 23:09:58 -0800 (Sat, 17 Nov 2012)


Log Message
Don't say there are dirty overlay scrollbars when they are clipped out
https://bugs.webkit.org/show_bug.cgi?id=102609

Reviewed by Brady Eidson.

Painting overlay scrollbars involves a second painting pass over the entire
RenderLayer subtree for a compositing layer, which can be very expensive.

Avoid this when possible by detecting when overflow controls are not in
the damage rect.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::rectForHorizontalScrollbar): Compute a local rect
for the horizontal scrollbar.
(WebCore::RenderLayer::rectForVerticalScrollbar): Compute a local rect
for the vertical scrollbar.
(WebCore::RenderLayer::positionOverflowControls): Use rectForHorizontalScrollbar()
and rectForVerticalScrollbar().
(WebCore::RenderLayer::overflowControlsIntersectRect): Return true if any
of the present overflow controls intersect the given local rect.
(WebCore::RenderLayer::paintOverflowControls): Bail if the damage rect
doesn't intersect any of the overflow controls.
* rendering/RenderLayer.h:
(RenderLayer):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/rendering/RenderLayer.cpp
trunk/Source/WebCore/rendering/RenderLayer.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (135063 => 135064)

--- trunk/Source/WebCore/ChangeLog	2012-11-18 05:16:29 UTC (rev 135063)
+++ trunk/Source/WebCore/ChangeLog	2012-11-18 07:09:58 UTC (rev 135064)
@@ -1,3 +1,30 @@
+2012-11-17  Simon Fraser  
+
+Don't say there are dirty overlay scrollbars when they are clipped out
+https://bugs.webkit.org/show_bug.cgi?id=102609
+
+Reviewed by Brady Eidson.
+
+Painting overlay scrollbars involves a second painting pass over the entire
+RenderLayer subtree for a compositing layer, which can be very expensive.
+
+Avoid this when possible by detecting when overflow controls are not in
+the damage rect.
+
+* rendering/RenderLayer.cpp:
+(WebCore::RenderLayer::rectForHorizontalScrollbar): Compute a local rect
+for the horizontal scrollbar.
+(WebCore::RenderLayer::rectForVerticalScrollbar): Compute a local rect
+for the vertical scrollbar.
+(WebCore::RenderLayer::positionOverflowControls): Use rectForHorizontalScrollbar()
+and rectForVerticalScrollbar().
+(WebCore::RenderLayer::overflowControlsIntersectRect): Return true if any
+of the present overflow controls intersect the given local rect.
+(WebCore::RenderLayer::paintOverflowControls): Bail if the damage rect
+doesn't intersect any of the overflow controls.
+* rendering/RenderLayer.h:
+(RenderLayer):
+
 2012-11-17  Adam Barth  
 
 REGRESSION (r133633): ASSERTION FAILED: m_wrapper || !m_jsFunction


Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (135063 => 135064)

--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-11-18 05:16:29 UTC (rev 135063)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-11-18 07:09:58 UTC (rev 135064)
@@ -2273,6 +2273,34 @@
 return renderer()->frame() ? renderer()->frame()->eventHandler()->currentMousePosition() : IntPoint();
 }
 
+IntRect RenderLayer::rectForHorizontalScrollbar(const IntRect& borderBoxRect) const
+{
+if (!m_hBar)
+return IntRect();
+
+const RenderBox* box = renderBox();
+const IntRect& scrollCorner = scrollCornerRect();
+
+return IntRect(horizontalScrollbarStart(borderBoxRect.x()),
+borderBoxRect.maxY() - box->borderBottom() - m_hBar->height(),
+borderBoxRect.width() - (box->borderLeft() + box->borderRight()) - scrollCorner.width(),
+m_hBar->height());
+}
+
+IntRect RenderLayer::rectForVerticalScrollbar(const IntRect& borderBoxRect) const
+{
+if (!m_vBar)
+return IntRect();
+
+const RenderBox* box = renderBox();
+const IntRect& scrollCorner = scrollCornerRect();
+
+return IntRect(verticalScrollbarStart(borderBoxRect.x(), borderBoxRect.maxX()),
+borderBoxRect.y() + box->borderTop(),
+m_vBar->width(),
+borderBoxRect.height() - (box->borderTop() + box->borderBottom()) - scrollCorner.height());
+}
+
 LayoutUnit RenderLayer::verticalScrollbarStart(int minX, int maxX) const
 {
 const RenderBox* box = renderBox();
@@ -2495,18 +2523,18 @@
 const IntRect borderBox = box->pixelSnappedBorderBoxRect();
 const IntRect& scrollCorner = scrollCornerRect();
 IntRect absBounds(borderBox.location() + offsetFromRoot, borderBox.size());
-if (m_vBar)
-m_vBar->setFrameRect(IntRect(verticalScrollbarStart(absBounds.x(), absBounds.maxX()),
- absBounds.y() + box->borderTop(),
- m_vBar->width(),
- absBounds.height() - (box->borderTop() + box->borderBottom()) - scrollC

[webkit-changes] [135063] trunk

2012-11-17 Thread abarth
Title: [135063] trunk








Revision 135063
Author aba...@webkit.org
Date 2012-11-17 21:16:29 -0800 (Sat, 17 Nov 2012)


Log Message
REGRESSION (r133633): ASSERTION FAILED: m_wrapper || !m_jsFunction
https://bugs.webkit.org/show_bug.cgi?id=101428

Reviewed by Geoffrey Garen.

Source/WebCore:

JSNodeOwner has some smarts that wrappers of subclasses of Node need to
call during garbage collection. This patch teaches subclasses of Node
to have their JSMumbleOwner objects inherit from JSNodeOwner.

The immediate benefit of this patch is that we correctly avoid
collecting wrappers for HTMLAudioElements when they are reachable from
the DOM.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):

LayoutTests:

Add two calls to gc() to make an ASSERT trigger on every run. One call
to gc() does not appear to be sufficient for reasons I don't fully
understand.

* media/media-continues-playing-after-replace-source.html:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/media/media-continues-playing-after-replace-source.html
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm




Diff

Modified: trunk/LayoutTests/ChangeLog (135062 => 135063)

--- trunk/LayoutTests/ChangeLog	2012-11-18 05:14:30 UTC (rev 135062)
+++ trunk/LayoutTests/ChangeLog	2012-11-18 05:16:29 UTC (rev 135063)
@@ -1,3 +1,16 @@
+2012-11-17  Adam Barth  
+
+REGRESSION (r133633): ASSERTION FAILED: m_wrapper || !m_jsFunction
+https://bugs.webkit.org/show_bug.cgi?id=101428
+
+Reviewed by Geoffrey Garen.
+
+Add two calls to gc() to make an ASSERT trigger on every run. One call
+to gc() does not appear to be sufficient for reasons I don't fully
+understand.
+
+* media/media-continues-playing-after-replace-source.html:
+
 2012-11-17  Simon Fraser  
 
 Simplify bounds computation for the RenderView's layer


Modified: trunk/LayoutTests/media/media-continues-playing-after-replace-source.html (135062 => 135063)

--- trunk/LayoutTests/media/media-continues-playing-after-replace-source.html	2012-11-18 05:14:30 UTC (rev 135062)
+++ trunk/LayoutTests/media/media-continues-playing-after-replace-source.html	2012-11-18 05:16:29 UTC (rev 135063)
@@ -6,6 +6,7 @@