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

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

Issue 66643004: Remove QualifiedName argument from most HTMLElement::create functions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Hack for XML prefix Created 7 years, 1 month 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) 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 26 matching lines...) Expand all
37 namespace WebCore { 37 namespace WebCore {
38 38
39 using namespace HTMLNames; 39 using namespace HTMLNames;
40 40
41 static StyleEventSender& styleLoadEventSender() 41 static StyleEventSender& styleLoadEventSender()
42 { 42 {
43 DEFINE_STATIC_LOCAL(StyleEventSender, sharedLoadEventSender, (EventTypeNames ::load)); 43 DEFINE_STATIC_LOCAL(StyleEventSender, sharedLoadEventSender, (EventTypeNames ::load));
44 return sharedLoadEventSender; 44 return sharedLoadEventSender;
45 } 45 }
46 46
47 inline HTMLStyleElement::HTMLStyleElement(const QualifiedName& tagName, Document & document, bool createdByParser) 47 inline HTMLStyleElement::HTMLStyleElement(Document& document, bool createdByPars er)
48 : HTMLElement(tagName, document) 48 : HTMLElement(styleTag, document)
49 , StyleElement(&document, createdByParser) 49 , StyleElement(&document, createdByParser)
50 , m_firedLoad(false) 50 , m_firedLoad(false)
51 , m_loadedSheet(false) 51 , m_loadedSheet(false)
52 , m_scopedStyleRegistrationState(NotRegistered) 52 , m_scopedStyleRegistrationState(NotRegistered)
53 { 53 {
54 ASSERT(hasTagName(styleTag));
55 ScriptWrappable::init(this); 54 ScriptWrappable::init(this);
56 } 55 }
57 56
58 HTMLStyleElement::~HTMLStyleElement() 57 HTMLStyleElement::~HTMLStyleElement()
59 { 58 {
60 // During tear-down, willRemove isn't called, so m_scopedStyleRegistrationSt ate may still be RegisteredAsScoped or RegisteredInShadowRoot here. 59 // During tear-down, willRemove isn't called, so m_scopedStyleRegistrationSt ate may still be RegisteredAsScoped or RegisteredInShadowRoot here.
61 // Therefore we can't ASSERT(m_scopedStyleRegistrationState == NotRegistered ). 60 // Therefore we can't ASSERT(m_scopedStyleRegistrationState == NotRegistered ).
62 StyleElement::clearDocumentData(document(), this); 61 StyleElement::clearDocumentData(document(), this);
63 62
64 styleLoadEventSender().cancelEvent(this); 63 styleLoadEventSender().cancelEvent(this);
65 } 64 }
66 65
67 PassRefPtr<HTMLStyleElement> HTMLStyleElement::create(const QualifiedName& tagNa me, Document& document, bool createdByParser) 66 PassRefPtr<HTMLStyleElement> HTMLStyleElement::create(Document& document, bool c reatedByParser)
68 { 67 {
69 return adoptRef(new HTMLStyleElement(tagName, document, createdByParser)); 68 return adoptRef(new HTMLStyleElement(document, createdByParser));
70 } 69 }
71 70
72 void HTMLStyleElement::parseAttribute(const QualifiedName& name, const AtomicStr ing& value) 71 void HTMLStyleElement::parseAttribute(const QualifiedName& name, const AtomicStr ing& value)
73 { 72 {
74 if (name == titleAttr && m_sheet) { 73 if (name == titleAttr && m_sheet) {
75 m_sheet->setTitle(value); 74 m_sheet->setTitle(value);
76 } else if (name == scopedAttr && ContextFeatures::styleScopedEnabled(&docume nt())) { 75 } else if (name == scopedAttr && ContextFeatures::styleScopedEnabled(&docume nt())) {
77 scopedAttributeChanged(!value.isNull()); 76 scopedAttributeChanged(!value.isNull());
78 } else if (name == mediaAttr && inDocument() && document().isActive() && m_s heet) { 77 } else if (name == mediaAttr && inDocument() && document().isActive() && m_s heet) {
79 m_sheet->setMediaQueries(MediaQuerySet::create(value)); 78 m_sheet->setMediaQueries(MediaQuerySet::create(value));
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 return m_sheet->disabled(); 286 return m_sheet->disabled();
288 } 287 }
289 288
290 void HTMLStyleElement::setDisabled(bool setDisabled) 289 void HTMLStyleElement::setDisabled(bool setDisabled)
291 { 290 {
292 if (CSSStyleSheet* styleSheet = sheet()) 291 if (CSSStyleSheet* styleSheet = sheet())
293 styleSheet->setDisabled(setDisabled); 292 styleSheet->setDisabled(setDisabled);
294 } 293 }
295 294
296 } 295 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698