This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 15707 - "When a document's document base URL changes" - removing a <base> doesn't immediately change the document base URL, since the algo that sets it doesn't run until a URL gets resolved.
Summary: "When a document's document base URL changes" - removing a <base> doesn't imm...
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-25 10:42 UTC by contributor
Modified: 2012-09-14 13:10 UTC (History)
4 users (show)

See Also:


Attachments

Description contributor 2012-01-25 10:42:21 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html
Multipage: http://www.whatwg.org/C#dynamic-changes-to-base-urls
Complete: http://www.whatwg.org/c#dynamic-changes-to-base-urls

Comment:
"When a document's document base URL changes" - removing a <base> doesn't
immediately change the document base URL, since the algo that sets it doesn't
run until a URL gets resolved.

Posted from: 85.227.157.105 by simonp@opera.com
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_5_8) AppleWebKit/535.16 (KHTML, like Gecko) Chrome/18.0.1003.1 Safari/535.16
Comment 1 contributor 2012-07-18 08:00:22 UTC
This bug was cloned to create bug 18006 as part of operation convergence.
Comment 2 Ian 'Hixie' Hickson 2012-08-10 03:09:11 UTC
The algorithm never gets explicitly run, the document base URL is just defined to be that. It just happens that that definition is in a step of another algorithm, but that doesn't have any normative effect.

Should I move the definition to its own subsection somewhere maybe? Would that be less confusing?
Comment 3 Simon Pieters 2012-08-15 07:46:41 UTC
If it's not intended to be run as part of the algorithm it is in, then it is extremely confusing to put it in the algorithm.

Right now, I see "When a document's document base URL changes, all elements in that document are affected by a base URL change." and the definition of "document base URL" is part of the resolve a URL algorithm, and I don't see anything else invoking the "document base URL" steps, so clearly the document base URL can't change until resolve a URL gets run.

If "document base URL" algorithm is supposed to run when a base element is inserted or removed or has its attributes changed (etc), then you should say so.
Comment 4 Ian 'Hixie' Hickson 2012-08-23 19:26:42 UTC
The algorithm isn't supposed to be triggered, it's just a definition. Just like in mathematics, if "a = b + c", you don't "cache" the value of "a" the first time you use it, it's just defined as being the sum of b and c. Whenever b or c changes, a changes. If you need to do something when a changes, then you need to do it whenever b or c change (unless they simultaneously change by the same amount in opposite directions so as to make the sum stay the same).

Still, I can definitely move the definition out of the parent algorithm to make this clearer.
Comment 5 Ian 'Hixie' Hickson 2012-08-24 18:51:54 UTC
Is this better?
Comment 6 Silvia Pfeiffer 2012-09-14 13:10:01 UTC
I assume you were referring to http://html5.org/tools/web-apps-tracker?from=7265&to=7266