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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1356 1356
1357 void RenderInline::imageChanged(WrappedImagePtr, const IntRect*) 1357 void RenderInline::imageChanged(WrappedImagePtr, const IntRect*)
1358 { 1358 {
1359 if (!parent()) 1359 if (!parent())
1360 return; 1360 return;
1361 1361
1362 // FIXME: We can do better. 1362 // FIXME: We can do better.
1363 setShouldDoFullPaintInvalidation(true); 1363 setShouldDoFullPaintInvalidation(true);
1364 } 1364 }
1365 1365
1366 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
1367
1368 class AbsoluteRectsIgnoringEmptyRectsGeneratorContext : public AbsoluteRectsGene ratorContext {
1369 public:
1370 AbsoluteRectsIgnoringEmptyRectsGeneratorContext(Vector<IntRect>& rects, cons t LayoutPoint& accumulatedOffset)
1371 : AbsoluteRectsGeneratorContext(rects, accumulatedOffset) { }
1372
1373 void operator()(const FloatRect& rect)
1374 {
1375 if (!rect.isEmpty())
1376 AbsoluteRectsGeneratorContext::operator()(rect);
1377 }
1378 };
1379
1380 } // unnamed namespace
1381
1366 void RenderInline::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint& additionalOffset, const RenderLayerModelObject* paintContainer) const 1382 void RenderInline::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint& additionalOffset, const RenderLayerModelObject* paintContainer) const
1367 { 1383 {
1368 AbsoluteRectsGeneratorContext context(rects, additionalOffset); 1384 AbsoluteRectsIgnoringEmptyRectsGeneratorContext context(rects, additionalOff set);
1369 generateLineBoxRects(context); 1385 generateLineBoxRects(context);
1370 1386
1371 addChildFocusRingRects(rects, additionalOffset, paintContainer); 1387 addChildFocusRingRects(rects, additionalOffset, paintContainer);
1372 1388
1373 if (continuation()) { 1389 if (continuation()) {
1374 // If the continuation doesn't paint into the same container, let its pa int invalidation container handle it. 1390 // If the continuation doesn't paint into the same container, let its pa int invalidation container handle it.
1375 if (paintContainer != continuation()->containerForPaintInvalidation()) 1391 if (paintContainer != continuation()->containerForPaintInvalidation())
1376 return; 1392 return;
1377 if (continuation()->isInline()) 1393 if (continuation()->isInline())
1378 continuation()->addFocusRingRects(rects, flooredLayoutPoint(addition alOffset + continuation()->containingBlock()->location() - containingBlock()->lo cation()), paintContainer); 1394 continuation()->addFocusRingRects(rects, flooredLayoutPoint(addition alOffset + continuation()->containingBlock()->location() - containingBlock()->lo cation()), paintContainer);
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
1580 container = this; 1596 container = this;
1581 1597
1582 FloatPoint absPos = container->localToAbsolute(); 1598 FloatPoint absPos = container->localToAbsolute();
1583 region.bounds.setX(absPos.x() + region.bounds.x()); 1599 region.bounds.setX(absPos.x() + region.bounds.x());
1584 region.bounds.setY(absPos.y() + region.bounds.y()); 1600 region.bounds.setY(absPos.y() + region.bounds.y());
1585 1601
1586 regions.append(region); 1602 regions.append(region);
1587 } 1603 }
1588 1604
1589 } // namespace blink 1605 } // namespace blink
OLDNEW
« 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