Changeset 202559 in webkit
- Timestamp:
- Jun 28, 2016 4:49:21 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r202372 r202559 1 2016-06-28 Per Arne Vollan <pvollan@apple.com> 2 3 [Win] Custom elements tests are failing. 4 https://bugs.webkit.org/show_bug.cgi?id=159139 5 6 Reviewed by Alex Christensen. 7 8 Enable custom element API on Windows. 9 10 * Source/cmake/OptionsWin.cmake: 11 1 12 2016-06-23 Carlos Garcia Campos <cgarcia@igalia.com> 2 13 -
trunk/LayoutTests/ChangeLog
r202557 r202559 1 2016-06-28 Per Arne Vollan <pvollan@apple.com> 2 3 [Win] Custom elements tests are failing. 4 https://bugs.webkit.org/show_bug.cgi?id=159139 5 6 Reviewed by Alex Christensen. 7 8 Update test expectations for passing custom elements tests. 9 10 * platform/win/TestExpectations: 11 1 12 2016-06-28 Philippe Normand <pnormand@igalia.com> 2 13 -
trunk/LayoutTests/platform/win/TestExpectations
r202489 r202559 3319 3319 webkit.org/b/152411 http/tests/contentdispositionattachmentsandbox/referer-header-stripped.html [ Failure ] 3320 3320 3321 webkit.org/b/150225 fast/custom-elements [ Pass ] 3322 3321 3323 webkit.org/b/148695 fast/shadow-dom [ Pass ] 3322 3324 -
trunk/Source/WebCore/ChangeLog
r202558 r202559 1 2016-06-28 Per Arne Vollan <pvollan@apple.com> 2 3 [Win] Custom elements tests are failing. 4 https://bugs.webkit.org/show_bug.cgi?id=159139 5 6 Reviewed by Alex Christensen. 7 8 Fix compile errors after enabling custom element API. 9 10 * bindings/js/JSHTMLElementCustom.cpp: 11 (WebCore::constructJSHTMLElement): 12 * dom/CustomElementDefinitions.cpp: 13 (WebCore::CustomElementDefinitions::addElementDefinition): 14 * dom/Document.cpp: 15 (WebCore::createHTMLElementWithNameValidation): 16 (WebCore::createFallbackHTMLElement): 17 * dom/Element.cpp: 18 (WebCore::Element::attributeChanged): 19 * dom/LifecycleCallbackQueue.cpp: 20 (WebCore::LifecycleQueueItem::LifecycleQueueItem): 21 (WebCore::LifecycleCallbackQueue::enqueueElementUpgrade): 22 (WebCore::LifecycleCallbackQueue::enqueueAttributeChangedCallback): 23 * html/parser/HTMLConstructionSite.cpp: 24 (WebCore::HTMLConstructionSite::insertHTMLElementOrFindCustomElementInterface): 25 (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface): 26 * html/parser/HTMLDocumentParser.cpp: 27 (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): 28 * html/parser/HTMLTreeBuilder.cpp: 29 (WebCore::CustomElementConstructionData::CustomElementConstructionData): 30 (WebCore::HTMLTreeBuilder::insertGenericHTMLElement): 31 * html/parser/HTMLTreeBuilder.h: 32 1 33 2016-06-28 Philippe Normand <pnormand@igalia.com> 2 34 -
trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp
r200775 r202559 55 55 JSValue newTargetValue = state->thisValue(); 56 56 JSObject* newTarget = newTargetValue.getObject(); 57 auto* interface = definitions->findInterface(newTarget);58 if (! interface)57 auto* elementInterface = definitions->findInterface(newTarget); 58 if (!elementInterface) 59 59 return throwVMTypeError(state, "new.target does not define a custom element"); 60 60 61 if (! interface->isUpgradingElement()) {61 if (!elementInterface->isUpgradingElement()) { 62 62 auto* globalObject = jsConstructor->globalObject(); 63 63 Structure* baseStructure = getDOMStructure<JSHTMLElement>(vm, *globalObject); … … 66 66 return JSValue::encode(jsUndefined()); 67 67 68 Ref<HTMLElement> element = HTMLElement::create( interface->name(), document);68 Ref<HTMLElement> element = HTMLElement::create(elementInterface->name(), document); 69 69 element->setIsUnresolvedCustomElement(); 70 70 auto* jsElement = JSHTMLElement::create(newElementStructure, globalObject, element.get()); … … 73 73 } 74 74 75 Element* elementToUpgrade = interface->lastElementInConstructionStack();75 Element* elementToUpgrade = elementInterface->lastElementInConstructionStack(); 76 76 if (!elementToUpgrade) { 77 77 throwInvalidStateError(*state, "Cannot instantiate a custom element inside its own constrcutor during upgrades"); … … 91 91 return JSValue::encode(jsUndefined()); 92 92 93 interface->didUpgradeLastElementInConstructionStack();93 elementInterface->didUpgradeLastElementInConstructionStack(); 94 94 95 95 return JSValue::encode(elementWrapperValue); -
trunk/Source/WebCore/dom/CustomElementDefinitions.cpp
r201739 r202559 40 40 namespace WebCore { 41 41 42 void CustomElementDefinitions::addElementDefinition(Ref<JSCustomElementInterface>&& interface)42 void CustomElementDefinitions::addElementDefinition(Ref<JSCustomElementInterface>&& elementInterface) 43 43 { 44 AtomicString localName = interface->name().localName();44 AtomicString localName = elementInterface->name().localName(); 45 45 ASSERT(!m_nameMap.contains(localName)); 46 m_constructorMap.add( interface->constructor(), interface.ptr());47 m_nameMap.add(localName, interface.copyRef());46 m_constructorMap.add(elementInterface->constructor(), elementInterface.ptr()); 47 m_nameMap.add(localName, elementInterface.copyRef()); 48 48 49 49 auto candidateList = m_upgradeCandidatesMap.find(localName); … … 57 57 for (auto& candidate : list) { 58 58 ASSERT(candidate); 59 interface->upgradeElement(*candidate);59 elementInterface->upgradeElement(*candidate); 60 60 } 61 61 -
trunk/Source/WebCore/dom/Document.cpp
r202537 r202559 884 884 auto* definitions = document.customElementDefinitions(); 885 885 if (UNLIKELY(definitions)) { 886 if (auto* interface = definitions->findInterface(localName))887 return interface->constructElement(localName, JSCustomElementInterface::ShouldClearException::DoNotClear);886 if (auto* elementInterface = definitions->findInterface(localName)) 887 return elementInterface->constructElement(localName, JSCustomElementInterface::ShouldClearException::DoNotClear); 888 888 } 889 889 #endif … … 1075 1075 auto* definitions = document.customElementDefinitions(); 1076 1076 if (UNLIKELY(definitions)) { 1077 if (auto* interface = definitions->findInterface(name)) {1077 if (auto* elementInterface = definitions->findInterface(name)) { 1078 1078 Ref<HTMLElement> element = HTMLElement::create(name, document); 1079 1079 element->setIsUnresolvedCustomElement(); 1080 LifecycleCallbackQueue::enqueueElementUpgrade(element.get(), * interface);1080 LifecycleCallbackQueue::enqueueElementUpgrade(element.get(), *elementInterface); 1081 1081 return element; 1082 1082 } -
trunk/Source/WebCore/dom/Element.cpp
r202517 r202559 1281 1281 if (UNLIKELY(isCustomElement())) { 1282 1282 auto* definitions = document().customElementDefinitions(); 1283 auto* interface = definitions->findInterface(tagQName());1284 RELEASE_ASSERT( interface);1285 LifecycleCallbackQueue::enqueueAttributeChangedCallback(*this, * interface, name, oldValue, newValue);1283 auto* elementInterface = definitions->findInterface(tagQName()); 1284 RELEASE_ASSERT(elementInterface); 1285 LifecycleCallbackQueue::enqueueAttributeChangedCallback(*this, *elementInterface, name, oldValue, newValue); 1286 1286 } 1287 1287 #endif -
trunk/Source/WebCore/dom/LifecycleCallbackQueue.cpp
r197634 r202559 46 46 }; 47 47 48 LifecycleQueueItem(Type type, Element& element, JSCustomElementInterface& interface)48 LifecycleQueueItem(Type type, Element& element, JSCustomElementInterface& elementInterface) 49 49 : m_type(type) 50 50 , m_element(element) 51 , m_interface( interface)51 , m_interface(elementInterface) 52 52 { } 53 53 54 LifecycleQueueItem(Element& element, JSCustomElementInterface& interface, const QualifiedName& attributeName, const AtomicString& oldValue, const AtomicString& newValue)54 LifecycleQueueItem(Element& element, JSCustomElementInterface& elementInterface, const QualifiedName& attributeName, const AtomicString& oldValue, const AtomicString& newValue) 55 55 : m_type(Type::AttributeChanged) 56 56 , m_element(element) 57 , m_interface( interface)57 , m_interface(elementInterface) 58 58 , m_attributeName(attributeName) 59 59 , m_oldValue(oldValue) … … 91 91 } 92 92 93 void LifecycleCallbackQueue::enqueueElementUpgrade(Element& element, JSCustomElementInterface& interface)93 void LifecycleCallbackQueue::enqueueElementUpgrade(Element& element, JSCustomElementInterface& elementInterface) 94 94 { 95 95 if (auto* queue = CustomElementLifecycleProcessingStack::ensureCurrentQueue()) 96 queue->m_items.append(LifecycleQueueItem(LifecycleQueueItem::Type::ElementUpgrade, element, interface));96 queue->m_items.append(LifecycleQueueItem(LifecycleQueueItem::Type::ElementUpgrade, element, elementInterface)); 97 97 } 98 98 99 void LifecycleCallbackQueue::enqueueAttributeChangedCallback(Element& element, JSCustomElementInterface& interface,99 void LifecycleCallbackQueue::enqueueAttributeChangedCallback(Element& element, JSCustomElementInterface& elementInterface, 100 100 const QualifiedName& attributeName, const AtomicString& oldValue, const AtomicString& newValue) 101 101 { 102 102 if (auto* queue = CustomElementLifecycleProcessingStack::ensureCurrentQueue()) 103 queue->m_items.append(LifecycleQueueItem(element, interface, attributeName, oldValue, newValue));103 queue->m_items.append(LifecycleQueueItem(element, elementInterface, attributeName, oldValue, newValue)); 104 104 } 105 105 -
trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp
r201739 r202559 483 483 JSCustomElementInterface* HTMLConstructionSite::insertHTMLElementOrFindCustomElementInterface(AtomicHTMLToken& token) 484 484 { 485 JSCustomElementInterface* interface = nullptr;486 RefPtr<Element> element = createHTMLElementOrFindCustomElementInterface(token, & interface);487 if (UNLIKELY( interface))488 return interface;485 JSCustomElementInterface* elementInterface = nullptr; 486 RefPtr<Element> element = createHTMLElementOrFindCustomElementInterface(token, &elementInterface); 487 if (UNLIKELY(elementInterface)) 488 return elementInterface; 489 489 attachLater(currentNode(), *element); 490 490 m_openElements.push(HTMLStackItem::create(element.releaseNonNull(), token)); … … 662 662 auto* definitions = ownerDocument.customElementDefinitions(); 663 663 if (UNLIKELY(definitions)) { 664 if (auto* interface = definitions->findInterface(localName)) {665 *customElementInterface = interface;664 if (auto* elementInterface = definitions->findInterface(localName)) { 665 *customElementInterface = elementInterface; 666 666 return nullptr; 667 667 } -
trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp
r202242 r202559 195 195 ASSERT(!m_treeBuilder->hasParserBlockingScriptWork()); 196 196 197 RefPtr<Element> newElement = constructionData-> interface->constructElement(constructionData->name, JSCustomElementInterface::ShouldClearException::Clear);197 RefPtr<Element> newElement = constructionData->elementInterface->constructElement(constructionData->name, JSCustomElementInterface::ShouldClearException::Clear); 198 198 if (!newElement) { 199 199 ASSERT(!m_treeBuilder->isParsingTemplateContents()); -
trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp
r201205 r202559 56 56 #if ENABLE(CUSTOM_ELEMENTS) 57 57 58 CustomElementConstructionData::CustomElementConstructionData(Ref<JSCustomElementInterface>&& interface, const AtomicString& name, const Vector<Attribute>& attributes)59 : interface(WTFMove(interface))58 CustomElementConstructionData::CustomElementConstructionData(Ref<JSCustomElementInterface>&& customElementInterface, const AtomicString& name, const Vector<Attribute>& attributes) 59 : elementInterface(WTFMove(customElementInterface)) 60 60 , name(name) 61 61 , attributes(attributes) // FIXME: Avoid copying attributes. … … 910 910 { 911 911 #if ENABLE(CUSTOM_ELEMENTS) 912 auto* interface = m_tree.insertHTMLElementOrFindCustomElementInterface(token);913 if (UNLIKELY( interface))914 m_customElementToConstruct = std::make_unique<CustomElementConstructionData>(* interface, token.name(), token.attributes());912 auto* elementInterface = m_tree.insertHTMLElementOrFindCustomElementInterface(token); 913 if (UNLIKELY(elementInterface)) 914 m_customElementToConstruct = std::make_unique<CustomElementConstructionData>(*elementInterface, token.name(), token.attributes()); 915 915 #else 916 916 m_tree.insertHTMLElement(token); -
trunk/Source/WebCore/html/parser/HTMLTreeBuilder.h
r200075 r202559 43 43 ~CustomElementConstructionData(); 44 44 45 Ref<JSCustomElementInterface> interface;45 Ref<JSCustomElementInterface> elementInterface; 46 46 AtomicString name; 47 47 Vector<Attribute> attributes; -
trunk/Source/WebKit/win/ChangeLog
r202417 r202559 1 2016-06-28 Per Arne Vollan <pvollan@apple.com> 2 3 [Win] Custom elements tests are failing. 4 https://bugs.webkit.org/show_bug.cgi?id=159139 5 6 Reviewed by Alex Christensen. 7 8 Add preference for enabling custom element API. 9 10 * Interfaces/IWebPreferencesPrivate.idl: 11 * WebPreferenceKeysPrivate.h: 12 * WebPreferences.cpp: 13 (WebPreferences::initializeDefaultSettings): 14 (WebPreferences::customElementsEnabled): 15 (WebPreferences::setCustomElementsEnabled): 16 * WebPreferences.h: 17 * WebView.cpp: 18 (WebView::notifyPreferencesChanged): 19 1 20 2016-06-23 Per Arne Vollan <pvollan@apple.com> 2 21 -
trunk/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
r201817 r202559 180 180 HRESULT shadowDOMEnabled([out, retval] BOOL* enabled); 181 181 HRESULT setShadowDOMEnabled([in] BOOL enabled); 182 HRESULT customElementsEnabled([out, retval] BOOL* enabled); 183 HRESULT setCustomElementsEnabled([in] BOOL enabled); 182 184 } 183 185 -
trunk/Source/WebKit/win/WebPreferenceKeysPrivate.h
r201817 r202559 172 172 173 173 #define WebKitShadowDOMEnabledPreferenceKey "WebKitShadowDOMEnabled" 174 175 #define WebKitCustomElementsEnabledPreferenceKey "WebKitCustomElementsEnabled" -
trunk/Source/WebKit/win/WebPreferences.cpp
r201817 r202559 296 296 CFDictionaryAddValue(defaults, CFSTR(WebKitShadowDOMEnabledPreferenceKey), kCFBooleanFalse); 297 297 298 CFDictionaryAddValue(defaults, CFSTR(WebKitCustomElementsEnabledPreferenceKey), kCFBooleanFalse); 299 298 300 defaultSettings = defaults; 299 301 } … … 1950 1952 return S_OK; 1951 1953 } 1954 1955 HRESULT WebPreferences::customElementsEnabled(_Out_ BOOL* enabled) 1956 { 1957 if (!enabled) 1958 return E_POINTER; 1959 *enabled = boolValueForKey(WebKitCustomElementsEnabledPreferenceKey); 1960 return S_OK; 1961 } 1962 1963 HRESULT WebPreferences::setCustomElementsEnabled(BOOL enabled) 1964 { 1965 setBoolValue(WebKitCustomElementsEnabledPreferenceKey, enabled); 1966 return S_OK; 1967 } -
trunk/Source/WebKit/win/WebPreferences.h
r201817 r202559 238 238 virtual HRESULT STDMETHODCALLTYPE shadowDOMEnabled(_Out_ BOOL*); 239 239 virtual HRESULT STDMETHODCALLTYPE setShadowDOMEnabled(BOOL); 240 virtual HRESULT STDMETHODCALLTYPE customElementsEnabled(_Out_ BOOL*); 241 virtual HRESULT STDMETHODCALLTYPE setCustomElementsEnabled(BOOL); 240 242 241 243 // WebPreferences -
trunk/Source/WebKit/win/WebView.cpp
r202292 r202559 5053 5053 RuntimeEnabledFeatures::sharedFeatures().setShadowDOMEnabled(!!enabled); 5054 5054 5055 #if ENABLE(CUSTOM_ELEMENTS) 5056 hr = prefsPrivate->customElementsEnabled(&enabled); 5057 if (FAILED(hr)) 5058 return hr; 5059 RuntimeEnabledFeatures::sharedFeatures().setCustomElementsEnabled(!!enabled); 5060 #endif 5061 5055 5062 hr = preferences->privateBrowsingEnabled(&enabled); 5056 5063 if (FAILED(hr)) -
trunk/Source/cmake/OptionsWin.cmake
r202091 r202559 21 21 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_SHAPES PUBLIC ON) 22 22 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CURSOR_VISIBILITY PUBLIC ON) 23 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CUSTOM_ELEMENTS PRIVATE O FF)23 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CUSTOM_ELEMENTS PRIVATE ON) 24 24 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CUSTOM_SCHEME_HANDLER PUBLIC OFF) 25 25 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DATALIST_ELEMENT PUBLIC OFF) -
trunk/Tools/ChangeLog
r202543 r202559 1 2016-06-28 Per Arne Vollan <pvollan@apple.com> 2 3 [Win] Custom elements tests are failing. 4 https://bugs.webkit.org/show_bug.cgi?id=159139 5 6 Reviewed by Alex Christensen. 7 8 Enable custom element API when running tests. 9 10 * DumpRenderTree/win/DumpRenderTree.cpp: 11 (resetWebPreferencesToConsistentValues): 12 1 13 2016-06-27 Lucas Forschler <lforschler@apple.com> 2 14 -
trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp
r201817 r202559 852 852 prefsPrivate3->setFetchAPIEnabled(TRUE); 853 853 prefsPrivate3->setShadowDOMEnabled(TRUE); 854 prefsPrivate3->setCustomElementsEnabled(TRUE); 854 855 855 856 setAlwaysAcceptCookies(false);
Note: See TracChangeset
for help on using the changeset viewer.