Changeset 195087 in webkit


Ignore:
Timestamp:
Jan 14, 2016 6:59:03 PM (8 years ago)
Author:
rniwa@webkit.org
Message:

Add document.defineCustomElement
https://bugs.webkit.org/show_bug.cgi?id=153092

Reviewed by Chris Dumez.

Source/WebCore:

Added document.defineCustomElement and added a constructor to HTMLElement which can be called
as "super" in a subclass of HTMLElement. This is a prototype of new custom elements API and
willfully violates the current specification at http://w3c.github.io/webcomponents/spec/custom/

Each author defined class can define multiple elements using distinct tag names. In such cases,
the super call must specify the tag name. e.g.

class SomeCustomElement extends HTMLElement { constructor(name) { super(name); } }
document.defineCustomElement('some-custom-element', SomeCustomElement);
document.defineCustomElement('other-custom-element', SomeCustomElement);
new SomeCustomElement('some-custom-element');

When a class is associated with exactly one tag name, the argument can be omitted. e.g.

class AnotherCustomElement extends HTMLElement {}
document.defineCustomElement('another-custom-element', AnotherCustomElement);
new AnotherCustomElement();

We allow only subclassing of HTMLElement and only in (X)HTML namespace.

Tests: fast/custom-elements/Document-defineCustomElement.html

fast/custom-elements/HTMLElement-constructor.html

  • CMakeLists.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSCustomElementInterface.cpp: Added. Abstracts an author-defined class associated

with a custom element. It's a Active DOM object and lives until the associated document dies.
(WebCore::JSCustomElementInterface::JSCustomElementInterface):
(WebCore::JSCustomElementInterface::~JSCustomElementInterface):

  • bindings/js/JSCustomElementInterface.h: Added.

(WebCore::JSCustomElementInterface::create):
(WebCore::JSCustomElementInterface::scriptExecutionContext):
(WebCore::JSCustomElementInterface::constructor):

  • bindings/js/JSDocumentCustom.cpp:

(WebCore::JSDocument::defineCustomElement): Added. Define a custom element by associating a tag
name with an author defined JS class after validating arguments.

  • bindings/js/JSHTMLElementCustom.cpp:

(WebCore::constructJSHTMLElement): Added. Look up the tag name based on new.target if one is not
specified. If a tag name is specified, check that new.target is associated with the tag name.

  • dom/CustomElementDefinitions.cpp: Added.

(WebCore::CustomElementDefinitions::checkName): Added. Restricts tag names similarly to
http://w3c.github.io/webcomponents/spec/custom/#dfn-custom-element-type
(WebCore::CustomElementDefinitions::defineElement): Added. Associates a JS class with a tag name.
(WebCore::CustomElementDefinitions::findInterface): Added. Finds a JS class by a tag name.
(WebCore::CustomElementDefinitions::findName): Added. Finds a tag name by a JS class.

  • dom/CustomElementDefinitions.h: Added.

(WebCore::CustomElementDefinitions::CustomElementInfo): Added.

  • dom/Document.cpp:

(WebCore::Document::ensureCustomElementDefinitions): Added.

  • dom/Document.h:

(WebCore::Document::customElementDefinitions): Added.

  • dom/Document.idl:
  • html/HTMLElement.idl:

LayoutTests:

Added tests for document.defineCustomElement and instantiating custom elements.

  • TestExpectations: Skipped the tests on non-Mac ports.
  • fast/custom-elements: Added.
  • fast/custom-elements/Document-defineCustomElement-expected.txt: Added.
  • fast/custom-elements/Document-defineCustomElement.html: Added.
  • fast/custom-elements/HTMLElement-constructor-expected.txt: Added.
  • fast/custom-elements/HTMLElement-constructor.html: Added.
  • platform/mac/TestExpectations:
