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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLStyleElement.cpp

Issue 2623513005: Introduce Element::AttributeModificationParams (Closed)
Patch Set: Created 3 years, 11 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 * Copyright (C) 2003, 2010 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2010 Apple Inc. All rights reserved.
6 * (C) 2007 Rob Buis (buis@kde.org) 6 * (C) 2007 Rob Buis (buis@kde.org)
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 m_firedLoad(false), 42 m_firedLoad(false),
43 m_loadedSheet(false) {} 43 m_loadedSheet(false) {}
44 44
45 HTMLStyleElement::~HTMLStyleElement() {} 45 HTMLStyleElement::~HTMLStyleElement() {}
46 46
47 HTMLStyleElement* HTMLStyleElement::create(Document& document, 47 HTMLStyleElement* HTMLStyleElement::create(Document& document,
48 bool createdByParser) { 48 bool createdByParser) {
49 return new HTMLStyleElement(document, createdByParser); 49 return new HTMLStyleElement(document, createdByParser);
50 } 50 }
51 51
52 void HTMLStyleElement::parseAttribute(const QualifiedName& name, 52 void HTMLStyleElement::parseAttribute(
53 const AtomicString& oldValue, 53 const AttributeModificationParams& params) {
54 const AtomicString& value) { 54 if (params.name == titleAttr && m_sheet && isInDocumentTree()) {
55 if (name == titleAttr && m_sheet && isInDocumentTree()) { 55 m_sheet->setTitle(params.newValue);
56 m_sheet->setTitle(value); 56 } else if (params.name == mediaAttr && isConnected() &&
57 } else if (name == mediaAttr && isConnected() && document().isActive() && 57 document().isActive() && m_sheet) {
58 m_sheet) { 58 m_sheet->setMediaQueries(MediaQuerySet::create(params.newValue));
59 m_sheet->setMediaQueries(MediaQuerySet::create(value));
60 document().styleEngine().mediaQueriesChangedInScope(treeScope()); 59 document().styleEngine().mediaQueriesChangedInScope(treeScope());
61 } else { 60 } else {
62 HTMLElement::parseAttribute(name, oldValue, value); 61 HTMLElement::parseAttribute(params);
63 } 62 }
64 } 63 }
65 64
66 void HTMLStyleElement::finishParsingChildren() { 65 void HTMLStyleElement::finishParsingChildren() {
67 StyleElement::ProcessingResult result = 66 StyleElement::ProcessingResult result =
68 StyleElement::finishParsingChildren(*this); 67 StyleElement::finishParsingChildren(*this);
69 HTMLElement::finishParsingChildren(); 68 HTMLElement::finishParsingChildren();
70 if (result == StyleElement::ProcessingFatalError) 69 if (result == StyleElement::ProcessingFatalError)
71 notifyLoadedSheetAndAllCriticalSubresources( 70 notifyLoadedSheetAndAllCriticalSubresources(
72 ErrorOccurredLoadingSubresource); 71 ErrorOccurredLoadingSubresource);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 if (CSSStyleSheet* styleSheet = sheet()) 137 if (CSSStyleSheet* styleSheet = sheet())
139 styleSheet->setDisabled(setDisabled); 138 styleSheet->setDisabled(setDisabled);
140 } 139 }
141 140
142 DEFINE_TRACE(HTMLStyleElement) { 141 DEFINE_TRACE(HTMLStyleElement) {
143 StyleElement::trace(visitor); 142 StyleElement::trace(visitor);
144 HTMLElement::trace(visitor); 143 HTMLElement::trace(visitor);
145 } 144 }
146 145
147 } // namespace blink 146 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLStyleElement.h ('k') | third_party/WebKit/Source/core/html/HTMLTableCellElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698