Closed
Bug 300270
Opened 20 years ago
Closed 20 years ago
GetDir() always returns empty string
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla1.8beta4
People
(Reporter: smontagu, Assigned: smontagu)
References
()
Details
(Keywords: fixed1.8, regression)
Attachments
(1 file)
|
815 bytes,
patch
|
sicking
:
review+
jst
:
superreview+
asa
:
approval1.8b4+
|
Details | Diff | Splinter Review |
The testcase in the URL field should alert "foo.dir=rtl", and does so in 1.7.8.
In trunk it alerts "foo.dir=".
I believe this is regression from bug 236476.
| Assignee | ||
Comment 1•20 years ago
|
||
One-line fix
Attachment #188842 -
Flags: superreview?(jst)
Attachment #188842 -
Flags: review?(bugmail)
| Assignee | ||
Comment 2•20 years ago
|
||
This will break half the bidi-enabled web apps in the world (all those that use
the dir attribute on specific elements instead of document.dir or style).
Flags: blocking1.8b4?
Flags: blocking-aviary1.1?
Is there a reason not to let GetDir return 'somevalue' for markup like
<div dir='somevalue'>
?
If that is ok you can just replace the entire function with
return GetAttrHelper(nsHTMLAtoms::dir, aValue)
| Assignee | ||
Comment 4•20 years ago
|
||
The trouble with returning 'somevalue' is that typically applications will do
something like
if (foo.dir == 'ltr' ||
foo.dir == '') // no value set, default to ltr
// do ltr stuff
else
// do rtl stuff
so the 'somevalue' case will be treated as rtl. The smart thing to do is
if (foo.dir != 'rtl')
// do ltr stuff
else
// do rtl stuff
but I haven't seen that very often.
That's only a problem if the markup actually contains 'somevalue' though.
Reading the bug that regressed this it seems like IE does not return
'somevalue', though for the sake of consistency i'd think it'd be nice to do
that. Unless it's a problem on realworld sites of course.
Comment on attachment 188842 [details] [diff] [review]
Patch
r=me if you really do think that sites would break if we returned 'somevalue'.
But i'd prefer to do comment 3
Attachment #188842 -
Flags: review?(bugmail) → review+
Comment 7•20 years ago
|
||
This is gonna need to make b4 if it's gonna make 1.1 so the 1.1 nomination is
redundant.
Flags: blocking-aviary1.1?
Updated•20 years ago
|
Flags: blocking1.8b4? → blocking1.8b4+
Updated•20 years ago
|
Severity: normal → major
Keywords: regression
Whiteboard: [needs review jst]
Target Milestone: --- → mozilla1.8beta4
Updated•20 years ago
|
Flags: blocking1.8b5+
Comment 8•20 years ago
|
||
Comment on attachment 188842 [details] [diff] [review]
Patch
sr=jst
Attachment #188842 -
Flags: superreview?(jst) → superreview+
Comment 9•20 years ago
|
||
Can we get this checked in on trunk to bake, then nominated for the branch?
| Assignee | ||
Comment 10•20 years ago
|
||
Checked in to trunk.
Whiteboard: [needs review jst] → fixed on trunk
| Assignee | ||
Comment 11•20 years ago
|
||
Comment on attachment 188842 [details] [diff] [review]
Patch
See comment 2. This is a serious regression for bidi web apps.
Attachment #188842 -
Flags: approval1.8b4?
Updated•20 years ago
|
Attachment #188842 -
Flags: approval1.8b4? → approval1.8b4+
Comment 12•20 years ago
|
||
Checking in nsGenericHTMLElement.cpp;
/cvsroot/mozilla/content/html/content/src/nsGenericHTMLElement.cpp,v <--
nsGenericHTMLElement.cpp
new revision: 1.596.2.2; previous revision: 1.596.2.1
done
Status: NEW → RESOLVED
Closed: 20 years ago
Keywords: fixed1.8
Resolution: --- → FIXED
Whiteboard: fixed on trunk
Comment 13•18 years ago
|
||
I've now specced this in HTML5 to match IE:
http://www.whatwg.org/specs/web-apps/current-work/#dir
See the last paragraph (and follow the links therein).
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•