Changeset 167437 in webkit


Ignore:
Timestamp:
Apr 17, 2014 10:41:38 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Catch up ruby and its tag omission rule changes in HTML5 CR Feb 2014
https://bugs.webkit.org/show_bug.cgi?id=131175

Patch by Koji Ishii <kojishi@gmail.com> on 2014-04-17
Reviewed by Darin Adler.

Source/WebCore:
Tests: html5lib/resources/ruby.dat

html5lib/resources/tests19.dat

This patch makes WebKit HTML parser to match to the tag omission rules of HTML5 CR Feb 2014:
http://www.w3.org/TR/2014/CR-html5-20140204/syntax.html#syntax-tag-omission
with the support for two new elements (rb, rtc) which were also defined in the spec:
http://www.w3.org/TR/2014/CR-html5-20140204/text-level-semantics.html#the-rb-element
http://www.w3.org/TR/2014/CR-html5-20140204/text-level-semantics.html#the-rtc-element
to better support use cases presented by W3C I18N WG:
http://www.w3.org/TR/ruby-use-cases/

  • html/HTMLTagNames.in: rb and rtc added as HTMLElement interfaces.
  • html/parser/HTMLConstructionSite.cpp:

(WebCore::hasImpliedEndTag): the spec says rb and rtc have implied end tags.

  • html/parser/HTMLTreeBuilder.cpp:

(WebCore::HTMLTreeBuilder::processStartTagForInBody): rb and rtc added. rt excludes rtc from its implied end tags.

LayoutTests:
25 new test cases in 2 test files imported from pull requests to html5lib-tests,
with run- and expected-files generated.
All new tests pass with the changes included in this patch.

