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

Unified Diff: Source/core/rendering/RenderInline.cpp

Issue 492433006: Don't add empty rects during addFocusRingRects (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: More rebaslines (real improvements!) Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/css/ignore-empty-focus-ring-rects.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderInline.cpp
diff --git a/Source/core/rendering/RenderInline.cpp b/Source/core/rendering/RenderInline.cpp
index f4ed767e6895046986d19f240eeea4a7ee3a02ff..23a6085f746f687bdcb1f8b45e4e14f8f6d74640 100644
--- a/Source/core/rendering/RenderInline.cpp
+++ b/Source/core/rendering/RenderInline.cpp
@@ -1373,9 +1373,25 @@ void RenderInline::imageChanged(WrappedImagePtr, const IntRect*)
setShouldDoFullPaintInvalidation(true);
}
+namespace {
+
+class AbsoluteRectsIgnoringEmptyRectsGeneratorContext : public AbsoluteRectsGeneratorContext {
+public:
+ AbsoluteRectsIgnoringEmptyRectsGeneratorContext(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset)
+ : AbsoluteRectsGeneratorContext(rects, accumulatedOffset) { }
+
+ void operator()(const FloatRect& rect)
+ {
+ if (!rect.isEmpty())
+ AbsoluteRectsGeneratorContext::operator()(rect);
+ }
+};
+
+} // unnamed namespace
+
void RenderInline::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint& additionalOffset, const RenderLayerModelObject* paintContainer) const
{
- AbsoluteRectsGeneratorContext context(rects, additionalOffset);
+ AbsoluteRectsIgnoringEmptyRectsGeneratorContext context(rects, additionalOffset);
generateLineBoxRects(context);
addChildFocusRingRects(rects, additionalOffset, paintContainer);
« no previous file with comments | « LayoutTests/fast/css/ignore-empty-focus-ring-rects.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698