WebCore:
authorthatcher <thatcher@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Sep 2006 19:04:09 +0000 (19:04 +0000)
committerthatcher <thatcher@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Sep 2006 19:04:09 +0000 (19:04 +0000)
        Reviewed by Brady.

        - Deprecate the rest of the old-style methods that are not generated.
        - Add @property syntax to DOMRange.

        * WebCore.xcodeproj/project.pbxproj:
        * bindings/objc/DOM.mm:
        (-[DOMRange setStart:offset:]):
        (-[DOMRange setEnd:offset:]):
        (-[DOMRange compareBoundaryPoints:sourceRange:]):
        (-[DOMRange setStart::]):
        (-[DOMRange setEnd::]):
        (-[DOMRange compareBoundaryPoints::]):
        (-[DOMDocument createNodeIterator:whatToShow:filter:expandEntityReferences:]):
        (-[DOMDocument createTreeWalker:whatToShow:filter:expandEntityReferences:]):
        (-[DOMDocument createNodeIterator::::]):
        (-[DOMDocument createTreeWalker::::]):
        * bindings/objc/DOMCSS.h:
        * bindings/objc/DOMCSS.mm:
        (-[DOMDocument getComputedStyle:pseudoElement:]):
        (-[DOMDocument getComputedStyle::]):
        (-[DOMDocument getMatchedCSSRules:pseudoElement:]):
        * bindings/objc/DOMExtensions.h:
        * bindings/objc/DOMHTML.h:
        * bindings/objc/DOMRange.h:
        * bindings/objc/DOMTraversal.h:

