Enabling MathML?

135 views
Skip to first unread message

Alex Milowski

unread,
Aug 11, 2010, 8:50:44 AM8/11/10
to chromi...@chromium.org
I've been working on MathML in WebKit and now I'm looking at the Chromium
build. The version of WebKit in subversion in 'src/third_party/WebKit' has
MathML enabled by default but it looks like there are different build
scripts or Makefiles used to build WebKit in Chromium.

Specifically, I was looking at:

src/third_party/WebKit/WebCore/WebCore.gyp/webcore.target.mk

and I don't see a -DENABLE_MATHML=1 nor the appropriate
includes or build dependencies for the MathML rendering code.

How do I get started to understand where and how I add the
MathML code to the build process?

Specifically, I'm trying to understand what of the WebKit build
process is used by Chromium and where the platform-specific
build files are located relating to WebKit integration.

--Alex Milowski

Jeremy Orlow

unread,
Aug 11, 2010, 9:06:11 AM8/11/10
to alexmi...@gmail.com, chromi...@chromium.org, Chris Evans, Berend-Jan Wever
third_party/WebKit/WebKit/chromium/features.gypi and
build/features_override.gypi

are the 2 files you should be looking at.  The first is used when you run the build webkit script with "--chromium".  The second is used when actually building chromium.  Most defines should be the same between the two though.  I don't see either defined in those files though, so I'm surprised you say that MATHML is enabled in either build.

Anyway, from a technical standpoint, simply adding the flag to the 2 files I mentioned should be enough.  Once it's working (hopefully it just works out of the box :-)  it'll probably need some security review before we ship it, though.

J


--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
   http://groups.google.com/a/chromium.org/group/chromium-dev

Alex Milowski

unread,
Aug 11, 2010, 9:21:21 AM8/11/10
to chromi...@chromium.org
On Wed, Aug 11, 2010 at 2:06 PM, Jeremy Orlow <jor...@chromium.org> wrote:
> third_party/WebKit/WebKit/chromium/features.gypi and
> build/features_override.gypi
> are the 2 files you should be looking at.  The first is used when you run
> the build webkit script with "--chromium".  The second is used when actually
> building chromium.

OK. I'll try that.

> Most defines should be the same between the two though.
>  I don't see either defined in those files though, so I'm surprised you say
> that MATHML is enabled in either build.

Around line 504 in 'third_party/WebKit/WebKitTools/Scripts/build-webkit'
the $mathmlSupport variable is set to '1' by default. That would
normally result in MathML being enabled.

I see that ENABLE_MATHML is not defined in either of the other
files.

I'm not quite sure how all this fits together. Is there some documention
somewhere I can read about the build process?

It looks like the features.gypi file in the WebKit subversion should be
updated as well. How is the patch process managed? Do I submit
a patch to bugs.webkit.org as I have for other changes or is there
some other process?

> Anyway, from a technical standpoint, simply adding the flag to the 2 files I
> mentioned should be enough.  Once it's working (hopefully it just works out
> of the box :-)  it'll probably need some security review before we ship it,
> though.

More review is good! :)

It should just work as it does in WebKit but you never know till you test
it. Hence, all the questions ...

--Alex Milowski

Jeremy Orlow

unread,
Aug 11, 2010, 9:32:55 AM8/11/10
to alexmi...@gmail.com, chromi...@chromium.org
On Wed, Aug 11, 2010 at 2:21 PM, Alex Milowski <alexmi...@gmail.com> wrote:
On Wed, Aug 11, 2010 at 2:06 PM, Jeremy Orlow <jor...@chromium.org> wrote:
> third_party/WebKit/WebKit/chromium/features.gypi and
> build/features_override.gypi
> are the 2 files you should be looking at.  The first is used when you run
> the build webkit script with "--chromium".  The second is used when actually
> building chromium.

OK.  I'll try that.

> Most defines should be the same between the two though.
>  I don't see either defined in those files though, so I'm surprised you say
> that MATHML is enabled in either build.

Around line 504 in 'third_party/WebKit/WebKitTools/Scripts/build-webkit'
the $mathmlSupport variable is set to '1' by default.  That would
normally result in MathML being enabled.