Location:
trunk
Files:
5 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r167434 r167437  
     12014-04-17  Koji Ishii  <kojishi@gmail.com>
     2
     3        Catch up ruby and its tag omission rule changes in HTML5 CR Feb 2014
     4        https://bugs.webkit.org/show_bug.cgi?id=131175
     5
     6        Reviewed by Darin Adler.
     7
     8        25 new test cases in 2 test files imported from pull requests to html5lib-tests,
     9        with run- and expected-files generated.
     10        All new tests pass with the changes included in this patch.
     11
     12        * html5lib/generated/run-ruby-data-expected.txt: Added.
     13        * html5lib/generated/run-ruby-data.html: Added (generated by generate-test-wrappers.py)
     14        * html5lib/generated/run-ruby-write-expected.txt: Added.
     15        * html5lib/generated/run-ruby-write.html: Added (generated by generate-test-wrappers.py)
     16        * html5lib/resources/ruby.dat: Added from https://github.com/darobin/html5lib-tests/pull/1
     17        * html5lib/resources/tests19.dat: Updated from https://github.com/html5lib/html5lib-tests/pull/27
     18
    1192014-04-17  Alexey Proskuryakov  <ap@apple.com>
    220
  • trunk/LayoutTests/html5lib/resources/tests19.dat

    r167213 r167437  
    249249|         <p>
    250250|         <rt>
     251
     252#data
     253<html><ruby>a<rb>b<rt></ruby></html>
     254#errors
     255(1,6): expected-doctype-but-got-start-tag
     256#document
     257| <html>
     258|   <head>
     259|   <body>
     260|     <ruby>
     261|       "a"
     262|       <rb>
     263|         "b"
     264|       <rt>
     265
     266#data
     267<html><ruby>a<rp>b<rt></ruby></html>
     268#errors
     269(1,6): expected-doctype-but-got-start-tag
     270#document
     271| <html>
     272|   <head>
     273|   <body>
     274|     <ruby>
     275|       "a"
     276|       <rp>
     277|         "b"
     278|       <rt>
     279
     280#data
     281<html><ruby>a<rt>b<rt></ruby></html>
     282#errors
     283(1,6): expected-doctype-but-got-start-tag
     284#document
     285| <html>
     286|   <head>
     287|   <body>
     288|     <ruby>
     289|       "a"
     290|       <rt>
     291|         "b"
     292|       <rt>
     293
     294#data
     295<html><ruby>a<rtc>b<rt>c<rb>d</ruby></html>
     296#errors
     297(1,6): expected-doctype-but-got-start-tag
     298#document
     299| <html>
     300|   <head>
     301|   <body>
     302|     <ruby>
     303|       "a"
     304|       <rtc>
     305|         "b"
     306|         <rt>
     307|           "c"
     308|       <rb>
     309|         "d"
    251310
    252311#data
  • trunk/Source/WebCore/ChangeLog

    r167436 r167437  
     12014-04-17  Koji Ishii  <kojishi@gmail.com>
     2
     3        Catch up ruby and its tag omission rule changes in HTML5 CR Feb 2014
     4        https://bugs.webkit.org/show_bug.cgi?id=131175
     5
     6        Reviewed by Darin Adler.
     7
     8        Tests: html5lib/resources/ruby.dat
     9               html5lib/resources/tests19.dat
     10
     11        This patch makes WebKit HTML parser to match to the tag omission rules of HTML5 CR Feb 2014:
     12        http://www.w3.org/TR/2014/CR-html5-20140204/syntax.html#syntax-tag-omission
     13        with the support for two new elements (rb, rtc) which were also defined in the spec:
     14        http://www.w3.org/TR/2014/CR-html5-20140204/text-level-semantics.html#the-rb-element
     15        http://www.w3.org/TR/2014/CR-html5-20140204/text-level-semantics.html#the-rtc-element
     16        to better support use cases presented by W3C I18N WG:
     17        http://www.w3.org/TR/ruby-use-cases/
     18
     19        * html/HTMLTagNames.in: rb and rtc added as HTMLElement interfaces.
     20        * html/parser/HTMLConstructionSite.cpp:
     21        (WebCore::hasImpliedEndTag): the spec says rb and rtc have implied end tags.
     22        * html/parser/HTMLTreeBuilder.cpp:
     23        (WebCore::HTMLTreeBuilder::processStartTagForInBody): rb and rtc added. rt excludes rtc from its implied end tags.
     24
    1252014-04-17  Darin Adler  <darin@apple.com>
    226
  • trunk/Source/WebCore/html/HTMLTagNames.in

    r163528 r167437  
    101101progress interfaceName=HTMLProgressElement, conditional=PROGRESS_ELEMENT, generateTypeHelpers
    102102q interfaceName=HTMLQuoteElement
     103rb interfaceName=HTMLElement
    103104rp interfaceName=HTMLElement
    104105rt interfaceName=HTMLElement
     106rtc interfaceName=HTMLElement
    105107ruby interfaceName=HTMLElement
    106108s interfaceName=HTMLElement
  • trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp

    r165699 r167437  
    6565        || isHTMLOptGroupElement(item->node())
    6666        || item->hasTagName(pTag)
     67        || item->hasTagName(rbTag)
    6768        || item->hasTagName(rpTag)
    68         || item->hasTagName(rtTag);
     69        || item->hasTagName(rtTag)
     70        || item->hasTagName(rtcTag);
    6971}
    7072
  • trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp

    r166532 r167437  
    877877        return;
    878878    }
    879     if (token->name() == rpTag || token->name() == rtTag) {
     879    if (token->name() == rbTag || token->name() == rpTag || token->name() == rtcTag) {
    880880        if (m_tree.openElements()->inScope(rubyTag.localName())) {
    881881            m_tree.generateImpliedEndTags();
    882882            if (!m_tree.currentStackItem()->hasTagName(rubyTag))
     883                parseError(token);
     884        }
     885        m_tree.insertHTMLElement(token);
     886        return;
     887    }
     888    if (token->name() == rtTag) {
     889        if (m_tree.openElements()->inScope(rubyTag.localName())) {
     890            m_tree.generateImpliedEndTagsWithExclusion(rtcTag.localName());
     891            if (!m_tree.currentStackItem()->hasTagName(rubyTag) && !m_tree.currentStackItem()->hasTagName(rtcTag))
    883892                parseError(token);
    884893        }
Note: See TracChangeset for help on using the changeset viewer.