Changeset 26740 in webkit


Ignore:
Timestamp:
Oct 18, 2007 12:30:13 AM (17 years ago)
Author:
eseidel
Message:

2007-10-18 Eric Seidel <eric@webkit.org>

Reviewed by Maciej.

Fix crashers in SVGViewSpec::parseViewSpec
http://bugs.webkit.org/show_bug.cgi?id=15504

Test is blocked by bug 15503, landed as:

  • svg/dom/viewspec-parser.html-disabled
  • bindings/scripts/CodeGeneratorObjC.pm: support classes where all parents are interfaces
  • ksvg2/svg/SVGViewSpec.cpp: (WebCore::SVGViewSpec::parseViewSpec):
  • ksvg2/svg/SVGViewSpec.idl: Added.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r26732 r26740  
     12007-10-18  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Maciej.
     4       
     5        Test case for http://bugs.webkit.org/show_bug.cgi?id=15504
     6        Landed -disabled as it's blocked by:
     7        http://bugs.webkit.org/show_bug.cgi?id=15503
     8
     9        * fast/js/resources/js-test-post.js: add support for XHTML
     10        * fast/js/resources/js-test-pre.js: add support for XHTML
     11        * svg/dom/viewspec-parser.html-disabled: Added.
     12
    1132007-10-17  Rob Buis  <buis@kde.org>
    214
  • trunk/LayoutTests/fast/js/resources/js-test-post.js

    r11995 r26740  
    11shouldBeTrue("successfullyParsed");
    2 debug('<br><span class="pass">TEST COMPLETE</span>');
     2debug('<br /><span class="pass">TEST COMPLETE</span>');
  • trunk/LayoutTests/fast/js/resources/js-test-pre.js

    r26350 r26740  
    1717{
    1818    var span = document.createElement("span");
    19     span.innerHTML = msg + '<br>';
    20     document.getElementById("console").appendChild(span);
     19    document.getElementById("console").appendChild(span); // insert it first so XHTML knows the namespace
     20    span.innerHTML = msg + '<br />';
    2121}
    2222
     
    2828function testPassed(msg)
    2929{
    30     debug('<span class="pass">PASS</span> ' + escapeHTML(msg) + '</span>');
     30    debug('<span><span class="pass">PASS</span> ' + escapeHTML(msg) + '</span>');
    3131}
    3232
    3333function testFailed(msg)
    3434{
    35     debug('<span class="fail">FAIL</span> ' + escapeHTML(msg) + '</span>');
     35    debug('<span><span class="fail">FAIL</span> ' + escapeHTML(msg) + '</span>');
    3636}
    3737
  • trunk/WebCore/ChangeLog

    r26732 r26740  
     12007-10-18  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Maciej.
     4
     5        Fix crashers in SVGViewSpec::parseViewSpec
     6        http://bugs.webkit.org/show_bug.cgi?id=15504
     7
     8        Test is blocked by bug 15503, landed as:
     9        * svg/dom/viewspec-parser.html-disabled
     10
     11        * bindings/scripts/CodeGeneratorObjC.pm: support classes where all parents are interfaces
     12        * ksvg2/svg/SVGViewSpec.cpp:
     13        (WebCore::SVGViewSpec::parseViewSpec):
     14        * ksvg2/svg/SVGViewSpec.idl: Added.
     15
    1162007-10-17  Rob Buis  <buis@kde.org>
    217
  • trunk/WebCore/bindings/scripts/CodeGeneratorObjC.pm

    r26543 r26740  
    205205
    206206# Uppercase the first letter, while respecting WebKit style guidelines.
    207 # E.g., xmlEncoding becomes XMLEncoding, but xmlllang becomes Xmllang.
     207# E.g., xmlEncoding becomes XMLEncoding, but xmllang becomes Xmllang.
    208208sub WK_ucfirst
    209209{
     
    387387        if (IsProtocolType($firstParent)) {
    388388            push(@protocols, "DOM" . $firstParent);
     389            if (!$isProtocol) {
     390                $parent = "DOMObject";
     391            }
    389392        } else {
    390393            $parent = "DOM" . $firstParent;
  • trunk/WebCore/ksvg2/svg/SVGViewSpec.cpp

    r26543 r26740  
    100100        return false;
    101101
    102     if (*currViewSpec != '(' )
     102    if (currViewSpec >= end || *currViewSpec != '(' )
    103103        return false;
    104104    currViewSpec++;
    105105
    106     while (*currViewSpec != ')' && currViewSpec < end) {
     106    while (currViewSpec < end && *currViewSpec != ')') {
    107107        if (*currViewSpec == 'v') {
    108108            if (skipString(currViewSpec, end, viewBoxSpec, sizeof(viewBoxSpec) / sizeof(UChar))) {
    109                 if (*currViewSpec != '(')
     109                if (currViewSpec >= end || *currViewSpec != '(')
    110110                    return false;
    111111                currViewSpec++;
     
    114114                    return false;
    115115                setViewBoxBaseValue(FloatRect(x, y, w, h));
    116                 if (*currViewSpec != ')')
     116                if (currViewSpec >= end || *currViewSpec != ')')
    117117                    return false;
    118118                currViewSpec++;
    119119            } else if (skipString(currViewSpec, end, viewTargetSpec, sizeof(viewTargetSpec) / sizeof(UChar))) {
    120                 if (*currViewSpec != '(')
     120                if (currViewSpec >= end || *currViewSpec != '(')
    121121                    return false;
    122122                const UChar* viewTargetStart = ++currViewSpec;
    123                 while (*currViewSpec != ')' && currViewSpec <= end)
     123                while (currViewSpec < end && *currViewSpec != ')')
    124124                    currViewSpec++;
    125                 if (currViewSpec > end)
     125                if (currViewSpec >= end)
    126126                    return false;
    127127                setViewTargetString(String(viewTargetStart, currViewSpec - viewTargetStart));
     
    132132            if (!skipString(currViewSpec, end, zoomAndPanSpec, sizeof(zoomAndPanSpec) / sizeof(UChar)))
    133133                return false;
    134             if (*currViewSpec != '(')
     134            if (currViewSpec >= end || *currViewSpec != '(')
    135135                return false;
    136136            currViewSpec++;
    137137            if (!parseZoomAndPan(currViewSpec, end))
    138138                return false;
    139             if (*currViewSpec != ')')
     139            if (currViewSpec >= end || *currViewSpec != ')')
    140140                return false;
    141141            currViewSpec++;
     
    143143            if (!skipString(currViewSpec, end, preserveAspectRatioSpec, sizeof(preserveAspectRatioSpec) / sizeof(UChar)))
    144144                return false;
    145             if (*currViewSpec != '(')
     145            if (currViewSpec >= end || *currViewSpec != '(')
    146146                return false;
    147147            currViewSpec++;
    148148            if (!preserveAspectRatioBaseValue()->parsePreserveAspectRatio(currViewSpec, end, false))
    149149                return false;
    150             if (*currViewSpec != ')')
     150            if (currViewSpec >= end || *currViewSpec != ')')
    151151                return false;
    152152            currViewSpec++;
     
    154154            if (!skipString(currViewSpec, end, transformSpec, sizeof(transformSpec) / sizeof(UChar)))
    155155                return false;
    156             if (*currViewSpec != '(')
     156            if (currViewSpec >= end || *currViewSpec != '(')
    157157                return false;
    158158            currViewSpec++;
    159159            SVGTransformable::parseTransformAttribute(m_transform.get(), currViewSpec, end);
    160             if (*currViewSpec != ')')
     160            if (currViewSpec >= end || *currViewSpec != ')')
    161161                return false;
    162162            currViewSpec++;
    163         }
     163        } else
     164            return false;
    164165
    165         if (*currViewSpec == ';')
     166        if (currViewSpec < end && *currViewSpec == ';')
    166167            currViewSpec++;
    167168    }
    168     if (currViewSpec >= end)
    169         return false;
    170 
    171     if (*currViewSpec != ')')
     169   
     170    if (currViewSpec >= end || *currViewSpec != ')')
    172171        return false;
    173172
Note: See TracChangeset for help on using the changeset viewer.