Location:
trunk
Files:
9 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r195078 r195087  
     12016-01-14  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Add document.defineCustomElement
     4        https://bugs.webkit.org/show_bug.cgi?id=153092
     5
     6        Reviewed by Chris Dumez.
     7
     8        Added tests for document.defineCustomElement and instantiating custom elements.
     9
     10        * TestExpectations: Skipped the tests on non-Mac ports.
     11        * fast/custom-elements: Added.
     12        * fast/custom-elements/Document-defineCustomElement-expected.txt: Added.
     13        * fast/custom-elements/Document-defineCustomElement.html: Added.
     14        * fast/custom-elements/HTMLElement-constructor-expected.txt: Added.
     15        * fast/custom-elements/HTMLElement-constructor.html: Added.
     16        * platform/mac/TestExpectations:
     17
    1182016-01-14  Beth Dakin  <bdakin@apple.com>
    219
  • trunk/LayoutTests/TestExpectations

    r195010 r195087  
    741741webkit.org/b/148925 svg/dom/svg-root-lengths.html [ Pass Failure ]
    742742
     743webkit.org/b/150225 fast/custom-elements [ Failure ]
    743744webkit.org/b/148695 fast/shadow-dom [ Failure ImageOnlyFailure ]
    744745
  • trunk/LayoutTests/platform/mac/TestExpectations

    r195003 r195087  
    12591259webkit.org/b/149441 fast/shadow-dom/css-scoping-shadow-slot-display-override.html [ ImageOnlyFailure ]
    12601260
     1261webkit.org/b/150225 fast/custom-elements [ Pass ]
     1262
    12611263# Times out in debug.
    12621264[ Debug ] js/regress/getter-richards-try-catch.html [ Skip ]
  • trunk/Source/WebCore/CMakeLists.txt

    r194967 r195087  
    11151115    bindings/js/JSCryptoKeySerializationJWK.cpp
    11161116    bindings/js/JSCryptoOperationData.cpp
     1117    bindings/js/JSCustomElementInterface.cpp
    11171118    bindings/js/JSCustomEventCustom.cpp
    11181119    bindings/js/JSCustomSQLStatementErrorCallback.cpp
     
    14081409    dom/ContainerNodeAlgorithms.cpp
    14091410    dom/ContextDestructionObserver.cpp
     1411    dom/CustomElementDefinitions.cpp
    14101412    dom/CustomEvent.cpp
    14111413    dom/DOMCoreException.cpp
  • trunk/Source/WebCore/ChangeLog

    r195082 r195087  
     12016-01-14  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Add document.defineCustomElement
     4        https://bugs.webkit.org/show_bug.cgi?id=153092
     5
     6        Reviewed by Chris Dumez.
     7
     8        Added document.defineCustomElement and added a constructor to HTMLElement which can be called
     9        as "super" in a subclass of HTMLElement. This is a prototype of new custom elements API and
     10        willfully violates the current specification at http://w3c.github.io/webcomponents/spec/custom/
     11
     12        Each author defined class can define multiple elements using distinct tag names. In such cases,
     13        the super call must specify the tag name. e.g.
     14
     15        class SomeCustomElement extends HTMLElement { constructor(name) { super(name); } }
     16        document.defineCustomElement('some-custom-element', SomeCustomElement);
     17        document.defineCustomElement('other-custom-element', SomeCustomElement);
     18        new SomeCustomElement('some-custom-element');
     19
     20        When a class is associated with exactly one tag name, the argument can be omitted. e.g.
     21
     22        class AnotherCustomElement extends HTMLElement {}
     23        document.defineCustomElement('another-custom-element', AnotherCustomElement);
     24        new AnotherCustomElement();
     25
     26        We allow only subclassing of HTMLElement and only in (X)HTML namespace.
     27
     28        Tests: fast/custom-elements/Document-defineCustomElement.html
     29               fast/custom-elements/HTMLElement-constructor.html
     30
     31        * CMakeLists.txt:
     32        * WebCore.xcodeproj/project.pbxproj:
     33
     34        * bindings/js/JSCustomElementInterface.cpp: Added. Abstracts an author-defined class associated
     35        with a custom element. It's a Active DOM object and lives until the associated document dies.
     36        (WebCore::JSCustomElementInterface::JSCustomElementInterface):
     37        (WebCore::JSCustomElementInterface::~JSCustomElementInterface):
     38        * bindings/js/JSCustomElementInterface.h: Added.
     39        (WebCore::JSCustomElementInterface::create):
     40        (WebCore::JSCustomElementInterface::scriptExecutionContext):
     41        (WebCore::JSCustomElementInterface::constructor):
     42
     43        * bindings/js/JSDocumentCustom.cpp:
     44        (WebCore::JSDocument::defineCustomElement): Added. Define a custom element by associating a tag
     45        name with an author defined JS class after validating arguments.
     46
     47        * bindings/js/JSHTMLElementCustom.cpp:
     48        (WebCore::constructJSHTMLElement): Added. Look up the tag name based on new.target if one is not
     49        specified. If a tag name is specified, check that new.target is associated with the tag name.
     50
     51        * dom/CustomElementDefinitions.cpp: Added.
     52        (WebCore::CustomElementDefinitions::checkName): Added. Restricts tag names similarly to
     53        http://w3c.github.io/webcomponents/spec/custom/#dfn-custom-element-type
     54        (WebCore::CustomElementDefinitions::defineElement): Added. Associates a JS class with a tag name.
     55        (WebCore::CustomElementDefinitions::findInterface): Added. Finds a JS class by a tag name.
     56        (WebCore::CustomElementDefinitions::findName): Added. Finds a tag name by a JS class.
     57        * dom/CustomElementDefinitions.h: Added.
     58        (WebCore::CustomElementDefinitions::CustomElementInfo): Added.
     59
     60        * dom/Document.cpp:
     61        (WebCore::Document::ensureCustomElementDefinitions): Added.
     62        * dom/Document.h:
     63        (WebCore::Document::customElementDefinitions): Added.
     64
     65        * dom/Document.idl:
     66        * html/HTMLElement.idl:
     67
    1682016-01-14  Simon Fraser  <simon.fraser@apple.com>
    269
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r195005 r195087  
    39993999                9BD0BF9312A42BF50072FD43 /* ScopedEventQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BD0BF9112A42BF50072FD43 /* ScopedEventQueue.h */; };
    40004000                9BD0BF9412A42BF50072FD43 /* ScopedEventQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BD0BF9212A42BF50072FD43 /* ScopedEventQueue.cpp */; };
     4001                9BD4E9161C462872005065BC /* JSCustomElementInterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BD4E9141C462872005065BC /* JSCustomElementInterface.cpp */; };
     4002                9BD4E9171C462872005065BC /* JSCustomElementInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BD4E9151C462872005065BC /* JSCustomElementInterface.h */; };
     4003                9BD4E91A1C462CFC005065BC /* CustomElementDefinitions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BD4E9181C462CFC005065BC /* CustomElementDefinitions.cpp */; };
     4004                9BD4E91B1C462CFC005065BC /* CustomElementDefinitions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BD4E9191C462CFC005065BC /* CustomElementDefinitions.h */; };
    40014005                9BD8A95A18BEFC7600987E9A /* CollectionIndexCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BD8A95918BEFC7600987E9A /* CollectionIndexCache.cpp */; };
    40024006                9BDA64D71B975CE5009C4387 /* JSShadowRoot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B6BC9601B975966005AE1F0 /* JSShadowRoot.cpp */; };
     
    1157311577                9BD0BF9112A42BF50072FD43 /* ScopedEventQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScopedEventQueue.h; sourceTree = "<group>"; };
    1157411578                9BD0BF9212A42BF50072FD43 /* ScopedEventQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScopedEventQueue.cpp; sourceTree = "<group>"; };
     11579                9BD4E9141C462872005065BC /* JSCustomElementInterface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCustomElementInterface.cpp; sourceTree = "<group>"; };
     11580                9BD4E9151C462872005065BC /* JSCustomElementInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCustomElementInterface.h; sourceTree = "<group>"; };
     11581                9BD4E9181C462CFC005065BC /* CustomElementDefinitions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomElementDefinitions.cpp; sourceTree = "<group>"; };
     11582                9BD4E9191C462CFC005065BC /* CustomElementDefinitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomElementDefinitions.h; sourceTree = "<group>"; };
    1157511583                9BD8A95918BEFC7600987E9A /* CollectionIndexCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CollectionIndexCache.cpp; sourceTree = "<group>"; };
    1157611584                9BF9A87E1648DD2F001C6B23 /* JSHTMLFormControlsCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLFormControlsCollection.cpp; sourceTree = "<group>"; };
     
    2195721965                                C585A66011D4FAC5004C3E4B /* IDBBindingUtilities.cpp */,
    2195821966                                C585A66111D4FAC5004C3E4B /* IDBBindingUtilities.h */,
     21967                                9BD4E9141C462872005065BC /* JSCustomElementInterface.cpp */,
     21968                                9BD4E9151C462872005065BC /* JSCustomElementInterface.h */,
    2195921969                                E157A8EE18185425009F821D /* JSCryptoAlgorithmBuilder.cpp */,
    2196021970                                E157A8EF18185425009F821D /* JSCryptoAlgorithmBuilder.h */,
     
    2383123841                                97627B8B14FB3CEE002CDCA1 /* ContextDestructionObserver.cpp */,
    2383223842                                97627B8C14FB3CEE002CDCA1 /* ContextDestructionObserver.h */,
     23843                                9BD4E9181C462CFC005065BC /* CustomElementDefinitions.cpp */,
     23844                                9BD4E9191C462CFC005065BC /* CustomElementDefinitions.h */,
    2383323845                                62CD32561157E57C0063B0A7 /* CustomEvent.cpp */,
    2383423846                                62CD32571157E57C0063B0A7 /* CustomEvent.h */,
     
    2525225264                                85E7119C0AC5D5350053270F /* DOMHTMLAreaElementInternal.h in Headers */,
    2525325265                                859A9C470AA5E3BD00B694B2 /* DOMHTMLBaseElement.h in Headers */,
     25266                                9BD4E9171C462872005065BC /* JSCustomElementInterface.h in Headers */,
    2525425267                                85E7119D0AC5D5350053270F /* DOMHTMLBaseElementInternal.h in Headers */,
    2525525268                                85ECBEED0AA7626900544F0B /* DOMHTMLBaseFontElement.h in Headers */,
     
    2642726440                                B2FA3D710AB75A6F000E5AC4 /* JSSVGFECompositeElement.h in Headers */,
    2642826441                                19BFF64F11C0F2AC00B8C04D /* JSSVGFEConvolveMatrixElement.h in Headers */,
     26442                                9BD4E91B1C462CFC005065BC /* CustomElementDefinitions.h in Headers */,
    2642926443                                B2FA3D730AB75A6F000E5AC4 /* JSSVGFEDiffuseLightingElement.h in Headers */,
    2643026444                                B2FA3D750AB75A6F000E5AC4 /* JSSVGFEDisplacementMapElement.h in Headers */,
     
    3007730091                                B59DD6A611902A62007E9684 /* JSSQLStatementCallback.cpp in Sources */,
    3007830092                                B59DD6AA11902A71007E9684 /* JSSQLStatementErrorCallback.cpp in Sources */,
     30093                                9BD4E9161C462872005065BC /* JSCustomElementInterface.cpp in Sources */,
    3007930094                                514C76380CE9225E007EF3CD /* JSSQLTransaction.cpp in Sources */,
    3008030095                                B59DD69E11902A42007E9684 /* JSSQLTransactionCallback.cpp in Sources */,
     
    3080830823                                A8DF4AF00980C42C0052981B /* RenderTableRow.cpp in Sources */,
    3080930824                                A8DF4AED0980C42C0052981B /* RenderTableSection.cpp in Sources */,
     30825                                9BD4E91A1C462CFC005065BC /* CustomElementDefinitions.cpp in Sources */,
    3081030826                                BCEA488B097D93020094C9E4 /* RenderText.cpp in Sources */,
    3081130827                                AB67D1A8097F3AE300F9392E /* RenderTextControl.cpp in Sources */,
  • trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp

    r191887 r195087  
    2121#include "JSDocument.h"
    2222
     23#include "CustomElementDefinitions.h"
    2324#include "ExceptionCode.h"
    2425#include "Frame.h"
     
    131132#endif
    132133
     134#if ENABLE(CUSTOM_ELEMENTS)
     135JSValue JSDocument::defineCustomElement(ExecState& state)
     136{
     137    AtomicString tagName(state.argument(0).toString(&state)->toAtomicString(&state));
     138    if (UNLIKELY(state.hadException()))
     139        return jsUndefined();
     140
     141    JSObject* object = state.argument(1).getObject();
     142    ConstructData callData;
     143    if (!object || object->methodTable()->getConstructData(object, callData) == ConstructTypeNone)
     144        return throwTypeError(&state, "The second argument must be a constructor");
     145
     146    Document& document = wrapped();
     147    switch (CustomElementDefinitions::checkName(tagName)) {
     148    case CustomElementDefinitions::NameStatus::Valid:
     149        break;
     150    case CustomElementDefinitions::NameStatus::ConflictsWithBuiltinNames:
     151        return throwSyntaxError(&state, "Custom element name cannot be same as one of the builtin elements");
     152    case CustomElementDefinitions::NameStatus::NoHyphen:
     153        return throwSyntaxError(&state, "Custom element name must contain a hyphen");
     154    case CustomElementDefinitions::NameStatus::ContainsUpperCase:
     155        return throwSyntaxError(&state, "Custom element name cannot contain an upper case letter");
     156    }
     157
     158    QualifiedName name(nullAtom, tagName, HTMLNames::xhtmlNamespaceURI);
     159    auto& definitions = document.ensureCustomElementDefinitions();
     160    if (definitions.findInterface(tagName)) {
     161        ExceptionCodeWithMessage ec;
     162        ec.code = NOT_SUPPORTED_ERR;
     163        ec.message = "Cannot define multiple custom elements with the same tag name";
     164        setDOMException(&state, ec);
     165        return jsUndefined();
     166    }
     167    definitions.defineElement(name, JSCustomElementInterface::create(object, globalObject()));
     168    PrivateName uniquePrivateName;
     169    globalObject()->putDirect(globalObject()->vm(), uniquePrivateName, object);
     170
     171    return jsUndefined();
     172}
     173#endif
     174
    133175} // namespace WebCore
  • trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp

    r191887 r195087  
    2727#include "JSHTMLElement.h"
    2828
     29#include "CustomElementDefinitions.h"
    2930#include "Document.h"
    3031#include "HTMLFormElement.h"
     32#include <runtime/InternalFunction.h>
    3133#include <runtime/JSWithScope.h>
    3234
     
    3436
    3537using namespace JSC;
     38
     39#if ENABLE(CUSTOM_ELEMENTS)
     40EncodedJSValue JSC_HOST_CALL constructJSHTMLElement(ExecState* state)
     41{
     42    auto* jsConstructor = jsCast<DOMConstructorObject*>(state->callee());
     43
     44    auto* context = jsConstructor->scriptExecutionContext();
     45    if (!is<Document>(context))
     46        return throwConstructorDocumentUnavailableError(*state, "HTMLElement");
     47    auto& document = downcast<Document>(*context);
     48
     49    auto* definitions = document.customElementDefinitions();
     50    if (!definitions)
     51        return throwVMTypeError(state, "new.target is not a valid custom element constructor");
     52
     53    VM& vm = state->vm();
     54    JSValue newTargetValue = state->thisValue();
     55    JSObject* newTarget = newTargetValue.getObject();
     56    QualifiedName fullName = definitions->findName(newTarget);
     57    if (fullName == nullQName()) {
     58        if (UNLIKELY(state->argumentCount() < 1))
     59            return throwVMError(state, createNotEnoughArgumentsError(state));
     60    }
     61
     62    if (state->argumentCount()) {
     63        String name;
     64        if (!state->argument(0).getString(state, name))
     65            return throwVMTypeError(state, "The first argument is not a valid custom element name");
     66       
     67        auto* interface = definitions->findInterface(name);
     68        if (!interface)
     69            return throwVMTypeError(state, "The first argument is not a valid custom element name");
     70       
     71        if (newTarget != interface->constructor())
     72            return throwVMTypeError(state, "Attempt to construct a custom element with a wrong interface");
     73       
     74        fullName = QualifiedName(nullAtom, name, HTMLNames::xhtmlNamespaceURI);
     75    }
     76
     77    auto* globalObject = jsConstructor->globalObject();
     78    Structure* baseStructure = getDOMStructure<JSHTMLElement>(vm, *globalObject);
     79    auto* newElementStructure = InternalFunction::createSubclassStructure(state, newTargetValue, baseStructure);
     80    if (UNLIKELY(state->hadException()))
     81        return JSValue::encode(jsUndefined());
     82
     83    Ref<HTMLElement> element = HTMLElement::create(fullName, document);
     84    auto* jsElement = JSHTMLElement::create(newElementStructure, globalObject, element.get());
     85    cacheWrapper(globalObject->world(), element.ptr(), jsElement);
     86    return JSValue::encode(jsElement);
     87}
     88#endif
    3689
    3790JSScope* JSHTMLElement::pushEventHandlerScope(ExecState* exec, JSScope* scope) const
  • trunk/Source/WebCore/dom/Document.cpp

    r194819 r195087  
    4545#include "ContentSecurityPolicy.h"
    4646#include "CookieJar.h"
     47#include "CustomElementDefinitions.h"
    4748#include "CustomEvent.h"
    4849#include "DOMImplementation.h"
     
    63536354}
    63546355
     6356#if ENABLE(CUSTOM_ELEMENTS)
     6357CustomElementDefinitions& Document::ensureCustomElementDefinitions()
     6358{
     6359    if (!m_customElementDefinitions)
     6360        m_customElementDefinitions = std::make_unique<CustomElementDefinitions>();
     6361    return *m_customElementDefinitions;
     6362}
     6363#endif
     6364
    63556365LayoutRect Document::absoluteEventHandlerBounds(bool& includesFixedPositionElements)
    63566366{
  • trunk/Source/WebCore/dom/Document.h

    r194584 r195087  
    176176#endif
    177177
     178#if ENABLE(CUSTOM_ELEMENTS)
     179class CustomElementDefinitions;
     180#endif
     181
    178182#if ENABLE(DASHBOARD_SUPPORT)
    179183struct AnnotatedRegionValue;
     
    12151219    }
    12161220
     1221#if ENABLE(CUSTOM_ELEMENTS)
     1222    CustomElementDefinitions* customElementDefinitions() { return m_customElementDefinitions.get(); }
     1223    CustomElementDefinitions& ensureCustomElementDefinitions();
     1224#endif
     1225
    12171226    const EventTargetSet* wheelEventTargets() const { return m_wheelEventTargets.get(); }
    12181227
     
    17481757#endif
    17491758
     1759#if ENABLE(CUSTOM_ELEMENTS)
     1760    std::unique_ptr<CustomElementDefinitions> m_customElementDefinitions;
     1761#endif
     1762
    17501763    RefPtr<CSSFontSelector> m_fontSelector;
    17511764
  • trunk/Source/WebCore/dom/Document.idl

    r190199 r195087  
    282282#endif
    283283
     284#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
     285    [Custom, RaisesException, Conditional=CUSTOM_ELEMENTS]
     286    void defineCustomElement(DOMString tagName, CustomElementInterface elementInterface);
     287#endif
     288
    284289    // Page visibility API.
    285290    readonly attribute DOMString visibilityState;
  • trunk/Source/WebCore/html/HTMLElement.idl

    r190030 r195087  
    2020
    2121[
     22#if defined(ENABLE_CUSTOM_ELEMENTS) && ENABLE_CUSTOM_ELEMENTS
     23    CustomConstructor(optional DOMString localName),
     24#endif
    2225    JSGenerateToNativeObject,
    2326    JSCustomPushEventHandlerScope,
Note: See TracChangeset for help on using the changeset viewer.