I've never touched the build webkit script when adding something to be built by default, so I'm not really sure what's going on there.  Maybe someone else (who wakes up later) will.
 
I see that ENABLE_MATHML is not defined in either of the other
files.

I'm not quite sure how all this fits together.  Is there some documention
somewhere I can read about the build process?

It looks like the features.gypi file in the WebKit subversion should be
updated as well.  How is the patch process managed?  Do I submit
a patch to bugs.webkit.org as I have for other changes or is there
some other process?

third_party/WebKit simply pulls in a particular revision of webkit.org's SVN repo.  So any changes inside that dir need to be committed upstream.  We sync that dir to tip of tree WebKit several times a day, typically (which matters if you are making a change in Chromium that depends on a change upstream).

This page describes how you can set up a Chromium checkout to use tip of tree WebKit and tip of tree Chromium: http://www.chromium.org/developers/contributing-to-webkit  It's a bit less stable (which is why we still have a manual process for syncing with the latest WebKit rev), but it's much more convenient for development.  Almost everyone who works on Chromium uses a setup like this.

Feel free to cc me (and dglazkov?) on any of the upstream WebKit bugs for this.
 
> Anyway, from a technical standpoint, simply adding the flag to the 2 files I
> mentioned should be enough.  Once it's working (hopefully it just works out
> of the box :-)  it'll probably need some security review before we ship it,
> though.

More review is good!  :)

It should just work as it does in WebKit but you never know till you test
it.  Hence, all the questions ...

--Alex Milowski

Jeremy Orlow

unread,
Aug 11, 2010, 10:03:22 AM8/11/10
to alexmi...@gmail.com, chromi...@chromium.org
You may need to add "../mathml", to line 130 of WebCore/WebCore.gyp/WebCore.gyp as well.

Also, remember to run "gclient hooks" after each change of gyp/gypi files.

J

Alex Milowski

unread,
Aug 12, 2010, 6:10:59 AM8/12/10
to chromi...@chromium.org
On Thu, Aug 12, 2010 at 11:04 AM, Berend-Jan Wever <skyl...@google.com> wrote:
> I haven't seen any version of Chrome with MathML enabled - at least the page
> at:
> http://www.mozilla.org/projects/mathml/demo/texvsmml.xhtml
> does not render MathML for me in Chrome 5.0.375.125 or Chromium 6.0.491.0
> (55620).

It isn't currently enabled or, actually, setup properly. I'm trying
to figure out what
needs to change to get the MathML rendering to build properly.

There seem to be a few things missing from the build configuration. Afterwards,
it would be a matter of actually having the default be "enabled".

--Alex Milowski

Alex Milowski

unread,
Aug 12, 2010, 11:51:39 AM8/12/10
to chromi...@chromium.org
On Wed, Aug 11, 2010 at 3:03 PM, Jeremy Orlow <jor...@chromium.org> wrote:
> You may need to add "../mathml", to line 130
> of WebCore/WebCore.gyp/WebCore.gyp as well.
> Also, remember to run "gclient hooks" after each change of gyp/gypi files.
> J

There were actually a number of places where things needed to change.

I've made the changes in WebKit and the patch is available at:

https://bugs.webkit.org/show_bug.cgi?id=43915

Reviewers are welcome! :)

I did not make the MathML files optional when MathML is disabled. That
enhancement probably isn't that difficult but I'm starting with the simplest
approach since gyp files are new to me.

I think there is a tweak to features_override.gypi necessary on the
chromium side to complete the enabling of MathML.

--Alex Milowski

Jeremy Orlow

unread,
Aug 12, 2010, 12:41:46 PM8/12/10
to alexmi...@gmail.com, chromi...@chromium.org
On Thu, Aug 12, 2010 at 4:51 PM, Alex Milowski <alexmi...@gmail.com> wrote:
On Wed, Aug 11, 2010 at 3:03 PM, Jeremy Orlow <jor...@chromium.org> wrote:
> You may need to add "../mathml", to line 130
> of WebCore/WebCore.gyp/WebCore.gyp as well.
> Also, remember to run "gclient hooks" after each change of gyp/gypi files.
> J

