Changeset 151080 in webkit


Ignore:
Timestamp:
Jun 2, 2013 1:14:48 AM (11 years ago)
Author:
ap@apple.com
Message:

Unstyled XML viewer crashes when XML contains an element with id="tree"
https://bugs.webkit.org/show_bug.cgi?id=117117
<rdar://problem/13727267>

Reviewed by Darin Adler.

Source/WebCore:

Test: http/tests/xmlviewer/dumpAsText/existing-tree-element-crash.xml

  • xml/XMLViewer.css: Removed the rule to hide source document, as we no longer

keep it in the tree.

  • xml/XMLViewer.js:

(prepareWebKitXMLViewer): Make sourceXML a detached tree, as otherwise it can
have ID conflicts with elements we add.
(sourceXMLLoaded): Removed some commented out code. Removed code that was checking
whether an extension took over XML display, as it makes no sense to duplicate this
functionality in an extension.

LayoutTests:

  • http/tests/xmlviewer/dumpAsText/existing-tree-element-crash-expected.txt: Added.
  • http/tests/xmlviewer/dumpAsText/existing-tree-element-crash.xml: Added.
  • xmlviewer: Removed.
  • xmlviewer/extensions-api-expected.txt: Removed.
  • xmlviewer/extensions-api.html: Removed.
  • xmlviewer/resources: Removed.
  • xmlviewer/resources/sample.xml: Removed.

The "API" no longer exists.

Location:
trunk
Files:
2 added
3 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r151079 r151080  
     12013-06-02  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Unstyled XML viewer crashes when XML contains an element with id="tree"
     4        https://bugs.webkit.org/show_bug.cgi?id=117117
     5        <rdar://problem/13727267>
     6
     7        Reviewed by Darin Adler.
     8
     9        * http/tests/xmlviewer/dumpAsText/existing-tree-element-crash-expected.txt: Added.
     10        * http/tests/xmlviewer/dumpAsText/existing-tree-element-crash.xml: Added.
     11
     12        * xmlviewer: Removed.
     13        * xmlviewer/extensions-api-expected.txt: Removed.
     14        * xmlviewer/extensions-api.html: Removed.
     15        * xmlviewer/resources: Removed.
     16        * xmlviewer/resources/sample.xml: Removed.
     17        The "API" no longer exists.
     18
    1192013-06-01  Chris Fleizach  <cfleizach@apple.com>
    220
  • trunk/Source/WebCore/ChangeLog

    r151079 r151080  
     12013-06-02  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Unstyled XML viewer crashes when XML contains an element with id="tree"
     4        https://bugs.webkit.org/show_bug.cgi?id=117117
     5        <rdar://problem/13727267>
     6
     7        Reviewed by Darin Adler.
     8
     9        Test: http/tests/xmlviewer/dumpAsText/existing-tree-element-crash.xml
     10
     11        * xml/XMLViewer.css: Removed the rule to hide source document, as we no longer
     12        keep it in the tree.
     13
     14        * xml/XMLViewer.js:
     15        (prepareWebKitXMLViewer): Make sourceXML a detached tree, as otherwise it can
     16        have ID conflicts with elements we add.
     17        (sourceXMLLoaded): Removed some commented out code. Removed code that was checking
     18        whether an extension took over XML display, as it makes no sense to duplicate this
     19        functionality in an extension.
     20
    1212013-06-01  Chris Fleizach  <cfleizach@apple.com>
    222
  • trunk/Source/WebCore/xml/XMLViewer.css

    r126241 r151080  
    4444}
    4545
    46 #webkit-xml-viewer-source-xml {
    47     display: none;
    48 }
    49 
    5046.collapsible-content {
    5147    margin-left: 1em;
  • trunk/Source/WebCore/xml/XMLViewer.js

    r126241 r151080  
    11/*
    22 * Copyright (C) 2011 Google Inc. All rights reserved.
     3 * Copyright (C) 2013 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    2829
    2930var nodeParentPairs = [];
     31var sourceXML;
    3032
    3133// Script entry point.
     
    4143    var body = createHTMLElement('body');
    4244    html.appendChild(body);
    43     var sourceXML = createHTMLElement('div');
    44     sourceXML.id = 'webkit-xml-viewer-source-xml';
    45     body.appendChild(sourceXML);
     45    sourceXML = createHTMLElement('div');
    4646
    4747    var child;
     
    7070function sourceXMLLoaded()
    7171{
    72     var sourceXML = document.getElementById('webkit-xml-viewer-source-xml');
    73     if (!sourceXML)
    74         return; // Stop if some XML tree extension is already processing this document
    75     //var style = document.head.firstChild;
    76     //document.head.removeChild(style);
    77     //document.head.appendChild(style);
    7872    var root = document.getElementById('tree');
    7973
Note: See TracChangeset for help on using the changeset viewer.