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

Side by Side Diff: third_party/WebKit/Source/core/dom/StyleEngine.cpp

Issue 2079303002: Move preferred stylesheet set out of active sheet update. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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) 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 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 } else { 520 } else {
521 StyleSheetContents* contents = result.storedValue->value; 521 StyleSheetContents* contents = result.storedValue->value;
522 DCHECK(contents); 522 DCHECK(contents);
523 DCHECK(contents->isCacheableForStyleElement()); 523 DCHECK(contents->isCacheableForStyleElement());
524 DCHECK_EQ(contents->singleOwnerDocument(), e->document()); 524 DCHECK_EQ(contents->singleOwnerDocument(), e->document());
525 styleSheet = CSSStyleSheet::createInline(contents, e, startPosition); 525 styleSheet = CSSStyleSheet::createInline(contents, e, startPosition);
526 } 526 }
527 527
528 DCHECK(styleSheet); 528 DCHECK(styleSheet);
529 styleSheet->setTitle(e->title()); 529 styleSheet->setTitle(e->title());
530 if (!e->isInShadowTree())
531 setPreferredStylesheetSetNameIfNotSet(e->title());
530 return styleSheet; 532 return styleSheet;
531 } 533 }
532 534
533 CSSStyleSheet* StyleEngine::parseSheet(Element* e, const String& text, TextPosit ion startPosition) 535 CSSStyleSheet* StyleEngine::parseSheet(Element* e, const String& text, TextPosit ion startPosition)
534 { 536 {
535 CSSStyleSheet* styleSheet = nullptr; 537 CSSStyleSheet* styleSheet = nullptr;
536 styleSheet = CSSStyleSheet::createInline(e, KURL(), startPosition, e->docume nt().characterSet()); 538 styleSheet = CSSStyleSheet::createInline(e, KURL(), startPosition, e->docume nt().characterSet());
537 styleSheet->contents()->parseStringAtPosition(text, startPosition); 539 styleSheet->contents()->parseStringAtPosition(text, startPosition);
538 return styleSheet; 540 return styleSheet;
539 } 541 }
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 763
762 DEFINE_TRACE_WRAPPERS(StyleEngine) 764 DEFINE_TRACE_WRAPPERS(StyleEngine)
763 { 765 {
764 for (auto sheet : m_injectedAuthorStyleSheets) { 766 for (auto sheet : m_injectedAuthorStyleSheets) {
765 visitor->traceWrappers(sheet); 767 visitor->traceWrappers(sheet);
766 } 768 }
767 visitor->traceWrappers(m_documentStyleSheetCollection); 769 visitor->traceWrappers(m_documentStyleSheetCollection);
768 } 770 }
769 771
770 } // namespace blink 772 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp ('k') | third_party/WebKit/Source/core/dom/StyleSheetCandidate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698