| OLD | NEW |
| 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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 document().importsController()->master()->styleEngine()->markDocumentDir
ty(); | 374 document().importsController()->master()->styleEngine()->markDocumentDir
ty(); |
| 375 } | 375 } |
| 376 | 376 |
| 377 PassRefPtr<CSSStyleSheet> StyleEngine::createSheet(Element* e, const String& tex
t) | 377 PassRefPtr<CSSStyleSheet> StyleEngine::createSheet(Element* e, const String& tex
t) |
| 378 { | 378 { |
| 379 RefPtr<CSSStyleSheet> styleSheet; | 379 RefPtr<CSSStyleSheet> styleSheet; |
| 380 AtomicString textContent(text); | 380 AtomicString textContent(text); |
| 381 | 381 |
| 382 HashMap<AtomicString, RawPtr<StyleSheetContents> >::AddResult result = m_tex
tToSheetCache.add(textContent, nullptr); | 382 HashMap<AtomicString, RawPtr<StyleSheetContents> >::AddResult result = m_tex
tToSheetCache.add(textContent, nullptr); |
| 383 if (result.isNewEntry || !result.storedValue->value) { | 383 if (result.isNewEntry || !result.storedValue->value) { |
| 384 styleSheet = CSSStyleSheet::createInline(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()); | 393 ASSERT(contents->singleOwnerDocument() == e->document()); |
| 394 styleSheet = CSSStyleSheet::createInline(contents, e); | 394 styleSheet = CSSStyleSheet::create(contents, e); |
| 395 } | 395 } |
| 396 | 396 |
| 397 ASSERT(styleSheet); | 397 ASSERT(styleSheet); |
| 398 return styleSheet; | 398 return styleSheet; |
| 399 } | 399 } |
| 400 | 400 |
| 401 void StyleEngine::removeSheet(StyleSheetContents* contents) | 401 void StyleEngine::removeSheet(StyleSheetContents* contents) |
| 402 { | 402 { |
| 403 HashMap<RawPtr<StyleSheetContents>, AtomicString>::iterator it = m_sheetToTe
xtCache.find(contents); | 403 HashMap<RawPtr<StyleSheetContents>, AtomicString>::iterator it = m_sheetToTe
xtCache.find(contents); |
| 404 if (it == m_sheetToTextCache.end()) | 404 if (it == m_sheetToTextCache.end()) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 419 { | 419 { |
| 420 if (!document().isActive()) | 420 if (!document().isActive()) |
| 421 return; | 421 return; |
| 422 | 422 |
| 423 if (m_resolver) | 423 if (m_resolver) |
| 424 m_resolver->invalidateMatchedPropertiesCache(); | 424 m_resolver->invalidateMatchedPropertiesCache(); |
| 425 document().setNeedsStyleRecalc(SubtreeStyleChange); | 425 document().setNeedsStyleRecalc(SubtreeStyleChange); |
| 426 } | 426 } |
| 427 | 427 |
| 428 } | 428 } |
| OLD | NEW |