Bug 50913 - [BiDi] Add support for the BDI element
: [BiDi] Add support for the BDI element
: WebKit
: 528+ (Nightly build)
: All Mac OS X 10.5
: P2 Normal
Assigned To:
: http://dev.w3.org/html5/spec/Overview...
: 50912 68773
: 50910
  Show dependency treegraph
Reported: 2010-12-13 03:58 PST by
Modified: 2011-09-25 01:30 PST (History)

Patch (40.18 KB, patch)
2011-09-08 13:45 PST, Eric Seidel
rniwa: review+
webkit.review.bot: commit‑queue-
Review Patch | Details | Formatted Diff | Diff


You need to log in before you can comment on or make changes to this bug.

Description From 2010-12-13 03:58:18 PST
Quoth the HTML5 spec (at the time of this writing):

Expose unicode-bidi:isolate in HTML by adding an element attribute tentatively named ubi, for "Unicode Bidi Isolate", as in <span dir="rtl" ubi>. Like unicode-bidi:isolate, it would be used to directionally isolate an inline-display element from its surroundings: neither affects the bidi ordering of the other, and no part of the surrounding content gets ordered between parts of the element's content.
------- Comment #1 From 2010-12-13 04:34:45 PST -------
Quoting the proper spec this time:

The bdi element represents a span of text that is to be isolated from its surroundings for the purposes of bidirectional text formatting. [BIDI]

The dir global attribute defaults to auto on this element (it never inherits from the parent element like with other elements).

For the purposes of applying the bidirectional algorithm to the contents of a bdi element, user agents must treat the element as a paragraph-level container.

For the purposes of applying the bidirectional algorithm to the paragraph-level container that a bdi element finds itself within, the bdi element must be treated like a U+FFFC OBJECT REPLACEMENT CHARACTER (in the same manner that an image or other inline object is handled).

The requirements on handling the bdi element for the bidirectional algorithm may be implemented indirectly through the style layer. For example, an HTML+CSS user agent should implement these requirements by implementing the CSS 'unicode-bidi' property. [CSS]

This element is especially useful when embedding user-generated content with an unknown directionality.

In this example, usernames are shown along with the number of posts that the user has submitted. If the bdi element were not used, the username of the Arabic user would end up confusing the text (the bidirectional algorithm would put the colon and the number "3" next to the word "User" rather than next to the word "posts").

 <li>User <bdi>jcranmer</bdi>: 12 posts.
 <li>User <bdi>hober</bdi>: 5 posts.
 <li>User <bdi>إيان</bdi>: 3 posts.
------- Comment #2 From 2011-03-03 22:01:06 PST -------
Does this element act like span + unicode-bidi: isolate?  If so, we should fix 50912 first.
------- Comment #3 From 2011-03-10 04:06:07 PST -------
(In reply to comment #2)
> Does this element act like span + unicode-bidi: isolate?  If so, we should fix 50912 first.

That is correct, this depends on 50912.
------- Comment #4 From 2011-09-08 13:45:46 PST -------
Created an attachment (id=106782) [details]
------- Comment #5 From 2011-09-08 13:46:35 PST -------
This is what we call a "victory lap" patch. :)
------- Comment #6 From 2011-09-08 15:20:18 PST -------
(From update of attachment 106782 [details])
Rejecting attachment 106782 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:

Regressions: Unexpected image and text mismatch : (2)
  css3/bdi-element.html = IMAGE+TEXT
  svg/custom/svg-fonts-word-spacing.html = IMAGE+TEXT

Regressions: Unexpected image mismatch : (5)
  fast/text/atsui-multiple-renderers.html = IMAGE
  fast/text/international/danda-space.html = IMAGE
  fast/text/international/thai-baht-space.html = IMAGE
  fast/text/international/thai-line-breaks.html = IMAGE
  platform/chromium-linux/fast/text/international/complex-joining-using-gpos.html = IMAGE

Full output: http://queues.webkit.org/results/9624310
------- Comment #7 From 2011-09-08 17:34:01 PST -------
Committed r94822: <http://trac.webkit.org/changeset/94822>
------- Comment #8 From 2011-09-08 17:34:07 PST -------
There is no way for me to get cr-linux results now that the ewses don't post results anymore.  Just landing, the gardener will rebaseline.