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

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: 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 | « no previous file | 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 802732c0f5f72098f7cce116e6e11ae04e76402b..84539940e01b14f27012d0b2f89b355372b7377c 100644
--- a/Source/core/rendering/RenderInline.cpp
+++ b/Source/core/rendering/RenderInline.cpp
@@ -1363,9 +1363,25 @@ void RenderInline::imageChanged(WrappedImagePtr, const IntRect*)
setShouldDoFullPaintInvalidation(true);
}
+namespace {
esprehn 2014/08/21 17:22:08 No need for the anonymous namespace. Also why woul
Xianzhu 2014/08/21 17:26:28 I saw yield(FloatRect()) in the code, so wondering
Xianzhu 2014/08/22 00:12:15 Tried to ignore empty rects for all GeneratorConte
+
+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 | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698