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

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

Issue 325663003: Remove scoped styles (retry) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix layout test (and expectation) Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/shadow/ShadowRoot.cpp ('k') | Source/core/html/HTMLStyleElement.cpp » ('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 * Copyright (C) 2003, 2010 Apple Inc. ALl rights reserved. 4 * Copyright (C) 2003, 2010 Apple Inc. ALl rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 24 matching lines...) Expand all
35 typedef EventSender<HTMLStyleElement> StyleEventSender; 35 typedef EventSender<HTMLStyleElement> StyleEventSender;
36 36
37 class HTMLStyleElement FINAL : public HTMLElement, private StyleElement { 37 class HTMLStyleElement FINAL : public HTMLElement, private StyleElement {
38 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLStyleElement); 38 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLStyleElement);
39 public: 39 public:
40 static PassRefPtrWillBeRawPtr<HTMLStyleElement> create(Document&, bool creat edByParser); 40 static PassRefPtrWillBeRawPtr<HTMLStyleElement> create(Document&, bool creat edByParser);
41 virtual ~HTMLStyleElement(); 41 virtual ~HTMLStyleElement();
42 42
43 void setType(const AtomicString&); 43 void setType(const AtomicString&);
44 44
45 bool scoped() const;
46 void setScoped(bool);
47 ContainerNode* scopingNode(); 45 ContainerNode* scopingNode();
48 bool isRegisteredAsScoped() const
49 {
50 // Note: We cannot rely on the 'scoped' attribute still being present wh en this method is invoked.
51 // Therefore we cannot rely on scoped()!
52 if (m_scopedStyleRegistrationState == NotRegistered)
53 return false;
54 return true;
55 }
56
57 bool isRegisteredInShadowRoot() const
58 {
59 return m_scopedStyleRegistrationState == RegisteredInShadowRoot;
60 }
61 46
62 using StyleElement::sheet; 47 using StyleElement::sheet;
63 48
64 bool disabled() const; 49 bool disabled() const;
65 void setDisabled(bool); 50 void setDisabled(bool);
66 51
67 void dispatchPendingEvent(StyleEventSender*); 52 void dispatchPendingEvent(StyleEventSender*);
68 static void dispatchPendingLoadEvents(); 53 static void dispatchPendingLoadEvents();
69 54
70 virtual void trace(Visitor*) OVERRIDE; 55 virtual void trace(Visitor*) OVERRIDE;
(...skipping 10 matching lines...) Expand all
81 66
82 virtual void finishParsingChildren() OVERRIDE; 67 virtual void finishParsingChildren() OVERRIDE;
83 68
84 virtual bool sheetLoaded() OVERRIDE { return StyleElement::sheetLoaded(docum ent()); } 69 virtual bool sheetLoaded() OVERRIDE { return StyleElement::sheetLoaded(docum ent()); }
85 virtual void notifyLoadedSheetAndAllCriticalSubresources(bool errorOccurred) OVERRIDE; 70 virtual void notifyLoadedSheetAndAllCriticalSubresources(bool errorOccurred) OVERRIDE;
86 virtual void startLoadingDynamicSheet() OVERRIDE { StyleElement::startLoadin gDynamicSheet(document()); } 71 virtual void startLoadingDynamicSheet() OVERRIDE { StyleElement::startLoadin gDynamicSheet(document()); }
87 72
88 virtual const AtomicString& media() const OVERRIDE; 73 virtual const AtomicString& media() const OVERRIDE;
89 virtual const AtomicString& type() const OVERRIDE; 74 virtual const AtomicString& type() const OVERRIDE;
90 75
91 void scopedAttributeChanged(bool);
92 void registerWithScopingNode(bool);
93 void unregisterWithScopingNode(ContainerNode*);
94
95 bool m_firedLoad; 76 bool m_firedLoad;
96 bool m_loadedSheet; 77 bool m_loadedSheet;
97
98 enum ScopedStyleRegistrationState {
99 NotRegistered,
100 RegisteredAsScoped,
101 RegisteredInShadowRoot
102 };
103 ScopedStyleRegistrationState m_scopedStyleRegistrationState;
104 }; 78 };
105 79
106 } //namespace 80 } //namespace
107 81
108 #endif 82 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/shadow/ShadowRoot.cpp ('k') | Source/core/html/HTMLStyleElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698