Closed Bug 289677 Opened 20 years ago Closed 20 years ago

mtext color not respected

Categories

(Core :: MathML, defect)

x86
Linux
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.8beta2

People

(Reporter: mmokrejs, Assigned: bzbarsky)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b2) Gecko/20050408
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b2) Gecko/20050408

The word "Theorem 1" in the testcase should appear in red, instead of black as
in mozilla now.

Reproducible: Always
thats more mathml
Component: Layout: View Rendering → MathML
Assignee: roc → rbs
mathcolor='#f05' works fine (try it at:
http://www.mozilla.org/projects/mathml/demo/tester.html).
Looks like an oversight somewhere in the code for 'color'.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached patch PatchSplinter Review
I have no idea why "mathcolor" worked.... "fontsize" didn't work, nor did
"color" (unless "mathcolor" happened to be also set).

In any case, part of the problem is that the @namespace rule was never being
inserted into the sheet (inserting rules via DOM methods into an incomplete
sheet throws).	Once that was fixed, things started to Just Work.
Attachment #183670 - Flags: superreview?(rbs)
Attachment #183670 - Flags: review?(rbs)
Comment on attachment 183670 [details] [diff] [review]
Patch

r+sr=rbs

=============
The next bit of of code assumed that the '@namespace' was insterted (and thus
was sitting in position 0), and so was inserting 'color' (and others from
MathML1) to position '1'.  That fails if @namespace  failed earlier and
position 0 was unoccupied...

===============
    if (k >= 0) {
      // insert the rule (note: when the sheet already has @namespace and
      // friends, insert after them, e.g., at the end, otherwise it won't work)
      // For MathML 2, insert at the end to give it precedence
      PRInt32 pos = (map->compatibility == kMathMLversion2) ? count : 1;
      PRUint32 index;
      domSheet->InsertRule(cssRule, pos, &index);
      ++ruleCount;
    }
=================

[PS: friends of '@namespace' include '@charset', and since these have to be
first for those DOM things to work, the offset '1' has to be kept in sync if
somebody changes that code to add more @-rules. Missing Get@RuleCount() here...
Looks like JavaScript'ers are going to be bitten by this kind of things.]
Attachment #183670 - Flags: superreview?(rbs)
Attachment #183670 - Flags: superreview+
Attachment #183670 - Flags: review?(rbs)
Attachment #183670 - Flags: review+
Comment on attachment 183670 [details] [diff] [review]
Patch

Requesting 1.8b2 approval.  This only affects MathML and is quite safe.
Attachment #183670 - Flags: approval1.8b2?
Comment on attachment 183670 [details] [diff] [review]
Patch

a=shaver.
Attachment #183670 - Flags: approval1.8b2? → approval1.8b2+
Assignee: rbs → bzbarsky
Target Milestone: --- → mozilla1.8beta2
Fixed
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
"Theorem 1" does indeed appear in red in build 2005-05-16-06, Windows XP
Seamonkey trunk, when loading
http://www.w3.org/Math/testsuite/testsuite/Presentation/TokenElements/mtext/mtextAtoken3.xml

Verified FIXED
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: