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

Side by Side Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 82583005: Use removeFontFace to avoid resetting fontSelector. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 const Vector<StyleRuleFontFace*> fontFaceRules = authorRules.fontFaceRul es(); 284 const Vector<StyleRuleFontFace*> fontFaceRules = authorRules.fontFaceRul es();
285 for (unsigned i = 0; i < fontFaceRules.size(); ++i) 285 for (unsigned i = 0; i < fontFaceRules.size(); ++i)
286 fontSelector()->addFontFaceRule(fontFaceRules[i]); 286 fontSelector()->addFontFaceRule(fontFaceRules[i]);
287 if (fontFaceRules.size()) 287 if (fontFaceRules.size())
288 invalidateMatchedPropertiesCache(); 288 invalidateMatchedPropertiesCache();
289 } else { 289 } else {
290 addTreeBoundaryCrossingRules(authorRules.shadowDistributedRules(), scope ); 290 addTreeBoundaryCrossingRules(authorRules.shadowDistributedRules(), scope );
291 } 291 }
292 } 292 }
293 293
294 void StyleResolver::resetFontSelector() 294 void StyleResolver::removeFontFaceRule(Vector<const StyleRuleFontFace*>& removed FontFace)
dglazkov 2013/11/25 16:27:29 removeFontFaceRules? Could the argument be const?
tasak 2013/11/26 07:49:06 Done.
295 { 295 {
296 ASSERT(m_fontSelector); 296 ASSERT(m_fontSelector);
297 m_fontSelector->unregisterForInvalidationCallbacks(this); 297 for (unsigned i = 0; i < removedFontFace.size(); ++i)
298 m_fontSelector->clearDocument(); 298 m_fontSelector->removeFontFaceRule(removedFontFace[i]);
299 invalidateMatchedPropertiesCache(); 299 invalidateMatchedPropertiesCache();
300
301 m_fontSelector = CSSFontSelector::create(&m_document);
302 m_fontSelector->registerForInvalidationCallbacks(this);
303 } 300 }
304 301
305 void StyleResolver::resetAuthorStyle(const ContainerNode* scopingNode) 302 void StyleResolver::resetAuthorStyle(const ContainerNode* scopingNode)
306 { 303 {
307 // FIXME: When chanking scoped attribute, scopingNode's hasScopedHTMLStyleCh ild has been already modified. 304 // FIXME: When chanking scoped attribute, scopingNode's hasScopedHTMLStyleCh ild has been already modified.
308 // So we cannot use hasScopedHTMLStyleChild flag here. 305 // So we cannot use hasScopedHTMLStyleChild flag here.
309 ScopedStyleResolver* resolver = scopingNode ? m_styleTree.lookupScopedStyleR esolverFor(scopingNode) : m_styleTree.scopedStyleResolverForDocument(); 306 ScopedStyleResolver* resolver = scopingNode ? m_styleTree.lookupScopedStyleR esolverFor(scopingNode) : m_styleTree.scopedStyleResolverForDocument();
310 if (!resolver) 307 if (!resolver)
311 return; 308 return;
312 309
(...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1462 bool StyleResolver::affectedByViewportChange() const 1459 bool StyleResolver::affectedByViewportChange() const
1463 { 1460 {
1464 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) { 1461 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) {
1465 if (m_medium->eval(&m_viewportDependentMediaQueryResults[i]->m_expressio n) != m_viewportDependentMediaQueryResults[i]->m_result) 1462 if (m_medium->eval(&m_viewportDependentMediaQueryResults[i]->m_expressio n) != m_viewportDependentMediaQueryResults[i]->m_result)
1466 return true; 1463 return true;
1467 } 1464 }
1468 return false; 1465 return false;
1469 } 1466 }
1470 1467
1471 } // namespace WebCore 1468 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698