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 24240 - When setting <title>.text, allow reusing current child text node
Summary: When setting <title>.text, allow reusing current child text node
Status: RESOLVED INVALID
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: 2014-01-08 15:45 UTC by contributor
Modified: 2014-01-09 14:00 UTC (History)
3 users (show)

See Also:


Attachments
Dump mutations when setting <title>.text (947 bytes, text/html)
2014-01-08 15:51 UTC, David Vest
Details
Compare setting .text to .textContent for <title> (1.14 KB, text/html)
2014-01-09 11:29 UTC, David Vest
Details

Description contributor 2014-01-08 15:45:48 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html
Multipage: http://www.whatwg.org/C#the-title-element
Complete: http://www.whatwg.org/c#the-title-element
Referrer: 

Comment:
When setting <title>.text, allow reusing current child text node

Posted from: 83.218.67.123
User agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1736.3 Safari/537.36
Comment 1 David Vest 2014-01-08 15:51:21 UTC
Created attachment 1423 [details]
Dump mutations when setting <title>.text

Current spec says for setting <title>.text:

"Can be set, to replace the element's children with the given value."

Neither WebKit, Blink or Firefox seems to replace the child when setting a new value when the element's children consists of a single text node. In Blink/WebKit, the child text node is updated to the new value instead.

Ideally, this should be aligned with document.title, but at least Firefox seems to treat them differently w.r.t to mutation observers.
Comment 2 Ian 'Hixie' Hickson 2014-01-08 19:19:43 UTC
The text you quote above is non-normative.

The normative text already says what you want.
Comment 3 David Vest 2014-01-09 11:29:13 UTC
Created attachment 1425 [details]
Compare setting .text to .textContent for <title>

Yes, the normative text states:

"On setting, it must act the same way as the textContent IDL attribute."

which (through the DOM standard) brings us back to replace-all:

"Replace all with node within the context object."

Neither FF nor Blink/WebKit does this. See attached demo that compares .text to .textContent. Mainly wanted to point out the difference between the map and reality. :)
Comment 4 David Vest 2014-01-09 14:00:18 UTC
I'll try to get this fixed according to spec in Blink. Thanks.