Closed Bug 413542 Opened 17 years ago Closed 17 years ago

percentage margins on inline elements are ignored in bidi pages

Categories

(Core :: Layout: Text and Fonts, defect, P2)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: fassino, Assigned: smontagu)

Details

(Keywords: regression, testcase)

Attachments

(3 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b3pre) Gecko/2008012104 Minefield/3.0b3pre
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b3pre) Gecko/2008012104 Minefield/3.0b3pre

The presence of certain characters in the source of an utf-8 html file (even if simply inside comments, or in scripts string variables) causes the disappearing of % margins on inline elements. The characters triggering the problem seem to be most Hebrew and Arabic ones (maybe the ones belonging to rtl languages?)

Reproducible: Always
Attached file minimal test case
A wrapper contains two spans with 20% horizontal margins. An html comment contains the alef (א) character. As a result the margin between the two spans is not rendered.  Removing the alef from the comment solves the problem.
Status: UNCONFIRMED → NEW
Ever confirmed: true
A somewhat similar problem occurs even in absence of any triggering character, if dir=rtl is declared on the wrapper. I've no idea if the two problems are really related.
There's a bunch of bidi-related stuff that we optimize away if there's nothing bidi-related in the document.  Presumably either of those things trigger the "this document has bidi" flag, which is all that's needed to trigger the bug.
When there is a percentage margin, the calls to GetMargin() in nsBidiPresUtils::RepositionFrame() and RepositionInlineFrames() return an empty margin. Maybe we should be using GetUsedMargin() instead?
This is a regression since 1.8
Flags: blocking1.9?
Keywords: regression, testcase
Attached patch Patch (obsolete) — Splinter Review
Assignee: nobody → smontagu
Status: NEW → ASSIGNED
Attachment #298694 - Flags: superreview?(dbaron)
Attachment #298694 - Flags: review?(dbaron)
Flags: blocking1.9? → blocking1.9+
Priority: -- → P2
Component: Layout: Block and Inline → Layout: BiDi Hebrew & Arabic
OS: Windows XP → All
Hardware: PC → All
Summary: percentage margins on inline elements are ignored in presence of certain characters in the source → percentage margins on inline elements are ignored in bidi pages
Attachment #298694 - Flags: superreview?(dbaron)
Attachment #298694 - Flags: superreview+
Attachment #298694 - Flags: review?(dbaron)
Attachment #298694 - Flags: review+
(And I'd note that these are both called, from nsBlockFrame::PlaceLine (via the call to bidiUtils->ReorderFrames), which means this is guaranteed to be after the inlines have been reflowed, which is good (and required).)
Attached file Testcase for padding
Padding has the same bug, of course...
...and the same fix
Attachment #298694 - Attachment is obsolete: true
Attachment #298922 - Flags: superreview?(dbaron)
Attachment #298922 - Flags: review?(dbaron)
Comment on attachment 298922 [details] [diff] [review]
Patch including padding

r+sr=dbaron
Attachment #298922 - Flags: review?(dbaron) → review+
Attachment #298922 - Flags: superreview?(dbaron) → superreview+
Checked in with the testcases as reftests
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Component: Layout: BiDi Hebrew & Arabic → Layout: Text
QA Contact: layout.block-and-inline → layout.fonts-and-text
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: