+2006-09-11 Kevin McCullough <KMcCullough@apple.com>
+
+ Reviewed by Darin.
+
+ * ChangeLog:
+ * fast/dom/Range/range-compareNode-expected.txt: Added.
+ * fast/dom/Range/range-compareNode.html: Added.
+ * fast/dom/Range/range-comparePoint.html:
+
2006-09-11 Vladimir Olexa <vladimir.olexa@gmail.com>
Reviewed by Darin.
--- /dev/null
+test 1 passed: start before range, end before range
+test 2 passed: start before range, end on range start
+test 3 passed: start before range, end in range
+test 4 passed: start on range start, end in range
+test 5 passed: start in range, end in range
+test 6 passed: start in range, end on range end
+test 7 passed: start in range, end after range end
+test 8 passed: start on range end, end after range
+test 9 passed: start on range start, end on range end
+test 10 passed: start after range, end after range
+test 11 passed: start before range, end after range
+test 12 passed: start before range, end at range end
+test 13 passed: start at range start, end after range
+test 14 passed: detached range, attached node
+test 15 passed: attached range, detached node
+test 16 passed: the node has no parent
+test 17 passed: the range has no parent
+test 18 passed: wrong documents
+test 19 passed: deleted node
\ No newline at end of file
--- /dev/null
+<html>
+<head>
+<title>Test for Range.compareNode()</title>
+<script>
+function test()
+{
+ // This method returns one of the following constants:
+ // Node starts before the Range ( NODE_BEFORE = 0 )
+ // Node starts after the Range ( NODE_AFTER = 1 )
+ // Node starts before and ends after the Range ( NODE_BEFORE_AND_AFTER = 2 )
+ // Node starts after and ends before the Range, i.e. the Node is completely
+ // selected by the Range. ( NODE_INSIDE = 3 )
+
+ var range = document.createRange();
+
+ // test 1 - start before range, end before range
+ expectedResult = 0;
+ range.selectNode(document.getElementById("a2"));
+ result = range.compareNode(document.getElementById("b1"));
+ if (result == expectedResult)
+ document.getElementById("test1").innerHTML = "test 1 passed: start before range, end before range";
+
+ // test 2 - start before range, end on 1
+ expectedResult = 0;
+ range.setStart(document.getElementById("b2"), 1);
+ range.setEnd(document.getElementById("c2"), 1);
+ result = range.compareNode(document.getElementById("b2"));
+ if (result == expectedResult)
+ document.getElementById("test2").innerHTML = "test 2 passed: start before range, end on range start";
+
+ // test 3 - start before range, end in range
+ expectedResult = 0;
+ range.setStart(document.getElementById("b2"), 0);
+ range.setEnd(document.getElementById("c3"), 0);
+ result = range.compareNode(document.getElementById("a2"));
+ if (result == expectedResult)
+ document.getElementById("test3").innerHTML = "test 3 passed: start before range, end in range";
+
+ // test 4 - start on 0, end in range
+ expectedResult = 0;
+ range.setStart(document.getElementById("b2"), 0);
+ range.setEnd(document.getElementById("c2"),1);
+ result = range.compareNode(document.getElementById("b2"));
+ if (result == expectedResult)
+ document.getElementById("test4").innerHTML = "test 4 passed: start on range start, end in range";
+
+ // test 5 - start in range, end in range
+ expectedResult = 3;
+ range.selectNode(document.getElementById("a2"));
+ result = range.compareNode(document.getElementById("b2"));
+ if (result == expectedResult)
+ document.getElementById("test5").innerHTML = "test 5 passed: start in range, end in range";
+
+ // test 6 - start in range, end on 1
+ expectedResult = 1;
+ range.setStart(document.getElementById("b1"), 1);
+ range.setEnd(document.getElementById("c2"), 1);
+ result = range.compareNode( document.getElementById("c2"));
+ if (result == expectedResult)
+ document.getElementById("test6").innerHTML = "test 6 passed: start in range, end on range end";
+
+ // test 7 - start in range, end after range end
+ expectedResult = 1;
+ range.setStart(document.getElementById("b1"), 1);
+ range.setEnd(document.getElementById("c2"), 0);
+ result = range.compareNode( document.getElementById("c2"));
+ if (result == expectedResult)
+ document.getElementById("test7").innerHTML = "test 7 passed: start in range, end after range end";
+
+ // test 8 - start on 1, end after range
+ expectedResult = 1;
+ range.setStart(document.getElementById("b2"), 1);
+ range.setEnd(document.getElementById("c2"), 0);
+ result = range.compareNode( document.getElementById("c2"));
+ if (result == expectedResult)
+ document.getElementById("test8").innerHTML = "test 8 passed: start on range end, end after range";
+
+ // test 9 - start on range start, end on range end
+ expectedResult = 3;
+ range.selectNode(document.getElementById("a2"));
+ result = range.compareNode(document.getElementById("a2"));
+ if (result == expectedResult)
+ document.getElementById("test9").innerHTML = "test 9 passed: start on range start, end on range end";
+
+ // test 10 - start after range, end after range
+ expectedResult = 1;
+ range.selectNode(document.getElementById("b2"));
+ result = range.compareNode(document.getElementById("c3"));
+ if (result == expectedResult)
+ document.getElementById("test10").innerHTML = "test 10 passed: start after range, end after range";
+
+ // test 11 - start before range, end after range
+ expectedResult = 2;
+ range.selectNode(document.getElementById("b2"));
+ result = range.compareNode(document.getElementById("a2"));
+ if (result == expectedResult)
+ document.getElementById("test11").innerHTML = "test 11 passed: start before range, end after range";
+
+ // test 12 - start before range, end 1
+ expectedResult = 2;
+ range.setEnd(document.getElementById("c2"), 1);
+ range.setStart(document.getElementById("c2"), 1);
+ result = range.compareNode(document.getElementById("c2"));
+ if (result == expectedResult)
+ document.getElementById("test12").innerHTML = "test 12 passed: start before range, end at range end";
+
+ // test 13 - start at 0, end after range
+ expectedResult = 2;
+ range.setStart(document.getElementById("b2"), 0);
+ range.setEnd(document.getElementById("b2"), 1);
+ result = range.compareNode(document.getElementById("b2"));
+ if (result == expectedResult)
+ document.getElementById("test13").innerHTML = "test 13 passed: start at range start, end after range";
+
+ // test 14 - detached range, attached node
+ // firefox throws an exception and does not return a value
+ var detachedRange = document.createRange();
+ detachedRange.detach();
+ try {
+ result = detachedRange.compareNode(document.getElementById("a1"));
+ } catch (e) {
+ if(e.code == DOMException.INVALID_STATE_ERR) {
+ document.getElementById("test14").innerHTML = "test 14 passed: detached range, attached node";
+ } else {
+ document.getElementById("test14").innerHTML = "<span style=\"color: red;\">test 14 failed error: " + e.message + "</span>";
+ }
+ }
+
+ // test 15 - attached range, detached node
+ // firefox does not throw an exception and returns 0 for this test
+ expectedResult = 0;
+ range.selectNode(document.getElementById("a1"));
+ var node = document.getElementById("b1");
+ node.parentNode.removeChild(node);
+ result = range.compareNode(node);
+ if (result == expectedResult)
+ document.getElementById("test15").innerHTML = "test 15 passed: attached range, detached node";
+
+ // test 16 - node has no parent
+ range.selectNode(document.getElementById("a2"));
+ try {
+ result = range.compareNode(document);
+ } catch (e) {
+ if(e.code == DOMException.NOT_FOUND_ERR) {
+ document.getElementById("test16").innerHTML = "test 16 passed: the node has no parent";
+ } else {
+ document.getElementById("test16").innerHTML = "<span style=\"color: red;\">test 16 failed error: " + e.message + "</span>";
+ }
+ }
+
+ // test 17 - range has no parent
+ try {
+ range.selectNode(document);
+ } catch (e) {
+ if(e.code == RangeException.INVALID_NODE_TYPE_ERR) {
+ document.getElementById("test17").innerHTML = "test 17 passed: the range has no parent";
+ } else {
+ document.getElementById("test17").innerHTML = "<span style=\"color: red;\">test 17 failed error: " + e.message + "\n Code: " + e.code +"</span>";
+ }
+ }
+
+ // test 18 - wrong documents
+ // firefox does not throw an exception here instead it returns 0
+ exptectedResult = 0;
+ var src1 = "<html>\n<head>\n<body>\n<div id=f1>f1</div>\n</body>\n</head>\n<html>";
+ window.frames['frame1'].document.open("text/html", "replace");
+ window.frames['frame1'].document.write(src1);
+ window.frames['frame1'].document.close();
+
+ var src2 = "<html>\n<head>\n<body>\n<div id=f2>f2</div>\n</body>\n</head>\n<html>";
+ window.frames['frame2'].document.open("text/html", "replace");
+ window.frames['frame2'].document.write(src2);
+ window.frames['frame2'].document.close();
+
+ var framerange = window.frames['frame1'].document.createRange();
+ var F1Div = window.frames['frame1'].document.getElementById("f1");
+ framerange.selectNode(F1Div);
+
+ result = framerange.compareNode(window.frames['frame2'].document.getElementById("f2"));
+ if (result == expectedResult)
+ document.getElementById("test18").innerHTML = "test 18 passed: wrong documents";
+
+
+ // test 19 - node deleted
+ range.selectNode(document.getElementById("a2"));
+ var node = null;
+ try {
+ result = range.compareNode(node);
+ } catch (e) {
+ if(e.code == DOMException.NOT_FOUND_ERR) {
+ document.getElementById("test19").innerHTML = "test 19 passed: deleted node";
+ } else {
+ document.getElementById("test19").innerHTML = "<span style=\"color: red;\">test 19 failed error: " + e.message + "</span>";
+ }
+ }
+
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+}
+
+</script>
+</head>
+<body onload="test();">
+
+<!-- visible area with test results -->
+<div id=test1><span style="color: red;">test 1 failed</span></div>
+<div id=test2><span style="color: red;">test 2 failed</span></div>
+<div id=test3><span style="color: red;">test 3 failed</span></div>
+<div id=test4><span style="color: red;">test 4 failed</span></div>
+<div id=test5><span style="color: red;">test 5 failed</span></div>
+<div id=test6><span style="color: red;">test 6 failed</span></div>
+<div id=test7><span style="color: red;">test 7 failed</span></div>
+<div id=test8><span style="color: red;">test 8 failed</span></div>
+<div id=test9><span style="color: red;">test 9 failed</span></div>
+<div id=test10><span style="color: red;">test 10 failed</span></div>
+<div id=test11><span style="color: red;">test 11 failed</span></div>
+<div id=test12><span style="color: red;">test 12 failed</span></div>
+<div id=test13><span style="color: red;">test 13 failed</span></div>
+<div id=test14><span style="color: red;">test 14 failed</span></div>
+<div id=test15><span style="color: red;">test 15 failed</span></div>
+<div id=test16><span style="color: red;">test 16 failed</span></div>
+<div id=test17><span style="color: red;">test 17 failed</span></div>
+<div id=test18><span style="color: red;">test 18 failed</span></div>
+<div id=test19><span style="color: red;">test 19 failed</span></div>
+<!-- hidden area to create the ranges being tested -->
+<div style="visibility: hidden">
+ <div id=a1>a1
+ <div id=b1>b1</div>
+ <div id=c1>c1</div>
+ </div>
+
+ <div id=a2>a2
+ <div id=b2>b2</div>
+ <div id=c2>c2</div>
+ </div>
+ <div id=a3>a3
+ <div id=b3>b3</div>
+ <div id=c3>c3</div>
+ </div>
+
+ <iframe name="frame1" style="border: 1px solid black;"></iframe>
+ <iframe name="frame2" style="border: 1px solid black;"></iframe>
+</div>
+
+</body>
+</html>
// test 10 - attached range, detached node
// firefox does not throw an exception and returns -1 for this test
- // webkit will throw an exception.
expectedResult = -1;
range.selectNode(document.getElementById("a1"));
var node = document.getElementById("b1");
+2006-09-08 Kevin McCullough <KMcCullough@apple.com>
+
+ Reviewed by Darin.
+
+ - Implements comparePoint on the Range class
+
+ - Exposes RangeExceptions in JavaScript
+
+ * DerivedSources.make:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/kjs_binding.cpp:
+ * bindings/objc/DOMInternal.mm:
+ * dom/Range.cpp:
+ (WebCore::Range::comparePoint):
+ (WebCore::Range::compareNode):
+ * dom/Range.h:
+ (WebCore::Range::):
+ * dom/Range.idl:
+ * dom/RangeException.h: Added.
+ (WebCore::):
+ * dom/RangeException.idl: Added.
+ * page/DOMWindow.idl:
+
2006-09-11 Adam Roben <aroben@apple.com>
Reviewed by timo.
(WebCore::CSSParser::parseSVGPaint):
(WebCore::CSSParser::parseSVGColor):
+>>>>>>> .r16300
2006-09-07 Sam Weinig <sam.weinig@gmail.com>
Reviewed by Darin and Tim H.
JSOverflowEvent.h \
JSProcessingInstruction.h \
JSRange.h \
+ JSRangeException.h \
JSSVGAngle.h \
JSSVGAnimatedLength.h \
JSSVGAnimatedNumber.h \
D086FE9909D53AAB005BC74D /* UnlinkCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D086FE9709D53AAB005BC74D /* UnlinkCommand.cpp */; };
D0B0556809C6700100307E43 /* CreateLinkCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = D0B0556609C6700100307E43 /* CreateLinkCommand.h */; };
D0B0556909C6700100307E43 /* CreateLinkCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0B0556709C6700100307E43 /* CreateLinkCommand.cpp */; };
+ D23CA55D0AB0EAAE005108A5 /* JSRangeException.h in Headers */ = {isa = PBXBuildFile; fileRef = D23CA55C0AB0EAAE005108A5 /* JSRangeException.h */; };
+ D23CA55F0AB0EAB6005108A5 /* JSRangeException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D23CA55E0AB0EAB6005108A5 /* JSRangeException.cpp */; };
+ D23CA56C0AB0EB8D005108A5 /* RangeException.h in Headers */ = {isa = PBXBuildFile; fileRef = D23CA56B0AB0EB8D005108A5 /* RangeException.h */; };
DB23C2CB0A508D29002489EB /* IndentOutdentCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DB23C2C90A508D29002489EB /* IndentOutdentCommand.cpp */; };
DB23C2CC0A508D29002489EB /* IndentOutdentCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = DB23C2CA0A508D29002489EB /* IndentOutdentCommand.h */; };
DD763BB20992C2C900740B8E /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = DD763BB10992C2C900740B8E /* libxml2.dylib */; };
D086FE9709D53AAB005BC74D /* UnlinkCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UnlinkCommand.cpp; sourceTree = "<group>"; };
D0B0556609C6700100307E43 /* CreateLinkCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CreateLinkCommand.h; sourceTree = "<group>"; };
D0B0556709C6700100307E43 /* CreateLinkCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CreateLinkCommand.cpp; sourceTree = "<group>"; };
+ D23CA5480AB0E983005108A5 /* RangeException.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = RangeException.idl; sourceTree = "<group>"; };
+ D23CA55C0AB0EAAE005108A5 /* JSRangeException.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = JSRangeException.h; path = /Build/symroots/Debug/DerivedSources/WebCore/JSRangeException.h; sourceTree = "<absolute>"; };
+ D23CA55E0AB0EAB6005108A5 /* JSRangeException.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = JSRangeException.cpp; path = /Build/symroots/Debug/DerivedSources/WebCore/JSRangeException.cpp; sourceTree = "<absolute>"; };
+ D23CA56B0AB0EB8D005108A5 /* RangeException.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RangeException.h; sourceTree = "<group>"; };
DB23C2C90A508D29002489EB /* IndentOutdentCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IndentOutdentCommand.cpp; sourceTree = "<group>"; };
DB23C2CA0A508D29002489EB /* IndentOutdentCommand.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IndentOutdentCommand.h; sourceTree = "<group>"; };
DD763BB10992C2C900740B8E /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = /usr/lib/libxml2.dylib; sourceTree = "<absolute>"; };
65DF31EC09D1CC60000BE325 /* JSProcessingInstruction.h */,
65DF31ED09D1CC60000BE325 /* JSRange.cpp */,
65DF31EE09D1CC60000BE325 /* JSRange.h */,
+ D23CA55E0AB0EAB6005108A5 /* JSRangeException.cpp */,
+ D23CA55C0AB0EAAE005108A5 /* JSRangeException.h */,
A833C0F20A2C513300D57664 /* JSSVGAngle.cpp */,
A833C0F00A2C513300D57664 /* JSSVGAngle.h */,
A833C0F10A2C513300D57664 /* JSSVGAnimatedLength.cpp */,
F523D30302DE4476018635CA /* Range.cpp */,
F523D30402DE4476018635CA /* Range.h */,
936DD03A09CEAC270056AE8C /* Range.idl */,
+ D23CA56B0AB0EB8D005108A5 /* RangeException.h */,
+ D23CA5480AB0E983005108A5 /* RangeException.idl */,
85031B350A44EFC700F992E0 /* RegisteredEventListener.cpp */,
85031B360A44EFC700F992E0 /* RegisteredEventListener.h */,
A8C4A7EC09D563270003AC8D /* StyledElement.cpp */,
852B9E870AA79C47002ADA6E /* DOMHTMLAppletElement.h in Headers */,
852B9E890AA79C47002ADA6E /* DOMHTMLOptionElement.h in Headers */,
1A98955D0AA78149005EF5EF /* CString.h in Headers */,
+ D23CA55D0AB0EAAE005108A5 /* JSRangeException.h in Headers */,
+ D23CA56C0AB0EB8D005108A5 /* RangeException.h in Headers */,
932CA7C10AAA20C100AD1FAD /* TextCodecLatin1.h in Headers */,
932CA83B0AAA667F00AD1FAD /* TextCodecUTF16.h in Headers */,
85032DD70AA8C9BE007D3B7D /* DOMCSSCharsetRule.h in Headers */,
852B9E8A0AA79C47002ADA6E /* DOMHTMLOptionElement.mm in Sources */,
1A98955C0AA78149005EF5EF /* CString.cpp in Sources */,
1A98956B0AA78F80005EF5EF /* KURLCFNet.cpp in Sources */,
+ D23CA55F0AB0EAB6005108A5 /* JSRangeException.cpp in Sources */,
932CA7650AAA1DF500AD1FAD /* TextDecoder.cpp in Sources */,
932CA7C50AAA20D200AD1FAD /* TextCodecLatin1.cpp in Sources */,
932CA8480AAA66CB00AD1FAD /* TextCodecUTF16.cpp in Sources */,
#include "Frame.h"
#include "PlatformString.h"
#include "Range.h"
+#include "RangeException.h"
#include "XPathEvaluator.h"
#include "kjs_dom.h"
#include "kjs_window.h"
#import "Event.h"
#import "FrameMac.h"
#import "Range.h"
-#import "kjs_dom.h"
-#import "kjs_proxy.h"
+#import "RangeException.h"
#import "WebScriptObjectPrivate.h"
#import "XPathEvaluator.h"
+#import "kjs_dom.h"
+#import "kjs_proxy.h"
using namespace WebCore;
#include "HTMLElement.h"
#include "HTMLNames.h"
#include "ProcessingInstruction.h"
+#include "RangeException.h"
#include "RenderBlock.h"
#include "TextIterator.h"
#include "markup.h"
}
if (!m_detached && !refNode->attached()) {
- // firefox doesn't throw an exception for this case; it returns 1
+ // firefox doesn't throw an exception for this case; it returns -1
return -1;
}
return 0;
}
+Range::CompareResults Range::compareNode(Node* refNode, ExceptionCode& ec)
+{
+ // http://developer.mozilla.org/en/docs/DOM:range.compareNode
+ // This method returns 0, 1, 2, or 3 based on if the node is before, after,
+ // before and after(surrounds), or inside the range, respectively
+
+ if (!refNode) {
+ ec = NOT_FOUND_ERR;
+ return NODE_BEFORE;
+ }
+
+ if (m_detached && refNode->attached()) {
+ ec = INVALID_STATE_ERR;
+ return NODE_BEFORE;
+ }
+
+ if (!m_detached && !refNode->attached()) {
+ // firefox doesn't throw an exception for this case; it returns 0
+ return NODE_BEFORE;
+ }
+
+ if (refNode->document() != m_ownerDocument) {
+ // firefox doesn't throw an exception for this case; it returns 0
+ return NODE_BEFORE;
+ }
+
+ Node* parentNode = refNode->parentNode();
+ unsigned nodeIndex = refNode->nodeIndex();
+
+ if (!parentNode) {
+ // if the node is the top document we should return NODE_BEFORE_AND_AFTER
+ // but we throw to match firefox behavior
+ ec = NOT_FOUND_ERR;
+ return NODE_BEFORE;
+ }
+
+ if (comparePoint(parentNode, nodeIndex, ec) == -1) { // starts before
+ if (comparePoint(parentNode, nodeIndex + 1, ec) == 1) // ends after the range
+ return NODE_BEFORE_AND_AFTER;
+ return NODE_BEFORE; // ends before or in the range
+ } else { // starts at or after the range start
+ if (comparePoint(parentNode, nodeIndex + 1, ec) == 1) // ends after the range
+ return NODE_AFTER;
+ return NODE_INSIDE; // ends inside the range
+ }
+}
+
short Range::compareBoundaryPoints(CompareHow how, const Range *sourceRange, ExceptionCode& ec) const
{
class Position;
class String;
-const int RangeExceptionOffset = 200;
-const int RangeExceptionMax = 299;
-enum RangeExceptionCode { BAD_BOUNDARYPOINTS_ERR = RangeExceptionOffset + 1, INVALID_NODE_TYPE_ERR };
-
class Range : public Shared<Range>
{
public:
void collapse(bool toStart, ExceptionCode&);
bool isPointInRange(Node* refNode, int offset, ExceptionCode& ec);
short comparePoint(Node* refNode, int offset, ExceptionCode& ec);
+ enum CompareResults { NODE_BEFORE, NODE_AFTER, NODE_BEFORE_AND_AFTER, NODE_INSIDE };
+ CompareResults compareNode(Node* refNode, ExceptionCode&);
enum CompareHow { START_TO_START, START_TO_END, END_TO_END, END_TO_START };
short compareBoundaryPoints(CompareHow, const Range* sourceRange, ExceptionCode&) const;
static short compareBoundaryPoints(Node* containerA, int offsetA, Node* containerB, int offsetB);
[OldStyleObjC] short compareBoundaryPoints(in CompareHow how,
in Range sourceRange)
raises(dom::DOMException);
+
+ short compareNode(in Node refNode)
+ raises(RangeException, dom::DOMException);
+
+ // CompareResults
+ const unsigned short NODE_BEFORE = 0;
+ const unsigned short NODE_AFTER = 1;
+ const unsigned short NODE_BEFORE_AND_AFTER = 2;
+ const unsigned short NODE_INSIDE = 3;
+
short comparePoint(in Node refNode,
in long offset)
raises(RangeException, dom::DOMException);
--- /dev/null
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * (C) 1999 Lars Knoll (knoll@kde.org)
+ * (C) 2000 Gunnstein Lye (gunnstein@netcom.no)
+ * (C) 2000 Frederik Holljen (frederik.holljen@hig.no)
+ * (C) 2001 Peter Kelly (pmk@post.com)
+ * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef RangeException_h
+#define RangeException_h
+
+#include "Shared.h"
+
+namespace WebCore {
+
+const int RangeExceptionOffset = 200;
+const int RangeExceptionMax = 299;
+enum RangeExceptionCode { BAD_BOUNDARYPOINTS_ERR = RangeExceptionOffset + 1, INVALID_NODE_TYPE_ERR };
+
+class RangeException : public Shared<RangeException> {
+public :
+ static const unsigned short BAD_BOUNDARYPOINTS_ERR = 1;
+ static const unsigned short INVALID_NODE_TYPE_ERR = 2;
+};
+
+} // namespace
+
+#endif
--- /dev/null
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+module ranges {
+
+ interface [GenerateConstructor] RangeException {
+
+ // DOM Level 2
+
+ const unsigned short BAD_BOUNDARYPOINTS_ERR = 1;
+ const unsigned short INVALID_NODE_TYPE_ERR = 2;
+ };
+}
attribute NodeConstructor Node;
attribute NodeFilterConstructor NodeFilter;
attribute RangeConstructor Range;
+ attribute RangeExceptionConstructor RangeException;
// Mozilla has a separate XMLDocument object for XML documents.
// We just use Document for this.