summaryrefslogtreecommitdiff
path: root/Source/WebCore/css/StyleSheetList.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/css/StyleSheetList.cpp
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/css/StyleSheetList.cpp')
-rw-r--r--Source/WebCore/css/StyleSheetList.cpp24
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