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

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

Issue 23886003: Have HTMLElements / SVGElements constructors take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Another Android build fix Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLStyleElement.h ('k') | Source/core/html/HTMLSummaryElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, (eventNames().l oadEvent)); 43 DEFINE_STATIC_LOCAL(StyleEventSender, sharedLoadEventSender, (eventNames().l oadEvent));
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(const QualifiedName& tagName, Document & document, bool createdByParser)
48 : HTMLElement(tagName, document) 48 : HTMLElement(tagName, 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)); 54 ASSERT(hasTagName(styleTag));
55 ScriptWrappable::init(this); 55 ScriptWrappable::init(this);
56 } 56 }
57 57
58 HTMLStyleElement::~HTMLStyleElement() 58 HTMLStyleElement::~HTMLStyleElement()
59 { 59 {
60 // During tear-down, willRemove isn't called, so m_scopedStyleRegistrationSt ate may still be RegisteredAsScoped or RegisteredInShadowRoot here. 60 // 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 ). 61 // Therefore we can't ASSERT(m_scopedStyleRegistrationState == NotRegistered ).
62 StyleElement::clearDocumentData(document(), this); 62 StyleElement::clearDocumentData(document(), this);
63 63
64 styleLoadEventSender().cancelEvent(this); 64 styleLoadEventSender().cancelEvent(this);
65 } 65 }
66 66
67 PassRefPtr<HTMLStyleElement> HTMLStyleElement::create(const QualifiedName& tagNa me, Document* document, bool createdByParser) 67 PassRefPtr<HTMLStyleElement> HTMLStyleElement::create(const QualifiedName& tagNa me, Document& document, bool createdByParser)
68 { 68 {
69 return adoptRef(new HTMLStyleElement(tagName, document, createdByParser)); 69 return adoptRef(new HTMLStyleElement(tagName, document, createdByParser));
70 } 70 }
71 71
72 void HTMLStyleElement::parseAttribute(const QualifiedName& name, const AtomicStr ing& value) 72 void HTMLStyleElement::parseAttribute(const QualifiedName& name, const AtomicStr ing& value)
73 { 73 {
74 if (name == titleAttr && m_sheet) { 74 if (name == titleAttr && m_sheet) {
75 m_sheet->setTitle(value); 75 m_sheet->setTitle(value);
76 } else if (name == scopedAttr && ContextFeatures::styleScopedEnabled(&docume nt())) { 76 } else if (name == scopedAttr && ContextFeatures::styleScopedEnabled(&docume nt())) {
77 scopedAttributeChanged(!value.isNull()); 77 scopedAttributeChanged(!value.isNull());
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 return m_sheet->disabled(); 286 return m_sheet->disabled();
287 } 287 }
288 288
289 void HTMLStyleElement::setDisabled(bool setDisabled) 289 void HTMLStyleElement::setDisabled(bool setDisabled)
290 { 290 {
291 if (CSSStyleSheet* styleSheet = sheet()) 291 if (CSSStyleSheet* styleSheet = sheet())
292 styleSheet->setDisabled(setDisabled); 292 styleSheet->setDisabled(setDisabled);
293 } 293 }
294 294
295 } 295 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLStyleElement.h ('k') | Source/core/html/HTMLSummaryElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698