| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. |
| 3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "core/dom/DocumentType.h" | 35 #include "core/dom/DocumentType.h" |
| 36 #include "core/dom/Element.h" | 36 #include "core/dom/Element.h" |
| 37 #include "core/dom/ElementTraversal.h" | 37 #include "core/dom/ElementTraversal.h" |
| 38 #include "core/dom/IgnoreDestructiveWriteCountIncrementer.h" | 38 #include "core/dom/IgnoreDestructiveWriteCountIncrementer.h" |
| 39 #include "core/dom/ScriptLoader.h" | 39 #include "core/dom/ScriptLoader.h" |
| 40 #include "core/dom/TemplateContentDocumentFragment.h" | 40 #include "core/dom/TemplateContentDocumentFragment.h" |
| 41 #include "core/dom/Text.h" | 41 #include "core/dom/Text.h" |
| 42 #include "core/dom/custom/CEReactionsScope.h" | 42 #include "core/dom/custom/CEReactionsScope.h" |
| 43 #include "core/dom/custom/CustomElementDefinition.h" | 43 #include "core/dom/custom/CustomElementDefinition.h" |
| 44 #include "core/dom/custom/CustomElementDescriptor.h" | 44 #include "core/dom/custom/CustomElementDescriptor.h" |
| 45 #include "core/dom/custom/CustomElementsRegistry.h" | 45 #include "core/dom/custom/CustomElementRegistry.h" |
| 46 #include "core/frame/LocalDOMWindow.h" | 46 #include "core/frame/LocalDOMWindow.h" |
| 47 #include "core/frame/LocalFrame.h" | 47 #include "core/frame/LocalFrame.h" |
| 48 #include "core/html/HTMLFormElement.h" | 48 #include "core/html/HTMLFormElement.h" |
| 49 #include "core/html/HTMLHtmlElement.h" | 49 #include "core/html/HTMLHtmlElement.h" |
| 50 #include "core/html/HTMLPlugInElement.h" | 50 #include "core/html/HTMLPlugInElement.h" |
| 51 #include "core/html/HTMLScriptElement.h" | 51 #include "core/html/HTMLScriptElement.h" |
| 52 #include "core/html/HTMLTemplateElement.h" | 52 #include "core/html/HTMLTemplateElement.h" |
| 53 #include "core/html/parser/AtomicHTMLToken.h" | 53 #include "core/html/parser/AtomicHTMLToken.h" |
| 54 #include "core/html/parser/HTMLParserIdioms.h" | 54 #include "core/html/parser/HTMLParserIdioms.h" |
| 55 #include "core/html/parser/HTMLParserReentryPermit.h" | 55 #include "core/html/parser/HTMLParserReentryPermit.h" |
| (...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 // "look up a custom element definition" for a token | 760 // "look up a custom element definition" for a token |
| 761 // https://html.spec.whatwg.org/#look-up-a-custom-element-definition | 761 // https://html.spec.whatwg.org/#look-up-a-custom-element-definition |
| 762 CustomElementDefinition* HTMLConstructionSite::lookUpCustomElementDefinition(Doc
ument& document, AtomicHTMLToken* token) | 762 CustomElementDefinition* HTMLConstructionSite::lookUpCustomElementDefinition(Doc
ument& document, AtomicHTMLToken* token) |
| 763 { | 763 { |
| 764 // "2. If document does not have a browsing context, return null." | 764 // "2. If document does not have a browsing context, return null." |
| 765 LocalDOMWindow* window = document.domWindow(); | 765 LocalDOMWindow* window = document.domWindow(); |
| 766 if (!window) | 766 if (!window) |
| 767 return nullptr; | 767 return nullptr; |
| 768 | 768 |
| 769 // "3. Let registry be document's browsing context's Window's | 769 // "3. Let registry be document's browsing context's Window's |
| 770 // CustomElementsRegistry object." | 770 // CustomElementRegistry object." |
| 771 CustomElementsRegistry* registry = window->maybeCustomElements(); | 771 CustomElementRegistry* registry = window->maybeCustomElements(); |
| 772 if (!registry) | 772 if (!registry) |
| 773 return nullptr; | 773 return nullptr; |
| 774 | 774 |
| 775 const AtomicString& localName = token->name(); | 775 const AtomicString& localName = token->name(); |
| 776 const Attribute* isAttribute = token->getAttributeItem(HTMLNames::isAttr); | 776 const Attribute* isAttribute = token->getAttributeItem(HTMLNames::isAttr); |
| 777 const AtomicString& name = isAttribute ? isAttribute->value() : localName; | 777 const AtomicString& name = isAttribute ? isAttribute->value() : localName; |
| 778 CustomElementDescriptor descriptor(name, localName); | 778 CustomElementDescriptor descriptor(name, localName); |
| 779 | 779 |
| 780 // 4.-6. | 780 // 4.-6. |
| 781 return registry->definitionFor(descriptor); | 781 return registry->definitionFor(descriptor); |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 queueTask(task); | 979 queueTask(task); |
| 980 } | 980 } |
| 981 | 981 |
| 982 DEFINE_TRACE(HTMLConstructionSite::PendingText) | 982 DEFINE_TRACE(HTMLConstructionSite::PendingText) |
| 983 { | 983 { |
| 984 visitor->trace(parent); | 984 visitor->trace(parent); |
| 985 visitor->trace(nextChild); | 985 visitor->trace(nextChild); |
| 986 } | 986 } |
| 987 | 987 |
| 988 } // namespace blink | 988 } // namespace blink |
| OLD | NEW |