Closed
Bug 485377
Opened 15 years ago
Closed 14 years ago
Implement HTML5's <mark> tag
Categories
(Core :: DOM: Core & HTML, enhancement)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla2.0b1
People
(Reporter: ivan.enderlin, Assigned: Ms2ger)
References
(Blocks 1 open bug, )
Details
(Keywords: dev-doc-complete, html5)
Attachments
(2 files, 4 obsolete files)
9.15 KB,
patch
|
Details | Diff | Splinter Review | |
9.30 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) Gecko/2008101315 Ubuntu/8.10 (intrepid) Firefox/3.0.3 Build Identifier: The HTML 5 draft recommendation describes the <mark> element as follow: "The <mark> element represents a run of text in one document marked or highlighted for reference purposes, due to its relevance in another context. When used in a quotation or other block of text referred to from the prose, it indicates a highlight that was not originally present but which has been added to bring the reader's attention to a part of the text that might not have been considered important by the original author when the block was originally written, but which is now under previously unexpected scrutiny. When used in the main prose of a document, it indicates a part of the document that has been highlighted due to its likely relevance to the user's current activity.". More examples at <http://www.whatwg.org/specs/web-apps/current-work/#the-mark-element> The draft does not precise a default style. It is a semantic element, with generic HTML properties. Reproducible: Always
Reporter | ||
Comment 1•15 years ago
|
||
You shouldn't need the new nsHTMLMarkElement.cpp, and indeed it doesn't seem like you're actually using it. The change to nsHTMLTagList.h ensures that we instantiate an nsHTMLSpanElement, which seems to be exactly what we want.
Comment 3•15 years ago
|
||
Does the <mark> element need un-<span>-like exposure to accessibility APIs?
Reporter | ||
Comment 4•15 years ago
|
||
@Jonas: Yes, the nsHTMLTagList declaration asserts to use the nsHTMLSpanElement. Should it be suffisant to do that ? I have note that also the <abbr> element is recognized like a <span> (test: http://mozilla.hoa-project.net/Test/Abbr.html). @Henri: I think no. I have looked for in the HTML 5 specification and I didn't find anything that is on the subject, but I may be wrong :-).
Comment 5•15 years ago
|
||
Perhaps the "Find Again" command should cycle through <mark> elements when the user hasn't entered a search string into the "Find" bar.
Reporter | ||
Comment 6•15 years ago
|
||
Definitively. I am currently working on this feature.
Comment 7•14 years ago
|
||
(In reply to comment #0) > The draft does not precise a default style. Actually, it does. http://www.w3.org/TR/html5/the-xhtml-syntax.html#the-css-user-agent-style-sheet-and-presentational-hints
Comment 8•14 years ago
|
||
Not a parser bug, AFAICT.
Status: UNCONFIRMED → NEW
Component: HTML: Parser → DOM
Ever confirmed: true
QA Contact: parser → general
Would a patch for adding "mark { background: yellow; color: black; }" to html.css be better than not having any support at all, where the alternative is to implement everything (is there anything other than CSS and DOM changes to be done?) related to the "mark" element at a later date? It could be noted that similar actions has already been taken for several other HTML5 elements, in bug 559284.
Why go for a half-assed implementation. There is a patch that is almost finished. Why not finish and land that instead. Just remove the changes to nsGenericHTMLElement.h and remove the new nsHTMLMarkElement.* files. And add the html.css change in comment 9. Then add a reftest checking that the default rendering is ok and that |document.createElement("mark") instanceof HTMLElement| is true and |document.createElement("mark") instanceof HTMLUnknownElement| is false
Comment 11•14 years ago
|
||
Well, considering the patch is called "Patch 0.1: Early draft" and haven't been updated since early 2009, I assumed it was pretty "dead" and perhaps out of date. Still, the full implementation is of course what we want to do/have.
Comment 12•14 years ago
|
||
Oh, and to avoid misunderstandings, this is not me taking on the task to update the patch. If it was as easy as just uploading a new version of the file, I probably could, but those patch/building instructions look too advanced for me, and I don't have the time to learn how to do it properly right now.
Reporter | ||
Comment 13•14 years ago
|
||
The patch is not dead. I'm just waiting 2 days free to work on this patch… If it is too easy as Jonas said, I can make it in June maybe (I hope).
Assignee | ||
Comment 14•14 years ago
|
||
Updated to Jonas' comments. Ivan, I hope you don't mind. Note that |document.createElement("mark") instanceof HTMLUnknownElement| isn't false. Apparently, all HTML elements implement HTMLUnknownElement.
Attachment #446980 -
Flags: review?(jonas)
Comment on attachment 446980 [details] [diff] [review] Patch v2 Thanks!
Attachment #446980 -
Flags: review?(jonas) → review+
Assignee | ||
Comment 16•14 years ago
|
||
Turns out I needed to tell editor about it too... This change is covered by the following existing tests docshell/test/navigation/test_bug386782.html editor/composer/test/test_bug384147.html editor/libeditor/html/tests/browserscope/test_browserscope.html editor/libeditor/html/tests/test_bug478725.html editor/libeditor/html/tests/test_bug487524.html layout/generic/test/test_backspace_delete.xul
Attachment #447511 -
Flags: review?(timeless)
Comment 17•14 years ago
|
||
i have a feeling this is going to conflict with bug 562008.
Reporter | ||
Comment 18•14 years ago
|
||
@Ms2ger It's ok, I don't mind :-). I prefere to see this patch going further instead of resting in peace ;-).
Comment 19•14 years ago
|
||
hmm, Ms2ger, your patch makes <mark> be an HTMLSpanElement. I don't think we want <mark> to be an HTMLSpanElement (even if that makes <mark> using HTMLElement interface) ? IOW, document.createElement('mark').constructor should return HTMLElement, not HTMLSpanElement.
Reporter | ||
Comment 20•14 years ago
|
||
@Mounir: That's what I thought at the begining, but in Gecko, the majority of semantic elements are reconized as HTMLSpanElement.
Comment 21•14 years ago
|
||
(In reply to comment #20) > @Mounir: That's what I thought at the begining, but in Gecko, the majority of > semantic elements are reconized as HTMLSpanElement. Indeed. Anyway, this is going to be fixed with bug 562008. @Ms2ger: could you open a follow-up depending on bug 562008 and put me in CC ?
Assignee | ||
Comment 22•14 years ago
|
||
Merged to tip. r=jonas
Attachment #446980 -
Attachment is obsolete: true
Assignee | ||
Comment 23•14 years ago
|
||
timeless, could you review this patch as well? Thanks!
Attachment #447511 -
Attachment is obsolete: true
Attachment #452587 -
Flags: review?(timeless)
Attachment #447511 -
Flags: review?(timeless)
Attachment #452587 -
Flags: review?(timeless) → review+
Assignee | ||
Comment 24•14 years ago
|
||
This patch contains attachment 449613 [details] [diff] [review] (r=jonas) and attachment 452587 [details] [diff] [review] (r=timeless), as well as attachment 447778 [details] [diff] [review] from bug 568509 (r=jonas).
Attachment #449613 -
Attachment is obsolete: true
Attachment #452587 -
Attachment is obsolete: true
Assignee | ||
Updated•14 years ago
|
Keywords: checkin-needed
Updated•14 years ago
|
Assignee: nobody → Ms2ger
Status: NEW → ASSIGNED
Comment 25•14 years ago
|
||
Assuming this needs to be documented, so adding dev-doc-needed. http://hg.mozilla.org/mozilla-central/rev/b4149e2c4056
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed → dev-doc-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a6
Comment 26•14 years ago
|
||
Documented as: https://developer.mozilla.org/en/HTML/Element/mark (I'll update it once bug 568509 land). As I cannot change the keyword dev-doc-needed to dev-doc-complete, if somebody could do it, it would be nice.
Keywords: dev-doc-needed → dev-doc-complete
Assignee | ||
Updated•14 years ago
|
Flags: in-testsuite+
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•