There were actually a number of places where things needed to change.

I've made the changes in WebKit and the patch is available at:

  https://bugs.webkit.org/show_bug.cgi?id=43915

Reviewers are welcome! :)

LGTM (minus the actual enabling..for now)
 
I did not make the MathML files optional when MathML is disabled.  That
enhancement probably isn't that difficult but I'm starting with the simplest
approach since gyp files are new to me.

This is fine long term.  (The files have compile time guards in them, right?)
 
I think there is a tweak to features_override.gypi necessary on the
chromium side to complete the enabling of MathML.

Does anyone have any thoughts/objections on enabling this by default?  I'm surprised this thread has been so quiet.  :-)

Alex Milowski

unread,
Aug 12, 2010, 1:08:57 PM8/12/10
to chromi...@chromium.org
On Thu, Aug 12, 2010 at 5:41 PM, Jeremy Orlow <jor...@chromium.org> wrote:
>
> LGTM (minus the actual enabling..for now)

Well, it is on for the other ports by default... :)

Users of WebKit will have to now turn it off explicitly for many of
the other ports.

>
>>
>> I did not make the MathML files optional when MathML is disabled.  That
>> enhancement probably isn't that difficult but I'm starting with the
>> simplest
>> approach since gyp files are new to me.
>
> This is fine long term.  (The files have compile time guards in them,
> right?)

Yes, there are compile time guards.

--Alex Milowski

Ryosuke Niwa

unread,
Aug 12, 2010, 4:39:17 PM8/12/10
to jor...@google.com, alexmi...@gmail.com, chromi...@chromium.org
On Thu, Aug 12, 2010 at 9:41 AM, Jeremy Orlow <jor...@chromium.org> wrote:
I think there is a tweak to features_override.gypi necessary on the
chromium side to complete the enabling of MathML.

Does anyone have any thoughts/objections on enabling this by default?  I'm surprised this thread has been so quiet.  :-)

+1 since I've been waiting for years for MathML to come.

--
Ryosuke Niwa
Software Engineer / Chrome WebKit

Darin Fisher

unread,
Aug 13, 2010, 12:16:49 AM8/13/10
to jor...@google.com, alexmi...@gmail.com, chromi...@chromium.org, Chris Evans

What is the codesize impact to enabling mathml?  What kind of security audit has been done?  How compatible is it with gecko's implementation?

Ryosuke Niwa

unread,
Aug 13, 2010, 12:32:03 AM8/13/10
to da...@google.com, jor...@google.com, alexmi...@gmail.com, chromi...@chromium.org, Chris Evans
On Thu, Aug 12, 2010 at 9:16 PM, Darin Fisher <da...@google.com> wrote:

What is the codesize impact to enabling mathml?  What kind of security audit has been done?  How compatible is it with gecko's implementation?


For the compatibility, see http://www.mozilla.org/projects/mathml/demo/texvsmml.xhtml for example.  We have a long way to catch up with Firefox.

--
Ryosuke Niwa
Software Engineer / Chrome WebKit
Google Inc


Darin Fisher

unread,
Aug 13, 2010, 12:40:41 AM8/13/10
to Ryosuke Niwa, jor...@google.com, alexmi...@gmail.com, chromi...@chromium.org, Chris Evans
Is it valuable to enable it when it is "so" incomplete?  Is it possible to detect the supported subset of MathML?

-Darin

Jeremy Orlow

unread,
Aug 13, 2010, 4:34:15 AM8/13/10
to Darin Fisher, Ryosuke Niwa, alexmi...@gmail.com, chromi...@chromium.org
I cc'ed Chris at the beginning of the thread to make sure it's on his security review radar, though normally we don't let a security review hold up going to the dev channel.

On Fri, Aug 13, 2010 at 5:40 AM, Darin Fisher <da...@chromium.org> wrote:
Is it valuable to enable it when it is "so" incomplete?  Is it possible to detect the supported subset of MathML?

Is there a downside to it either, though?
 
