diff options
Diffstat (limited to 'Source/WebCore/css/StyleSheetList.cpp')
-rw-r--r-- | Source/WebCore/css/StyleSheetList.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/Source/WebCore/css/StyleSheetList.cpp b/Source/WebCore/css/StyleSheetList.cpp index 103e641ac..e33d7a58a 100644 --- a/Source/WebCore/css/StyleSheetList.cpp +++ b/Source/WebCore/css/StyleSheetList.cpp @@ -23,9 +23,9 @@ #include "CSSStyleSheet.h" #include "Document.h" -#include "DocumentStyleSheetCollection.h" #include "HTMLNames.h" #include "HTMLStyleElement.h" +#include "StyleScope.h" #include <wtf/text/WTFString.h> namespace WebCore { @@ -45,13 +45,13 @@ inline const Vector<RefPtr<StyleSheet>>& StyleSheetList::styleSheets() const { if (!m_document) return m_detachedStyleSheets; - return m_document->styleSheetCollection().styleSheetsForStyleSheetList(); + return m_document->styleScope().styleSheetsForStyleSheetList(); } void StyleSheetList::detachFromDocument() { - m_detachedStyleSheets = m_document->styleSheetCollection().styleSheetsForStyleSheetList(); - m_document = 0; + m_detachedStyleSheets = m_document->styleScope().styleSheetsForStyleSheetList(); + m_document = nullptr; } unsigned StyleSheetList::length() const @@ -65,10 +65,10 @@ StyleSheet* StyleSheetList::item(unsigned index) return index < sheets.size() ? sheets[index].get() : 0; } -HTMLStyleElement* StyleSheetList::getNamedItem(const String& name) const +CSSStyleSheet* StyleSheetList::namedItem(const AtomicString& name) const { if (!m_document) - return 0; + return nullptr; // IE also supports retrieving a stylesheet by name, using the name/id of the <style> tag // (this is consistent with all the other collections) @@ -76,9 +76,15 @@ HTMLStyleElement* StyleSheetList::getNamedItem(const String& name) const // and doesn't look for name attribute. // But unicity of stylesheet ids is good practice anyway ;) Element* element = m_document->getElementById(name); - if (element && isHTMLStyleElement(element)) - return toHTMLStyleElement(element); - return 0; + if (is<HTMLStyleElement>(element)) + return downcast<HTMLStyleElement>(element)->sheet(); + return nullptr; +} + +Vector<AtomicString> StyleSheetList::supportedPropertyNames() +{ + // FIXME: Should be implemented. + return Vector<AtomicString>(); } } // namespace WebCore |