Extending Bidi Support on the Web Richard Ishida, W3C Aharon Lanin, - - PowerPoint PPT Presentation

extending bidi support on the web
SMART_READER_LITE
LIVE PREVIEW

Extending Bidi Support on the Web Richard Ishida, W3C Aharon Lanin, - - PowerPoint PPT Presentation

Extending Bidi Support on the Web Richard Ishida, W3C Aharon Lanin, Google Bidi support on the Web Additional Requirements for Bidi in HTML Read the Working Draft at http://www.w3.org/International/ docs/html-bidi-requirements/ You can follow


slide-1
SLIDE 1

Richard Ishida, W3C Aharon Lanin, Google

Extending Bidi Support on the Web

slide-2
SLIDE 2

Additional Requirements for Bidi in HTML

Bidi support on the Web

Read the Working Draft at http://www.w3.org/International/ docs/html-bidi-requirements/ You can follow all discussions on the public-i18n-bidi@w3.org list. It's about CSS too. And some suggestions for browser developers.

slide-3
SLIDE 3

Health warning!

Bidi support on the Web

This is a report on ONGOING discussions. You MUST NOT assume that these things work or will work in the future. 22 bugs were raised against HTML5 for Oct 1st, 2010 – these are currently under discussion. Additional proposals will be sent to CSS WG, and some are already being discussed and/or implemented. If you feel strongly about these features, track and join the discussion !

slide-4
SLIDE 4

Outline

Bidi support on the Web

1. 1. Some b

  • me back

ckgrou

  • und

2. 2. Fea eatu ture pr propos

  • posals

3. 3. How How to to tr track ck devel elopmen ents/ge get i involve ved

slide-5
SLIDE 5

Som Some bac backg kground

slide-6
SLIDE 6

Base direction

Background

< p> MAKE html WORK FOR YOU< /p>

LTR EKAM html UOY ROF KROW RTL UOY ROF KROW html EKAM

slide-7
SLIDE 7

Base direction

Background

< p> 10 Main st.< /p>

LTR 10 Main st. RTL .10 Main st

slide-8
SLIDE 8

UBA 'paragraphs'

Background

IT IS IMPORTANT TO LEARN html. (css IS IMPORTANT TOO.)

  • html. NRAEL OT TNATROPMI SI TI