On Thu, Aug 12, 2010 at 9:32 PM, Ryosuke Niwa <rn...@google.com> wrote:
On Thu, Aug 12, 2010 at 9:16 PM, Darin Fisher <da...@google.com> wrote:

What is the codesize impact to enabling mathml?  What kind of security audit has been done?

This is probably valuable data to gather. 

How compatible is it with gecko's implementation?


For the compatibility, see http://www.mozilla.org/projects/mathml/demo/texvsmml.xhtml for example.  We have a long way to catch up with Firefox.

What's the harm in releasing it early though?  Or at least shipping it behind a flag (assuming it doesn't inflate our executable too much)?  If anything, it seems like that'll help get others interested in hacking on it and finishing it up.

It's worth noting that I've talked to (at Def Fest events for example) several people now who are very excited about MathML support.  It is kind of a niche feature, but I think you might be surprised just how big the niche is.

J

Alex Milowski

unread,
Aug 13, 2010, 7:20:00 AM8/13/10
to Darin Fisher, jor...@google.com, chromi...@chromium.org, Chris Evans
On Fri, Aug 13, 2010 at 5:16 AM, Darin Fisher <da...@google.com> wrote:
> What is the codesize impact to enabling mathml?

I don't have exact metrics here. There are about 14+ extra classes
that also include the generated element factories and MathML
element/attribute names and the user agent CSS stylesheet.

> What kind of security audit has been done?

Some folks at Apple have done some testing. I'm not sure how
much has been looked at in terms of "security". Mostly, we're
implementing rendering objects with "display" behaviors.

> How compatible is it with gecko's implementation?

You must mean "how compliant is it with the W3C's recommendation"?

We're just starting with the test suite for MathML3. It fails a lot of
tests and we expected that. On the other hand, it does a pretty good
job with core semantics for MathML and allows some fairly
complex MathML to be rendered. As such, while not compliant, it
is quite usable.

Our near-term target has been MathML identified as a core for High School
and entry-level college Mathematics. We still have some work to do but
it is quite usable for many subject areas.

--Alex Milowski

Alex Milowski

unread,
Aug 13, 2010, 7:20:49 AM8/13/10
to chromi...@chromium.org
On Fri, Aug 13, 2010 at 5:32 AM, Ryosuke Niwa <rn...@google.com> wrote:
> On Thu, Aug 12, 2010 at 9:16 PM, Darin Fisher <da...@google.com> wrote:
>>
>> What is the codesize impact to enabling mathml?  What kind of security
>> audit has been done?  How compatible is it with gecko's implementation?
>
> For the compatibility,
> see http://www.mozilla.org/projects/mathml/demo/texvsmml.xhtml for example.
>  We have a long way to catch up with Firefox.

That's a "torture test". We're not ready to be tortured. ;)

--Alex Milowski

Alex Milowski

unread,
Aug 13, 2010, 8:05:24 AM8/13/10
to chromi...@chromium.org
On Fri, Aug 13, 2010 at 5:40 AM, Darin Fisher <da...@chromium.org> wrote:
> Is it valuable to enable it when it is "so" incomplete?  Is it possible to
> detect the supported subset of MathML?

"incomplete" is a relative term. There is support for many MathML
presentation elements. See the status page:

http://trac.webkit.org/wiki/MathML%20Status

There are plenty of more sophisticated features of MathML that
play out as certain kinds of attributes. I've gone through and detailed
the ones we don't support.

What you do not see on that page is all the parts that we do support.

In the end, this is very valuable to some. There is still some
work to be done and I've had some early adopters give me feedback
on the next bits that they need for their MathML-enabled systems
to work. We're not that far from being able to do that.

What we need is for real users to experience what we have
and give us some guidance in what they'd like next. MathML3
is a large and complex markup language and we'll be implementing
it over the next few years (or faster if we get more help). As
such, we need to make sure we serve the early adopters
first by:

1. Giving them access to what we have via nightly
builds or official releases.

2. Listening to the features they'd like and trying to
provide them in a timely fashion.

It is a certain "dead end" if people have to build their
own version of Chrome et. al. from source.

--Alex Milowski