WebKit:

        Reviewed by Brady.

        Use the non-deprecated method names for getComputedStyle, setEnd and setStart.

        * WebInspector/WebInspector.m:
        (-[WebInspector _highlightNode:]):
        * WebView/WebHTMLView.m:
        (unionDOMRanges):
        (-[WebHTMLView _selectRangeInMarkedText:]):
        (-[WebTextCompleteController doCompletion]):
        * WebView/WebView.m:
        (-[WebView computedStyleForElement:pseudoElement:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16559 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/objc/DOM.mm
WebCore/bindings/objc/DOMCSS.h
WebCore/bindings/objc/DOMCSS.mm
WebCore/bindings/objc/DOMExtensions.h
WebCore/bindings/objc/DOMHTML.h
WebCore/bindings/objc/DOMRange.h
WebCore/bindings/objc/DOMTraversal.h
WebKit/ChangeLog
WebKit/WebInspector/WebInspector.m
WebKit/WebView/WebHTMLView.m
WebKit/WebView/WebView.m

index 3af8c4cbca15db82483966f12b1f1aff65c0f4d2..07b2dfaeb0dab98c57b07d7bf71d15b9a2fb35b0 100644 (file)
@@ -1,3 +1,32 @@
+2006-09-25  Timothy Hatcher  <timothy@apple.com>
+
+        Reviewed by Brady.
+
+        - Deprecate the rest of the old-style methods that are not generated.
+        - Add @property syntax to DOMRange.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/objc/DOM.mm:
+        (-[DOMRange setStart:offset:]):
+        (-[DOMRange setEnd:offset:]):
+        (-[DOMRange compareBoundaryPoints:sourceRange:]):
+        (-[DOMRange setStart::]):
+        (-[DOMRange setEnd::]):
+        (-[DOMRange compareBoundaryPoints::]):
+        (-[DOMDocument createNodeIterator:whatToShow:filter:expandEntityReferences:]):
+        (-[DOMDocument createTreeWalker:whatToShow:filter:expandEntityReferences:]):
+        (-[DOMDocument createNodeIterator::::]):
+        (-[DOMDocument createTreeWalker::::]):
+        * bindings/objc/DOMCSS.h:
+        * bindings/objc/DOMCSS.mm:
+        (-[DOMDocument getComputedStyle:pseudoElement:]):
+        (-[DOMDocument getComputedStyle::]):
+        (-[DOMDocument getMatchedCSSRules:pseudoElement:]):
+        * bindings/objc/DOMExtensions.h:
+        * bindings/objc/DOMHTML.h:
+        * bindings/objc/DOMRange.h:
+        * bindings/objc/DOMTraversal.h:
+
 2006-09-25  Eric Seidel  <eric@eseidel.com>
 
         Reviewed by mjs.
index 8c2ba11775534e621b0314c54bba9cdd86230039..3d05a65fd7aae8e92c34adfcf4a7ed59879300aa 100644 (file)
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
+                       compatibilityVersion = "Xcode 2.4";
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
                        mainGroup = 0867D691FE84028FC02AAC07 /* WebKit */;
                        productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
                        projectDirPath = "";
+                       projectRoot = "";
+                       shouldCheckCompatibility = 1;
                        targets = (
                                93F198A508245E59001E9ABC /* WebCore */,
                                DD041FBE09D9DDBE0010AF2A /* Derived Sources */,
index 7c087c97033f60b3b1f405f2598e1780295c0253..417f866d7b9c41feca8ef60085483a0bd9cdaf4a 100644 (file)
@@ -588,14 +588,14 @@ static Class elementClass(const WebCore::AtomicString& tagName)
     return result;
 }
 
-- (void)setStart:(DOMNode *)refNode :(int)offset
+- (void)setStart:(DOMNode *)refNode offset:(int)offset
 {
     WebCore::ExceptionCode ec = 0;
     [self _range]->setStart([refNode _node], offset, ec);
     raiseOnDOMError(ec);
 }
 
-- (void)setEnd:(DOMNode *)refNode :(int)offset
+- (void)setEnd:(DOMNode *)refNode offset:(int)offset
 {
     WebCore::ExceptionCode ec = 0;
     [self _range]->setEnd([refNode _node], offset, ec);
@@ -651,7 +651,7 @@ static Class elementClass(const WebCore::AtomicString& tagName)
     raiseOnDOMError(ec);
 }
 
-- (short)compareBoundaryPoints:(unsigned short)how :(DOMRange *)sourceRange
+- (short)compareBoundaryPoints:(unsigned short)how sourceRange:(DOMRange *)sourceRange
 {
     WebCore::ExceptionCode ec = 0;
     short result = [self _range]->compareBoundaryPoints(static_cast<WebCore::Range::CompareHow>(how), [sourceRange _range], ec);
@@ -726,6 +726,25 @@ static Class elementClass(const WebCore::AtomicString& tagName)
 
 @end
 
+@implementation DOMRange (DOMRangeDeprecated)
+
+- (void)setStart:(DOMNode *)refNode :(int)offset
+{
+    [self setStart:refNode offset:offset];
+}
+
+- (void)setEnd:(DOMNode *)refNode :(int)offset
+{
+    [self setEnd:refNode offset:offset];
+}
+
+- (short)compareBoundaryPoints:(unsigned short)how :(DOMRange *)sourceRange
+{
+    return [self compareBoundaryPoints:how sourceRange:sourceRange];
+}
+
+@end
+
 @implementation DOMRange (WebCoreInternal)
 
 - (id)_initWithRange:(WebCore::Range *)impl
@@ -943,7 +962,7 @@ short ObjCNodeFilterCondition::acceptNode(WebCore::Node* node) const
 // FIXME: this should be auto-genenerate in DOMDocument.mm
 @implementation DOMDocument (DOMDocumentTraversal)
 
-- (DOMNodeIterator *)createNodeIterator:(DOMNode *)root :(unsigned)whatToShow :(id <DOMNodeFilter>)filter :(BOOL)expandEntityReferences
+- (DOMNodeIterator *)createNodeIterator:(DOMNode *)root whatToShow:(unsigned)whatToShow filter:(id <DOMNodeFilter>)filter expandEntityReferences:(BOOL)expandEntityReferences
 {
     RefPtr<WebCore::NodeFilter> cppFilter;
     if (filter)
@@ -954,7 +973,7 @@ short ObjCNodeFilterCondition::acceptNode(WebCore::Node* node) const
     return [DOMNodeIterator _nodeIteratorWith:impl.get() filter:filter];
 }
 
-- (DOMTreeWalker *)createTreeWalker:(DOMNode *)root :(unsigned)whatToShow :(id <DOMNodeFilter>)filter :(BOOL)expandEntityReferences
+- (DOMTreeWalker *)createTreeWalker:(DOMNode *)root whatToShow:(unsigned)whatToShow filter:(id <DOMNodeFilter>)filter expandEntityReferences:(BOOL)expandEntityReferences
 {
     RefPtr<WebCore::NodeFilter> cppFilter;
     if (filter)
@@ -967,6 +986,19 @@ short ObjCNodeFilterCondition::acceptNode(WebCore::Node* node) const
 
 @end
 
+@implementation DOMDocument (DOMDocumentTraversalDeprecated)
+
+- (DOMNodeIterator *)createNodeIterator:(DOMNode *)root :(unsigned)whatToShow :(id <DOMNodeFilter>)filter :(BOOL)expandEntityReferences
+{
+    return [self createNodeIterator:root whatToShow:whatToShow filter:filter expandEntityReferences:expandEntityReferences];
+}
+
+- (DOMTreeWalker *)createTreeWalker:(DOMNode *)root :(unsigned)whatToShow :(id <DOMNodeFilter>)filter :(BOOL)expandEntityReferences
+{
+    return [self createTreeWalker:root whatToShow:whatToShow filter:filter expandEntityReferences:expandEntityReferences];
+}
+
+@end
 
 //------------------------------------------------------------------------------------------
 // ObjCEventListener
index ab79a5b919928ee2cc4c4fb6cf0644d06bc0e251..3da866fb3ba9ef104b717a4bbd164e27780352f9 100644 (file)
 #import <WebCore/DOMRect.h>
 
 @interface DOMDocument (DOMViewCSS)
+- (DOMCSSStyleDeclaration *)getComputedStyle:(DOMElement *)element pseudoElement:(NSString *)pseudoElement;
+@end
+
+@interface DOMDocument (DOMViewCSSDeprecated)
+#ifndef BUILDING_ON_TIGER
+- (DOMCSSStyleDeclaration *)getComputedStyle:(DOMElement *)elt :(NSString *)pseudoElt DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
+#else
 - (DOMCSSStyleDeclaration *)getComputedStyle:(DOMElement *)elt :(NSString *)pseudoElt;
+#endif
 @end
 
 @interface DOMCSSStyleDeclaration (DOMCSS2Properties)
index be7c6d7cf47a0d9a104af011a05f91efd54194a0..618853fbb4ec2cc8ddfd01393135d0939cc84ebb 100644 (file)
@@ -1460,21 +1460,30 @@ namespace WebCore {
 
 @implementation DOMDocument (DOMViewCSS)
 
-- (DOMCSSStyleDeclaration *)getComputedStyle:(DOMElement *)elt :(NSString *)pseudoElt
+- (DOMCSSStyleDeclaration *)getComputedStyle:(DOMElement *)element pseudoElement:(NSString *)pseudoElement
 {
     WebCore::AbstractView* dv = [self _document]->defaultView();
 
     if (!dv)
         return nil;
     
-    return [DOMCSSStyleDeclaration _CSSStyleDeclarationWith:WTF::getPtr(dv->getComputedStyle([elt _element], pseudoElt))];
+    return [DOMCSSStyleDeclaration _CSSStyleDeclarationWith:WTF::getPtr(dv->getComputedStyle([element _element], pseudoElement))];
+}
+
+@end
+
+@implementation DOMDocument (DOMViewCSSDeprecated)
+
+- (DOMCSSStyleDeclaration *)getComputedStyle:(DOMElement *)elt :(NSString *)pseudoElt
+{
+    return [self getComputedStyle:elt pseudoElement:pseudoElt];
 }
 
 @end
 
 @implementation DOMDocument (DOMDocumentCSSExtensions)
 
-- (DOMCSSRuleList *)getMatchedCSSRules:(DOMElement *)elt :(NSString *)pseudoElt
+- (DOMCSSRuleList *)getMatchedCSSRules:(DOMElement *)element pseudoElement:(NSString *)pseudoElement
 {
     WebCore::AbstractView* dv = [self _document]->defaultView();
 
@@ -1482,7 +1491,7 @@ namespace WebCore {
         return nil;
     
     // The parameter of "false" is handy for the DOM inspector and lets us see user agent and user rules.
-    return [DOMCSSRuleList _CSSRuleListWith:WTF::getPtr(dv->getMatchedCSSRules([elt _element], pseudoElt, false))];
+    return [DOMCSSRuleList _CSSRuleListWith:WTF::getPtr(dv->getMatchedCSSRules([element _element], pseudoElement, false))];
 }
 
 @end
index 272fec97a4852ca54919d95534feaaa96659fc21..d2484922956c58c51a4d9f295e9de1afdcc6619c 100644 (file)
@@ -51,7 +51,7 @@
 @end
 
 @interface DOMDocument (DOMDocumentCSSExtensions)
-- (DOMCSSRuleList *)getMatchedCSSRules:(DOMElement *)elt :(NSString *)pseudoElt;
+- (DOMCSSRuleList *)getMatchedCSSRules:(DOMElement *)element pseudoElement:(NSString *)pseudoElement;
 @end
 
 @interface DOMElement (DOMElementAppKitExtensions)
index fb09597bc3e3313934af30177bee04df63cc8ff3..ef6bc436c5fe8fa35ee6ef24cd64990cf2919a4e 100644 (file)
@@ -40,6 +40,7 @@
 #import <WebCore/DOMHTMLDivElement.h>
 #import <WebCore/DOMHTMLDocument.h>
 #import <WebCore/DOMHTMLElement.h>
+#import <WebCore/DOMHTMLEmbedElement.h>
 #import <WebCore/DOMHTMLFieldSetElement.h>
 #import <WebCore/DOMHTMLFontElement.h>
 #import <WebCore/DOMHTMLFormElement.h>
@@ -82,6 +83,3 @@
 #import <WebCore/DOMHTMLTextAreaElement.h>
 #import <WebCore/DOMHTMLTitleElement.h>
 #import <WebCore/DOMHTMLUListElement.h>
-
-// was an HTML extension
-#import <WebCore/DOMHTMLEmbedElement.h>
index 2162d18e5bb9413bff0db9fea60161f77bfc57a8..2407d67388e5e06ca39b48cf927cd9109e68eb22 100644 (file)
@@ -27,7 +27,6 @@
 #import <WebCore/DOMCore.h>
 #import <WebCore/DOMDocument.h>
 #import <WebCore/DOMObject.h>
-
 #import <WebCore/DOMRangeException.h>
 
 // DOM Range comparison codes
@@ -39,14 +38,23 @@ enum {
 };
 
 @interface DOMRange : DOMObject
+#ifndef BUILDING_ON_TIGER
+@property(readonly) DOMNode *startContainer;
+@property(readonly) int startOffset;
+@property(readonly) DOMNode *endContainer;
+@property(readonly) int endOffset;
+@property(readonly) BOOL collapsed;
+@property(readonly) DOMNode *commonAncestorContainer;
+#else
 - (DOMNode *)startContainer;
 - (int)startOffset;
 - (DOMNode *)endContainer;
 - (int)endOffset;
 - (BOOL)collapsed;
 - (DOMNode *)commonAncestorContainer;
-- (void)setStart:(DOMNode *)refNode :(int)offset;
-- (void)setEnd:(DOMNode *)refNode :(int)offset;
+#endif
+- (void)setStart:(DOMNode *)refNode offset:(int)offset;
+- (void)setEnd:(DOMNode *)refNode offset:(int)offset;
 - (void)setStartBefore:(DOMNode *)refNode;
 - (void)setStartAfter:(DOMNode *)refNode;
 - (void)setEndBefore:(DOMNode *)refNode;
@@ -54,7 +62,7 @@ enum {
 - (void)collapse:(BOOL)toStart;
 - (void)selectNode:(DOMNode *)refNode;
 - (void)selectNodeContents:(DOMNode *)refNode;
-- (short)compareBoundaryPoints:(unsigned short)how :(DOMRange *)sourceRange;
+- (short)compareBoundaryPoints:(unsigned short)how sourceRange:(DOMRange *)sourceRange;
 - (void)deleteContents;
 - (DOMDocumentFragment *)extractContents;
 - (DOMDocumentFragment *)cloneContents;
@@ -64,3 +72,15 @@ enum {
 - (NSString *)toString;
 - (void)detach;
 @end
+
+@interface DOMRange (DOMRangeDeprecated)
+#ifndef BUILDING_ON_TIGER
+- (void)setStart:(DOMNode *)refNode :(int)offset DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
+- (void)setEnd:(DOMNode *)refNode :(int)offset DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
+- (short)compareBoundaryPoints:(unsigned short)how :(DOMRange *)sourceRange DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
+#else
+- (void)setStart:(DOMNode *)refNode :(int)offset;
+- (void)setEnd:(DOMNode *)refNode :(int)offset;
+- (short)compareBoundaryPoints:(unsigned short)how :(DOMRange *)sourceRange;
+#endif
+@end
index 2222cbde6c017271ad41ae4c0a67925cb4a1e91e..e2d291eca11a1e1884106484137cb2e86108e0a2 100644 (file)
 #import <WebCore/DOMTreeWalker.h>
 
 @interface DOMDocument (DOMDocumentTraversal)
+- (DOMNodeIterator *)createNodeIterator:(DOMNode *)root whatToShow:(unsigned)whatToShow filter:(id <DOMNodeFilter>)filter expandEntityReferences:(BOOL)expandEntityReferences;
+- (DOMTreeWalker *)createTreeWalker:(DOMNode *)root whatToShow:(unsigned)whatToShow filter:(id <DOMNodeFilter>)filter expandEntityReferences:(BOOL)expandEntityReferences;
+@end
+
+@interface DOMDocument (DOMDocumentTraversalDeprecated)
+#ifndef BUILDING_ON_TIGER
+- (DOMNodeIterator *)createNodeIterator:(DOMNode *)root :(unsigned)whatToShow :(id <DOMNodeFilter>)filter :(BOOL)expandEntityReferences DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
+- (DOMTreeWalker *)createTreeWalker:(DOMNode *)root :(unsigned)whatToShow :(id <DOMNodeFilter>)filter :(BOOL)expandEntityReferences DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
+#else
 - (DOMNodeIterator *)createNodeIterator:(DOMNode *)root :(unsigned)whatToShow :(id <DOMNodeFilter>)filter :(BOOL)expandEntityReferences;
 - (DOMTreeWalker *)createTreeWalker:(DOMNode *)root :(unsigned)whatToShow :(id <DOMNodeFilter>)filter :(BOOL)expandEntityReferences;
+#endif
 @end
index 6e70404b0d8c8b77f9c5e5c72545a18c70cb0a09..4b2711d6b22b99a68b21de4fb4c620cf0464d75a 100644 (file)
@@ -1,3 +1,18 @@
+2006-09-25  Timothy Hatcher  <timothy@apple.com>
+
+        Reviewed by Brady.
+
+        Use the non-deprecated method names for getComputedStyle, setEnd and setStart.
+
+        * WebInspector/WebInspector.m:
+        (-[WebInspector _highlightNode:]):
+        * WebView/WebHTMLView.m:
+        (unionDOMRanges):
+        (-[WebHTMLView _selectRangeInMarkedText:]):
+        (-[WebTextCompleteController doCompletion]):
+        * WebView/WebView.m:
+        (-[WebView computedStyleForElement:pseudoElement:]):
+
 2006-09-22  Timothy Hatcher  <timothy@apple.com>
 
         Reviewed by Darin.
index 41e7149ea7e27a97c3da9aa44fc4caeb39fb25bc..b527c86a47b1cb3454d485e1b1770026225a00a6 100644 (file)
@@ -543,7 +543,7 @@ static NSMapTable *lastChildIgnoringWhitespaceCache = NULL;
     if (!NSIsEmptyRect(bounds)) {
         NSArray *rects = nil;
         if ([node isKindOfClass:[DOMElement class]]) {
-            DOMCSSStyleDeclaration *style = [_private->domDocument getComputedStyle:(DOMElement *)node :@""];
+            DOMCSSStyleDeclaration *style = [_private->domDocument getComputedStyle:(DOMElement *)node pseudoElement:@""];
             if ([[style getPropertyValue:@"display"] isEqualToString:@"inline"])
                 rects = [node lineBoxRects];
         } else if ([node isKindOfClass:[DOMText class]])
index ec7f9a01d7154e285ffbe1cff51780810d65bf61..997b2c6c9f81d0373cca1187570e2bff884e8d62 100644 (file)
@@ -4593,11 +4593,11 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
 {
     ASSERT(a);
     ASSERT(b);
-    DOMRange *s = [a compareBoundaryPoints:DOM_START_TO_START :b] <= 0 ? a : b;
-    DOMRange *e = [a compareBoundaryPoints:DOM_END_TO_END :b] <= 0 ? b : a;
+    DOMRange *s = [a compareBoundaryPoints:DOM_START_TO_START sourceRange:b] <= 0 ? a : b;
+    DOMRange *e = [a compareBoundaryPoints:DOM_END_TO_END sourceRange:b] <= 0 ? b : a;
     DOMRange *r = [[[a startContainer] ownerDocument] createRange];
-    [r setStart:[s startContainer] :[s startOffset]];
-    [r setEnd:[e endContainer] :[e endOffset]];
+    [r setStart:[s startContainer] offset:[s startOffset]];
+    [r setEnd:[e endContainer] offset:[e endOffset]];
     return r;
 }
 
@@ -5154,8 +5154,8 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
     unsigned selectionStart = [markedTextRange startOffset] + range.location;
     unsigned selectionEnd = selectionStart + range.length;
 
-    [selectedRange setStart:[markedTextRange startContainer] :selectionStart];
-    [selectedRange setEnd:[markedTextRange startContainer] :selectionEnd];
+    [selectedRange setStart:[markedTextRange startContainer] offset:selectionStart];
+    [selectedRange setEnd:[markedTextRange startContainer] offset:selectionEnd];
 
     [bridge setSelectedDOMRange:selectedRange affinity:NSSelectionAffinityDownstream closeTyping:NO];
 }
@@ -5455,7 +5455,7 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
         DOMRange *selection = [bridge selectedDOMRange];
         DOMRange *wholeWord = [bridge rangeByAlteringCurrentSelection:WebSelectByExtending direction:WebBridgeSelectBackward granularity:WebBridgeSelectByWord];
         DOMRange *prefix = [wholeWord cloneRange];
-        [prefix setEnd:[selection startContainer] :[selection startOffset]];
+        [prefix setEnd:[selection startContainer] offset:[selection startOffset]];
 
         // Reject some NOP cases
         if ([prefix collapsed]) {
index 37efa4fd320a13c87fd01374336b5de60c73e5e1..4903f6dc31564cbda940efd37ebcd4cd5d29f9b5 100644 (file)
@@ -3049,7 +3049,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
     if (pseudoElement == nil) {
         pseudoElement = @"";
     }
-    return [[element ownerDocument] getComputedStyle:element :pseudoElement];
+    return [[element ownerDocument] getComputedStyle:element pseudoElement:pseudoElement];
 }
 
 @end