RESOLVED FIXED32093
Some sections should be hidden in Google Style Guide, but they aren't
https://bugs.webkit.org/show_bug.cgi?id=32093
Summary Some sections should be hidden in Google Style Guide, but they aren't
David Glasser
Reported 2009-12-02 14:48:20 PST
This is confirmed on: - MacOS X WebKit nightly r51580, OSX 10.5 - Safari 4.0.2, OSX 10.5 - Chrome dev channel, OSX 10.5 - Chrome dev channel, Linux Look at http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Nested_Classes in both WebKit and Firefox. Search for "Nested Classes" (the target should take you there). In WebKit, the "Pros", "Cons", and "Decision" paragraphs are visible. In Firefox, they are hidden until you hit the triangle button (which is the intended behavior). You can see with the Web Inspector that those paragraphs are not inside the <SPAN class="stylepoint_body"> as they should be.
Attachments
reduced test case (211 bytes, text/html)
2009-12-02 21:35 PST, Alexey Proskuryakov
no flags
Alexey Proskuryakov
Comment 1 2009-12-02 21:22:42 PST
This has nothing to do with XSLT - the same difference is observable with processed HTML code. I'm now reducing it to a simple test case.
Alexey Proskuryakov
Comment 2 2009-12-02 21:35:30 PST
Created attachment 44208 [details] reduced test case
Alexey Proskuryakov
Comment 3 2009-12-02 21:38:58 PST
WebKit behavior is in accordance with HTML5 - you can see how the reduced test case is interpreted by compliant browsers at <http://james.html5.org/parsetree.html>. Moving to Evangelism, as Google Style Guide itself should be fixed. It would also be nice to file a bug against Firefox, to improve their standards compliance.
David Glasser
Comment 4 2009-12-03 10:51:43 PST
Alexey, I would be happy to help with the Evangelism work by fixing Google's style guides, but as a non-HTML5-expert, I'm not positive what the issue is. Is it something about which elements are allowed to nest inside each other? It looks like changing both SPANs to DIVs fixes the issue, but before submitting a patch to the style guide maintainers, I'd like to understand the issue a little better. (For example, to understand why it only happens on some of the blocks: is the PRE relevant?)
Alexey Proskuryakov
Comment 5 2009-12-03 11:10:00 PST
Yes, this happens because PRE is "flow content", but the content model of SPAN is "phrase content". So, PRE is not allowed to be inside SPAN. The SPAN is automatically closed when PRE is encountered, and then </SPAN> that was supposed to close it closes upper level SPAN. The different content kinds are described at <http://www.whatwg.org/specs/web-apps/current-work/#content-models>.
David Glasser
Comment 6 2009-12-03 11:24:10 PST
Aha, got it. So changing to DIV should do the trick. I'll let you know when the style guide is fixed so that you can close the envangelism bug. Though one thing I don't get: P is flow content too, so why doesn't the outer SPAN end in WebKit when the P shows up?
Alexey Proskuryakov
Comment 7 2009-12-03 11:58:49 PST
I don't have an answer to that question. I think that P inside SPAN is still forbidden by HTML5, but I don't know why WebKit and html5lib process it differently then PRE.
Alexey Proskuryakov
Comment 8 2009-12-03 12:06:04 PST
My guess is that html5lib parsing is based on algorithm in section 9.2 of the spec - section 9.2.5.10 in particular has rules for PRE that don't apply to P (not saying that it's the difference that we are discussing here, the algorithm is quite complicated). So, while both are illegal inside SPAN, actual processing can be different for them.
David Glasser
Comment 9 2009-12-03 14:36:42 PST
The linked style guide is now updated to work on WebKit browsers! So that's your evangelism right there. Thanks for the quick and helpful explanations. Given that my original report was pretty vague ("this big complicated thing that I don't understand doesn't work the way I want it to"), I wasn't really expecting much from my bug report... you definitely surpassed my expectations :)
Alexey Proskuryakov
Comment 10 2009-12-03 15:23:56 PST
That's the fastest evangelism turnover I've seen :)
Note You need to log in before you can comment on or make changes to this bug.