Skip to content
  • arv@chromium.org's avatar
    HTMLBaseElement href attribute binding returns wrong URL · e43e4168
    arv@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=98184
    
    Reviewed by Ojan Vafai.
    
    Resolve the href attribute binding relative to the document URL instead of resolving it to the
    base element itself. If there is no href attribute this should return the fallback base URL.
    
    http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-base-element
    
    Source/WebCore:
    
    Tests: fast/dom/HTMLAnchorElement/set-href-attribute-rebase.html
           fast/dom/HTMLBaseElement/href-attribute-resolves-with-respect-to-document.html
    
    * html/HTMLBaseElement.cpp:
    (WebCore::HTMLBaseElement::href): Don't use completeURL. Resolve href based on document's URL instead
    of the generic [Reflect, URL] binding.
    (WebCore::HTMLBaseElement::setHref): Just sets the attribute.
    * html/HTMLBaseElement.h:
    * html/HTMLBaseElement.idl: We can no longer use [Reflect, URL]
    
    LayoutTests:
    
    * fast/dom/HTMLAnchorElement/set-href-attribute-rebase-expected.txt: Added.
    * fast/dom/HTMLAnchorElement/set-href-attribute-rebase.html: Added.
    * fast/dom/HTMLBaseElement/href-attribute-resolves-with-respect-to-document-expected.txt: Added.
    * fast/dom/HTMLBaseElement/href-attribute-resolves-with-respect-to-document.html: Added.
    * fast/dom/element-attribute-js-null-expected.txt:
    * fast/dom/element-attribute-js-null.html:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132071 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    e43e4168