Changeset 24491 in webkit


Ignore:
Timestamp:
Jul 20, 2007 3:42:18 PM (17 years ago)
Author:
beidson
Message:

LayoutTests:

Reviewed by Darin

<rdar://problem/5153021> and http://bugs.webkit.org/show_bug.cgi?id=13364

  • fast/frames/frame-base-url-expected.txt: Added.
  • fast/frames/frame-base-url.html: Added.
  • fast/frames/resources/subframe-base-url.html: Added.

WebCore:

Reviewed by Darin

<rdar://problem/5153021> and http://bugs.webkit.org/show_bug.cgi?id=13364

The issue here was that if a document in a subframe was loaded from a URL, but then a script did
document.open or document.write during parsing, we would overwrite the document's url and baseurl
with the parent frame's url. WRONG!

  • dom/Document.cpp: (WebCore::Document::open): Only set the url and baseURL in document.open if they are still empty or about:blank
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r24490 r24491  
     12007-07-20  Brady Eidson  <beidson@apple.com>
     2
     3        Reviewed by Darin
     4
     5        <rdar://problem/5153021> and http://bugs.webkit.org/show_bug.cgi?id=13364
     6
     7        * fast/frames/frame-base-url-expected.txt: Added.
     8        * fast/frames/frame-base-url.html: Added.
     9        * fast/frames/resources/subframe-base-url.html: Added.
     10
    1112007-07-20  Maciej Stachowiak  <mjs@apple.com>
    212
  • trunk/WebCore/ChangeLog

    r24490 r24491  
     12007-07-20  Brady Eidson  <beidson@apple.com>
     2
     3        Reviewed by Darin
     4
     5        <rdar://problem/5153021> and http://bugs.webkit.org/show_bug.cgi?id=13364
     6
     7        The issue here was that if a document in a subframe was loaded from a URL, but then a script did
     8        document.open or document.write during parsing, we would overwrite the document's url and baseurl
     9        with the parent frame's url.  WRONG!
     10
     11        * dom/Document.cpp:
     12        (WebCore::Document::open): Only set the url and baseURL in document.open if they are still empty or about:blank
     13
    1142007-07-20  Maciej Stachowiak  <mjs@apple.com>
    215
  • trunk/WebCore/dom/Document.cpp

    r24417 r24491  
    12591259    // happen when implicitOpen() is called unless we reorganize Frame code.
    12601260    if (Document *parent = parentDocument()) {
    1261         setURL(parent->baseURL());
    1262         setBaseURL(parent->baseURL());
     1261        if (m_url.isEmpty() || m_url == "about:blank")
     1262            setURL(parent->baseURL());
     1263        if (m_baseURL.isEmpty() || m_baseURL == "about:blank")
     1264            setBaseURL(parent->baseURL());
    12631265    }
    12641266
Note: See TracChangeset for help on using the changeset viewer.