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

Side by Side Diff: sky/engine/core/dom/StyleEngine.cpp

Issue 799143002: Remove single client special cases for StyleSheetContents. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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
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 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 if (result.isNewEntry || !result.storedValue->value) { 383 if (result.isNewEntry || !result.storedValue->value) {
384 styleSheet = CSSStyleSheet::create(e, KURL()); 384 styleSheet = CSSStyleSheet::create(e, KURL());
385 styleSheet->contents()->parseString(text); 385 styleSheet->contents()->parseString(text);
386 if (result.isNewEntry) { 386 if (result.isNewEntry) {
387 result.storedValue->value = styleSheet->contents(); 387 result.storedValue->value = styleSheet->contents();
388 m_sheetToTextCache.add(styleSheet->contents(), textContent); 388 m_sheetToTextCache.add(styleSheet->contents(), textContent);
389 } 389 }
390 } else { 390 } else {
391 StyleSheetContents* contents = result.storedValue->value; 391 StyleSheetContents* contents = result.storedValue->value;
392 ASSERT(contents); 392 ASSERT(contents);
393 ASSERT(contents->singleOwnerDocument() == e->document());
394 styleSheet = CSSStyleSheet::create(contents, e); 393 styleSheet = CSSStyleSheet::create(contents, e);
395 } 394 }
396 395
397 ASSERT(styleSheet); 396 ASSERT(styleSheet);
398 return styleSheet; 397 return styleSheet;
399 } 398 }
400 399
401 void StyleEngine::removeSheet(StyleSheetContents* contents) 400 void StyleEngine::removeSheet(StyleSheetContents* contents)
402 { 401 {
403 HashMap<RawPtr<StyleSheetContents>, AtomicString>::iterator it = m_sheetToTe xtCache.find(contents); 402 HashMap<RawPtr<StyleSheetContents>, AtomicString>::iterator it = m_sheetToTe xtCache.find(contents);
(...skipping 15 matching lines...) Expand all
419 { 418 {
420 if (!document().isActive()) 419 if (!document().isActive())
421 return; 420 return;
422 421
423 if (m_resolver) 422 if (m_resolver)
424 m_resolver->invalidateMatchedPropertiesCache(); 423 m_resolver->invalidateMatchedPropertiesCache();
425 document().setNeedsStyleRecalc(SubtreeStyleChange); 424 document().setNeedsStyleRecalc(SubtreeStyleChange);
426 } 425 }
427 426
428 } 427 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698