(.OOT TNATROPMI SI (css .html NRAEL OT TNATROPMI SI TI (.OOT TNATROPMI SI css)

slide-9
SLIDE 9

New H HTML ML & & CSS CSS proposal sals

slide-10
SLIDE 10

Bidi isolation

slide-11
SLIDE 11

Issue

Bidi isolation

Inlin line elem element c content o

  • ft

ften n need eeds to b be e is isola lated – es espec pecia ially ly w when en data is is im impo ported in into t the e pa page ge.

✗ ✓

slide-12
SLIDE 12

Issue

Bidi isolation

Inlin line elem element c content o

  • ft

ften n need eeds to b be e is isola lated – es espec pecia ially ly w when en data is is im impo ported in into t the e pa page ge.

✗ ✓

slide-13
SLIDE 13

Note

Bidi isolation

Ex Exis istin ing bidi di mar arku kup i in HTML ML i is not not designed to to solv lve t this is pr proble lem.

< span dir= rtl>תיליל</span> - 3 reviews

תיליל-3 reviews

slide-14
SLIDE 14

Note

Bidi isolation

Ex Exis istin ing bidi di mar arku kup i in HTML ML i is not not designed to to solv lve t this is pr proble lem. LR LRM/RLM c can help, elp, b but it's n 's not as as good as as usi using markup kup.

< span dir= rtl>תיליל</span> - 3 reviews

תילילL

R M - 3 reviews

תיליל-3 reviews

Problems with LRM/RLM

  • RLM doesn't speak to the

structure of the document.

  • Adding logic to an

application to choose the LRM vs RLM can be difficult.

  • LRM/RLM is often not

ignored during search or may be picked up in error during copy&paste, causing failures.

  • LRM/RLM does nothing

about unbalanced LRE/RLE/LRO/ RLO/PDF in the inserted string

slide-15
SLIDE 15

Proposal

Bidi isolation

New a attrib ibute: e: ubi ubi = = of

  • ff

| on/

  • n/ubi

ubi New C CSS SS val value ue un unicode-bidi di: is isola late The e res esult lt is is an em embedded U UBA A 'p 'par aragraph' t ' that at i is s treated as as a a ne neutral c cha hara racter w withi thin the the surrou round nding ng t text.

< p> < span ubi>תיליל</span> - 3 reviews< /p>

slide-16
SLIDE 16

Reporting direction

slide-17
SLIDE 17

Issue

Reporting direction

Use sers c s can an sp specify dire rection for f

  • r form
  • rm i

inp nput, t, but it it is is im immed ediately forg rgotte tten. n.

slide-18
SLIDE 18

Proposal

Reporting direction

New a attrib ibute, e, subm submitdir, , on

  • n

in inpu put a and te texta tarea elem elements. Standard _dir ir s suffix ffix fo for control ntrol n name

< form action= foo method= get> < input type= text name= mytest dir= auto submitdir /> < /form> foo?mytest= texttextext&mytest_dir= ltr

slide-19
SLIDE 19

dir=auto value

slide-20
SLIDE 20

Issue

dir=auto value

Somet etim imes es t the appro ropri riate te d directi tion c

  • n can
  • nly

ly b be e det eter ermin ined a at run un-tim ime. e.

✗ ✓

slide-21
SLIDE 21

Issue

dir=auto value

Somet etim imes es t the appropriate e dire rection c can onl n only y be deter ermin ined ed a at r run-time me.

✗ ✓ ✗

slide-22
SLIDE 22

Proposal

dir=auto value

New val value ue 'aut 'auto' f ' for d dir at attribute. New a attrib ibute: e: autod

  • dirm

rmetho thod=f =firs rst-strong trong | | any-rtl tl

< html autodirmethod= first-strong> … < p> Your search - < span class= booktitle dir= auto> ה צ ה ר ו ת ק י ד ו ד ת ו ו י C S S < /span> - did not match any documents.< /p>

slide-23
SLIDE 23

Flipping images

slide-24
SLIDE 24

Issue

Flipping images

Ha Handed im image ges n need eed t to be e flipp flipped d durin ing lo localiz

  • ization. I

It is is tim ime- cons

  • nsuming a

and nd erro rror- pro rone to d to do thi

  • this u

using ng sepa eparate im image files files.

slide-25
SLIDE 25

Note

Flipping images

Fo For imag ages i s in <img mg> > mar arkup, y you u may ay be be abl able t to use use C CSS SS3 3 transform

  • rmati

tions

  • ns.

.myimage:rtl { transform:scaleX(-1); }

This doesn't work with images inserted using CSS.

slide-26
SLIDE 26

Proposal

Flipping images

New k keyw ywords f for

  • r CS

CSS3 3 Images ges for t things suc s such as as bac background- imag age an and list st-style le-im image ge.

background-image: url(mygraphic.png) rtlflip;

Option 1: rtlflip, eg.

background-image: url(mygraphic.png) ltr;

Option 2: rtl | ltr, eg.

slide-27
SLIDE 27

Line breaks in plain text

slide-28
SLIDE 28

Issues

Line breaks in plain text

Browsers rs d don't c t consiste tentl ntly y trea eat lin line e brea eaks a as a UBA A 'p 'par aragraph' ' br break i in pre an and texta tare rea elem elements, as well ell as script ipt d dia ialo log t tex ext. LINE INE S SEPARA RATOR R (U (U+20 2028 28) a ) and PARAG AGRAP APH H SE SEPA PARATOR (U (U+2029 29) ) cha haracters a are re not re not recognized by by br browsers. s.

✗ ✓ ✗

slide-29
SLIDE 29

Proposal

Line breaks in plain text

No Non-collapsed lin line e brea eaks s should ld always b s break p k parag agrap aphs f s for UBA BA. LINE INE S SEPARA RATOR ( R (U+20 2028 28) ) an and PA PARAGR GRAPH PH SE SEPA PARATOR (U (U+2029 29) ) char aracters sh s shoul uld be behav ave as as defin efined in in Unic icode.

slide-30
SLIDE 30

<br> as > as a a bidi idi se separ arator

  • r
slide-31
SLIDE 31

Issue

<br> as a bidi separator

HTM TML4 4 defin efines <br br> as as equi uiva valent to w to whi hite te-spa pace, b e, but mos

  • st of
  • f the

the ti time, a as used ed in in the e wild ild, , <br br> ne needs to to te term rminate a a UB UBA 'para ragra raph' h'. Brow rowsers d don'

  • n't d

do

  • that c

t consiste tentl ntly. y.

< p> IT IS IMPORTANT TO LEARN html.< br> (css IS IMPORTANT TOO.)< /p>

  • html. NRAEL OT TNATROPMI SI TI

(.OOT TNATROPMI SI (css .html NRAEL OT TNATROPMI SI TI (.OOT TNATROPMI SI css)

slide-32
SLIDE 32

Note

<br> as a bidi separator

Usi sing m mar arku kup pr properly ly is is the e bes est so solut ution, but but it may ay be e unrea ealis istic ic t to expect tha that to t to ha happen.

< body g_editable= "true" hidefocus= "true" class= "editable LW-yrriRe" id= ":6y" style= ""> IT IS IMPORTANT TO LEARN html.< br> (css IS IMPORTANT TOO.)< br> …

slide-33
SLIDE 33

Proposals

<br> as a bidi separator

Add a a new at attribut ute: bidibr break ak=har ard|so |soft. Valu lue is is in inher erit ited b by <br br> e > elements nts. The he default f for

  • r the

the root root element i is s 'h 'har ard'. '. Val alue ue 'so 'soft' c ' coul uld p provide control ntrol f for except eptio ions/lega legacy. .

< html bidibreak= soft lang= he>

.html NRAEL OT TNATROPMI SI TI (.OOT TNATROPMI SI css)

slide-34
SLIDE 34

Sc Scri ript d t dial alog

  • g te

text t dire recti tion

slide-35
SLIDE 35

Issue

Script dialog text direction

Brow rowsers a are re incons

  • nsiste

tent i nt in the dir irec ection t they ey a appl pply to dialo log t g text. Us Using Uni Unicode control ntrols c can be probl blemat atic.

✗ ✓

slide-36
SLIDE 36

Proposal

Script dialog text direction

Tex ext pa passed ed t to dia ialo log control ntrols w withou hout t ex expli plicit it d dir irec ection should ld b be e dis ispla played according to to the the first s t strong

  • ng

chara racte ter i r in each 'para ragra raph' h'.

slide-37
SLIDE 37

<title> should support the dir attribute

slide-38
SLIDE 38

Issue

<title> should support the dir attribute

Brow rowsers d don'

  • n't u

use dire rectional inf nformation f from rom the the p page to to display <ti <titl tle> te text c t corre

  • rrectly.

y.

< html dir= rtl> < head> < title> EGYPT ISRAEL deutschland france< /title> …

✗ ✓

slide-39
SLIDE 39

Proposal

<title> should support the dir attribute

The e HT HTML s L spec pecif ific ication s should ld sti tipulate tha that ti t titl tle te text b t be displayed i in n the the <ti <titl tle> element' nt's c compute ted d directi tion.

  • n.

< html dir= rtl> < head> < title> EGYPT ISRAEL deutschland france< /title> …

slide-40
SLIDE 40

title and alt attribute text direction

slide-41
SLIDE 41

Issue

title and alt attribute text direction

It sh shoul uld be be possi ssible t to have ave diffe ifferent b base d e dir irec ections fo for a an elem element's c content v vs. . it its alt lt or ti titl tle a attri ttributes.

✗ ✓

slide-42
SLIDE 42

Issue

title and alt attribute text direction

It sh shoul uld be be possi ssible t to have ave diffe ifferent b base d e dir irec ections fo for a an elem element's c content v vs. . it its alt lt or ti titl tle a attri ttributes.

slide-43
SLIDE 43

Proposal

title and alt attribute text direction

New a attrib ibute: e: titled edir ir=ltr| tr|rtl rtl|auto to. New a attrib ibute: e: altdir ir=ltr| tr|rtl rtl|auto to Spec to to sta tate te tha that a alt t and nd ti titl tle te text t

  • th
  • therwise ta

take on

  • n the

the base d dire rection of

  • f

the the c cont

  • ntext.
slide-44
SLIDE 44

<option> and text direction

slide-45
SLIDE 45

Issue

<option> and text direction

Mos Most b brow rowsers d don’

  • n’t ta

take i into a nto accou

  • unt a

a dir r attr ttribute on

  • n an

n <op <option> e

  • element. T

The he one

  • ne

that d does es d does esn’t a apply pply it it aft fter er t the e opt ption has as be been c chose sen. Als Also it it let lets the e <option>’s d dir ir affec ffect it its alignment, ra rathe ther tha than ta n taking the the alig lignment fr from t the e dir irec ection o

  • f

f the e <select> e t> element. nt.

< select> < option value= 1> deutschland< /option> < option value= 2> france< /option> < option value= 3 dir= rtl> TPYGE (egypt)< /option> < option value= 4 dir= rtl> LEARSI (israel)< /option> < /select>

✗ ✓ ✗ ✗

slide-46
SLIDE 46

Proposal

<option> and text direction

The he com

  • mputed d

dire rection of

  • f an

n <option> elem element will ill take in e into account a any ny dir r attri ttribute, a and nd it t will b ill be a e appli pplied to it its content both in in the e dropd pdown a and aft fter er b bein eing chos hosen.

slide-47
SLIDE 47

List item rendering

slide-48
SLIDE 48

Issue

List item rendering

Bul ullets an s and number erin ing a g are not d dis ispla played as ex expec pected, n nor consiste tent ntly y acros ross brow

  • wsers

rs.

✗ ✗

Default With text-align

slide-49
SLIDE 49

Proposal

List item rendering

Bul ullets an s and number erin ing g sh should al alway ays s fo foll llow t the e dire rection s set on t on the the < <ol

  • l> or
  • r

<ul ul> e > element. nt. By defa efault lt, li list text sh shoul uld be be align gned ed accord

  • rding

ng t to directi tion. n.

✗ ✓ ✗ ✓

Default With text-align

slide-50
SLIDE 50

Other topics…

slide-51
SLIDE 51

Other topics

  • Block elements as bidi separators
  • <input type=text> and <textarea>

should support interoperable ‘set direction’ functionality

  • A page’s overall vertical scrollbar

should be on the ‘end’ side relative to the user agent chrome direction

  • The vertical scrollbar of an element

below <body> should be on the ‘end’ side relative to the element’s direction

slide-52
SLIDE 52

How

  • w to

to trac track k develo elopmen ents/get get i involved ed

slide-53
SLIDE 53

Getting involved

Read the document: http://www.w3.org/International/docs/html-bidi-requirements/ Follow/contribute to the discussions: http://lists.w3.org/Archives/Public/public-i18n-bidi/ Track HTML5 bugs: http://www.w3.org/International/reviews/html5-bidi/