Darin Fisher

unread,
Aug 13, 2010, 2:07:11 PM8/13/10
to alexmi...@gmail.com, chromi...@chromium.org
Thanks, this is very helpful.  Given that there's a meaningful subset implemented
already, it seems fine to ship it (provided the footprint is reasonable and our security
team is happy).  I suppose it is OK for users to do UA sniffing to determine what
level of MathML is supported.  That's probably fine given the value of getting some
of this out there.

-Darin



--Alex Milowski

Chris Evans

unread,
Aug 13, 2010, 2:13:34 PM8/13/10
to jor...@google.com, Darin Fisher, Ryosuke Niwa, alexmi...@gmail.com, chromi...@chromium.org
On Fri, Aug 13, 2010 at 1:34 AM, Jeremy Orlow <jor...@chromium.org> wrote:
I cc'ed Chris at the beginning of the thread to make sure it's on his security review radar, though normally we don't let a security review hold up going to the dev channel.

Right. If it does get turned on, let us know so we can beat on it a bit. We'd certainly make sure to complete a review before it hit Chrome stable channel.

Cheers
Chris
 

On Fri, Aug 13, 2010 at 5:40 AM, Darin Fisher <da...@chromium.org> wrote:
Is it valuable to enable it when it is "so" incomplete?  Is it possible to detect the supported subset of MathML?

Is there a downside to it either, though?
 
On Thu, Aug 12, 2010 at 9:32 PM, Ryosuke Niwa <rn...@google.com> wrote:
On Thu, Aug 12, 2010 at 9:16 PM, Darin Fisher <da...@google.com> wrote:

What is the codesize impact to enabling mathml?  What kind of security audit has been done?

This is probably valuable data to gather. 

How compatible is it with gecko's implementation?


For the compatibility, see http://www.mozilla.org/projects/mathml/demo/texvsmml.xhtml for example.  We have a long way to catch up with Firefox.

What's the harm in releasing it early though?  Or at least shipping it behind a flag (assuming it doesn't inflate our executable too much)?  If anything, it seems like that'll help get others interested in hacking on it and finishing it up.

It's worth noting that I've talked to (at Def Fest events for example) several people now who are very excited about MathML support.  It is kind of a niche feature, but I think you might be surprised just how big the niche is.

J

--

Justin Schuh

unread,
Aug 13, 2010, 5:49:35 PM8/13/10
to alexmi...@gmail.com, jor...@google.com, Darin Fisher, Ryosuke Niwa, chromi...@chromium.org, Chris Evans, Michal Zalewski
Alex, one of the people in Google security has already done some poking at MathML implementations. If you're interested, I'll see about getting that information and his tool to you off list.

-j

Alex Milowski

unread,
Aug 17, 2010, 5:40:15 AM8/17/10
to chromi...@chromium.org
On Fri, Aug 13, 2010 at 7:07 PM, Darin Fisher <da...@chromium.org> wrote:
> Thanks, this is very helpful.  Given that there's a meaningful subset
> implemented
> already, it seems fine to ship it (provided the footprint is reasonable and
> our security
> team is happy).  I suppose it is OK for users to do UA sniffing to determine
> what
> level of MathML is supported.  That's probably fine given the value of
> getting some
> of this out there.

[sending again is it bounced before]

I looked into the DOM interfaces for MathML 3 and it looks like they've
been removed. It is unclear from the PR for MathML3 whether we should
be implementing the DOM interfaces from MathML2 [1] or not at all.

There is a DOMImplementation::hasFeature() string of "org.w3c.dom.mathml"
that is specified in MathML2 [2]. That would be useful for client-side
detection of MathML support.

I'll have to get clarification on this from the committee.

[1] http://www.w3.org/TR/MathML2/appendixd.html
[2] http://www.w3.org/TR/MathML2/chapter8.html#id.8.1.1

--
--Alex Milowski
"The excellence of grammar as a guide is proportional to the paucity of the
inflexions, i.e. to the degree of analysis effected by the language
considered."

Bertrand Russell in a footnote of Principles of Mathematics

Reply all
Reply to author
Forward
0 new messages