diff --git a/engine/core/BUILD.gn b/engine/core/BUILD.gn index 6225b1740bd..f3f4e370dc1 100644 --- a/engine/core/BUILD.gn +++ b/engine/core/BUILD.gn @@ -100,9 +100,6 @@ source_set("core_generated") { # Generated from BisonCSSParser-in.cpp "$sky_core_output_dir/BisonCSSParser.cpp", - # Generated from HTMLMetaElement-in.cpp - "$sky_core_output_dir/HTMLMetaElement.cpp", - # Additional .cpp files from the make_core_generated rules. "$sky_core_output_dir/CSSGrammar.cpp", ] @@ -190,7 +187,6 @@ group("make_core_generated") { ":make_core_generated_html_element_type_helpers", ":make_core_generated_make_parser", ":make_core_generated_make_token_matcher", - ":make_core_generated_make_token_matcher_for_viewport", ":make_core_generated_media_feature_names", ":make_core_generated_media_features", ":make_core_generated_media_query_tokenizer_codepoints", @@ -429,11 +425,6 @@ make_token_matcher("make_core_generated_make_parser") { output_file = "$sky_core_output_dir/BisonCSSParser.cpp" } -make_token_matcher("make_core_generated_make_token_matcher_for_viewport") { - input_file = "html/HTMLMetaElement-in.cpp" - output_file = "$sky_core_output_dir/HTMLMetaElement.cpp" -} - # One-off scripts -------------------------------------------------------------- action("make_core_generated_media_query_tokenizer_codepoints") { diff --git a/engine/core/core.gni b/engine/core/core.gni index 2531a7b15ac..81b03193a34 100644 --- a/engine/core/core.gni +++ b/engine/core/core.gni @@ -763,7 +763,6 @@ sky_core_files = [ "html/HTMLMediaElement.cpp", "html/HTMLMediaSource.cpp", "html/HTMLMediaSource.h", - "html/HTMLMetaElement.h", "html/HTMLPictureElement.cpp", "html/HTMLScriptElement.cpp", "html/HTMLScriptElement.h", @@ -1264,7 +1263,6 @@ core_idl_files = get_path_info([ "html/HTMLImageElement.idl", "html/HTMLImportElement.idl", "html/HTMLMediaElement.idl", - "html/HTMLMetaElement.idl", "html/HTMLPictureElement.idl", "html/HTMLScriptElement.idl", "html/HTMLShadowElement.idl", diff --git a/engine/core/dom/Document.cpp b/engine/core/dom/Document.cpp index ee47f3b7bb8..1974fcf070e 100644 --- a/engine/core/dom/Document.cpp +++ b/engine/core/dom/Document.cpp @@ -101,7 +101,6 @@ #include "core/html/HTMLAnchorElement.h" #include "core/html/HTMLCanvasElement.h" #include "core/html/HTMLDocument.h" -#include "core/html/HTMLMetaElement.h" #include "core/html/HTMLScriptElement.h" #include "core/html/HTMLStyleElement.h" #include "core/html/HTMLTemplateElement.h" diff --git a/engine/core/html/HTMLMetaElement-in.cpp b/engine/core/html/HTMLMetaElement-in.cpp deleted file mode 100644 index b4aff44f833..00000000000 --- a/engine/core/html/HTMLMetaElement-in.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 1999 Antti Koivisto (koivisto@kde.org) - * (C) 2001 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2010 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "config.h" -#include "core/html/HTMLMetaElement.h" - -#include "core/HTMLNames.h" -#include "core/dom/Document.h" -#include "core/dom/ElementTraversal.h" -#include "core/frame/LocalFrame.h" -#include "core/frame/Settings.h" -#include "core/inspector/ConsoleMessage.h" -#include "core/loader/FrameLoaderClient.h" -#include "platform/RuntimeEnabledFeatures.h" - -namespace blink { - -inline HTMLMetaElement::HTMLMetaElement(Document& document) - : HTMLElement(HTMLNames::metaTag, document) -{ - ScriptWrappable::init(this); -} - -DEFINE_NODE_FACTORY(HTMLMetaElement) - -void HTMLMetaElement::parseAttribute(const QualifiedName& name, const AtomicString& value) -{ - if (name == HTMLNames::http_equivAttr || name == HTMLNames::contentAttr) { - process(); - return; - } - - if (name != HTMLNames::nameAttr) - HTMLElement::parseAttribute(name, value); -} - -Node::InsertionNotificationRequest HTMLMetaElement::insertedInto(ContainerNode* insertionPoint) -{ - HTMLElement::insertedInto(insertionPoint); - return InsertionShouldCallDidNotifySubtreeInsertions; -} - -void HTMLMetaElement::didNotifySubtreeInsertionsToDocument() -{ - process(); -} - -void HTMLMetaElement::process() -{ - if (!inDocument()) - return; - - // All below situations require a content attribute (which can be the empty string). - const AtomicString& contentValue = getAttribute(HTMLNames::contentAttr); - if (contentValue.isNull()) - return; - - const AtomicString& nameValue = getAttribute(HTMLNames::nameAttr); - if (!nameValue.isEmpty() && equalIgnoringCase(nameValue, "referrer")) - document().processReferrerPolicy(contentValue); - - // Get the document to process the tag, but only if we're actually part of DOM - // tree (changing a meta tag while it's not in the tree shouldn't have any effect - // on the document). - - const AtomicString& httpEquivValue = getAttribute(HTMLNames::http_equivAttr); - if (!httpEquivValue.isEmpty()) - document().processHttpEquiv(httpEquivValue, contentValue, false); -} - -const AtomicString& HTMLMetaElement::content() const -{ - return getAttribute(HTMLNames::contentAttr); -} - -const AtomicString& HTMLMetaElement::httpEquiv() const -{ - return getAttribute(HTMLNames::http_equivAttr); -} - -const AtomicString& HTMLMetaElement::name() const -{ - return getAttribute(HTMLNames::nameAttr); -} - -} diff --git a/engine/core/html/HTMLMetaElement.h b/engine/core/html/HTMLMetaElement.h deleted file mode 100644 index b75ccabc25f..00000000000 --- a/engine/core/html/HTMLMetaElement.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2003, 2010 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef HTMLMetaElement_h -#define HTMLMetaElement_h - -#include "core/html/HTMLElement.h" - -namespace blink { - -class HTMLMetaElement final : public HTMLElement { - DEFINE_WRAPPERTYPEINFO(); -public: - DECLARE_NODE_FACTORY(HTMLMetaElement); - - const AtomicString& content() const; - const AtomicString& httpEquiv() const; - const AtomicString& name() const; - -private: - explicit HTMLMetaElement(Document&); - - virtual void parseAttribute(const QualifiedName&, const AtomicString&) override; - virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; - virtual void didNotifySubtreeInsertionsToDocument() override; - - void process(); -}; - -} // namespace blink - -#endif // HTMLMetaElement_h diff --git a/engine/core/html/HTMLMetaElement.idl b/engine/core/html/HTMLMetaElement.idl deleted file mode 100644 index 41d369e22ca..00000000000 --- a/engine/core/html/HTMLMetaElement.idl +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2006, 2010 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -interface HTMLMetaElement : HTMLElement { - [Reflect] attribute DOMString content; - [Reflect=http_equiv] attribute DOMString httpEquiv; - [Reflect] attribute DOMString name; - [Reflect] attribute DOMString scheme; -}; diff --git a/engine/core/html/HTMLTagNames.in b/engine/core/html/HTMLTagNames.in index 1879c94c0d4..e93fe703257 100644 --- a/engine/core/html/HTMLTagNames.in +++ b/engine/core/html/HTMLTagNames.in @@ -7,7 +7,6 @@ canvas content interfaceName=HTMLContentElement img interfaceName=HTMLImageElement, constructorNeedsCreatedByParser import -meta picture interfaceName=HTMLPictureElement script shadow interfaceName=HTMLShadowElement