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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGInlineText.cpp

Issue 1363913004: [Reland] Invalidate whitespace text on text color changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> 2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>
3 * Copyright (C) 2006 Apple Computer Inc. 3 * Copyright (C) 2006 Apple Computer Inc.
4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
5 * Copyright (C) 2008 Rob Buis <buis@kde.org> 5 * Copyright (C) 2008 Rob Buis <buis@kde.org>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 154
155 const SVGCharacterDataMap::const_iterator it = m_layoutAttributes.characterD ataMap().find(static_cast<unsigned>(position + 1)); 155 const SVGCharacterDataMap::const_iterator it = m_layoutAttributes.characterD ataMap().find(static_cast<unsigned>(position + 1));
156 if (it == m_layoutAttributes.characterDataMap().end()) 156 if (it == m_layoutAttributes.characterDataMap().end())
157 return false; 157 return false;
158 158
159 return !SVGTextLayoutAttributes::isEmptyValue(it->value.x) || !SVGTextLayout Attributes::isEmptyValue(it->value.y); 159 return !SVGTextLayoutAttributes::isEmptyValue(it->value.x) || !SVGTextLayout Attributes::isEmptyValue(it->value.y);
160 } 160 }
161 161
162 PositionWithAffinity LayoutSVGInlineText::positionForPoint(const LayoutPoint& po int) 162 PositionWithAffinity LayoutSVGInlineText::positionForPoint(const LayoutPoint& po int)
163 { 163 {
164 if (!firstTextBox() || !textLength()) 164 if (!hasTextBoxes() || !textLength())
165 return createPositionWithAffinity(0); 165 return createPositionWithAffinity(0);
166 166
167 ASSERT(m_scalingFactor); 167 ASSERT(m_scalingFactor);
168 float baseline = m_scaledFont.fontMetrics().floatAscent() / m_scalingFactor; 168 float baseline = m_scaledFont.fontMetrics().floatAscent() / m_scalingFactor;
169 169
170 LayoutBlock* containingBlock = this->containingBlock(); 170 LayoutBlock* containingBlock = this->containingBlock();
171 ASSERT(containingBlock); 171 ASSERT(containingBlock);
172 172
173 // Map local point to absolute point, as the character origins stored in the text fragments use absolute coordinates. 173 // Map local point to absolute point, as the character origins stored in the text fragments use absolute coordinates.
174 FloatPoint absolutePoint(point); 174 FloatPoint absolutePoint(point);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 256
257 PassRefPtr<StringImpl> LayoutSVGInlineText::originalText() const 257 PassRefPtr<StringImpl> LayoutSVGInlineText::originalText() const
258 { 258 {
259 RefPtr<StringImpl> result = LayoutText::originalText(); 259 RefPtr<StringImpl> result = LayoutText::originalText();
260 if (!result) 260 if (!result)
261 return nullptr; 261 return nullptr;
262 return applySVGWhitespaceRules(result, style() && style()->whiteSpace() == P RE); 262 return applySVGWhitespaceRules(result, style() && style()->whiteSpace() == P RE);
263 } 263 }
264 264
265 } 265 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp ('k') | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698