HTMLStyleElement.cpp 688 B

12345678910111213141516171819202122232425262728
  1. #include <LibHTML/DOM/Document.h>
  2. #include <LibHTML/DOM/HTMLStyleElement.h>
  3. #include <LibHTML/Parser/CSSParser.h>
  4. HTMLStyleElement::HTMLStyleElement(Document& document, const String& tag_name)
  5. : HTMLElement(document, tag_name)
  6. {
  7. }
  8. HTMLStyleElement::~HTMLStyleElement()
  9. {
  10. }
  11. void HTMLStyleElement::inserted_into(Node& new_parent)
  12. {
  13. m_stylesheet = parse_css(text_content());
  14. if (m_stylesheet)
  15. document().add_sheet(*m_stylesheet);
  16. HTMLElement::inserted_into(new_parent);
  17. }
  18. void HTMLStyleElement::removed_from(Node& old_parent)
  19. {
  20. if (m_stylesheet) {
  21. // FIXME: Remove the sheet from the document
  22. }
  23. return HTMLElement::removed_from(old_parent);
  24. }