Commit 2a6da87c authored by thatcher's avatar thatcher
Browse files

WebCore:

        Reviewed by Darin.

        Bug 9820: Move new DOM API that has been through API review to public headers
        http://bugzilla.opendarwin.org/show_bug.cgi?id=9820

        * bindings/objc/DOM.mm:
        (-[DOMElement focus]):
        (-[DOMElement blur]):
        (-[DOMRange text]):
        (-[DOMRange _text]):
        * bindings/objc/DOMCSS.mm:
        (-[DOMRGBColor color]):
        (-[DOMRGBColor _color]):
        * bindings/objc/DOMCore.h:
        * bindings/objc/DOMEvents.h:
        * bindings/objc/DOMExtensions.h:
        * bindings/objc/DOMHTML.mm:
        (-[DOMHTMLElement titleDisplayString]):
        (-[DOMHTMLDocument createDocumentFragmentWithMarkupString:baseURL:]):
        (-[DOMHTMLDocument createDocumentFragmentWithText:]):
        (-[DOMHTMLDocument _createDocumentFragmentWithMarkupString:baseURLString:]):
        (-[DOMHTMLDocument _createDocumentFragmentWithText:]):
        * bindings/objc/DOMPrivate.h:
        * bindings/objc/DOMXPath.h:
        * bindings/objc/DOMXPath.mm:

WebKit:

        Reviewed by Darin.

        Bug 9820: Move new DOM API that has been through API review to public headers
        http://bugzilla.opendarwin.org/show_bug.cgi?id=9820

        * Misc/WebElementDictionary.m: include DOMExtensions.h
        * Misc/WebNSViewExtras.m: include DOMExtensions.h
        * WebKit.xcodeproj/project.pbxproj: make DOMXPath.h public



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15276 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent df75d5c6
2006-07-09 Timothy Hatcher <timothy@apple.com>
Reviewed by Darin.
Bug 9820: Move new DOM API that has been through API review to public headers
http://bugzilla.opendarwin.org/show_bug.cgi?id=9820
* bindings/objc/DOM.mm:
(-[DOMElement focus]):
(-[DOMElement blur]):
(-[DOMRange text]):
(-[DOMRange _text]):
* bindings/objc/DOMCSS.mm:
(-[DOMRGBColor color]):
(-[DOMRGBColor _color]):
* bindings/objc/DOMCore.h:
* bindings/objc/DOMEvents.h:
* bindings/objc/DOMExtensions.h:
* bindings/objc/DOMHTML.mm:
(-[DOMHTMLElement titleDisplayString]):
(-[DOMHTMLDocument createDocumentFragmentWithMarkupString:baseURL:]):
(-[DOMHTMLDocument createDocumentFragmentWithText:]):
(-[DOMHTMLDocument _createDocumentFragmentWithMarkupString:baseURLString:]):
(-[DOMHTMLDocument _createDocumentFragmentWithText:]):
* bindings/objc/DOMPrivate.h:
* bindings/objc/DOMXPath.h:
* bindings/objc/DOMXPath.mm:
2006-07-09 Beth Dakin <bdakin@apple.com>
Reviewed by Maciej.
......
......@@ -1440,6 +1440,16 @@ static Class elementClass(const AtomicString& tagName)
return [self _element]->hasAttributeNS(namespaceURI, localName);
}
- (void)focus
{
[self _element]->focus();
}
- (void)blur
{
[self _element]->blur();
}
@end
@implementation DOMElement (DOMElementCSSInlineStyle)
......@@ -1464,16 +1474,6 @@ static Class elementClass(const AtomicString& tagName)
return nil;
}
- (void)focus
{
[self _element]->focus();
}
- (void)blur
{
[self _element]->blur();
}
- (void)scrollIntoView:(BOOL)alignTop
{
[self _element]->scrollIntoView(alignTop);
......@@ -1901,6 +1901,11 @@ static Class elementClass(const AtomicString& tagName)
return result;
}
- (NSString *)text
{
return [self _range]->text();
}
- (void)detach
{
ExceptionCode ec = 0;
......@@ -1947,7 +1952,7 @@ static Class elementClass(const AtomicString& tagName)
- (NSString *)_text
{
return [self _range]->text();
return [self text];
}
@end
......
......@@ -1074,14 +1074,19 @@ void removeWrapperForRGB(RGBA32 value)
}
- (NSColor *)color
{
RGBA32 rgb = reinterpret_cast<uintptr_t>(_internal);
return nsColor(Color(rgb));
}
@end
@implementation DOMRGBColor (WebPrivate)
- (NSColor *)_color
{
RGBA32 rgb = reinterpret_cast<uintptr_t>(_internal);
return nsColor(Color(rgb));
return [self color];
}
@end
......
......@@ -118,6 +118,10 @@ enum {
- (void)setPrefix:(NSString *)prefix;
- (NSString *)localName;
- (BOOL)hasAttributes;
- (BOOL)isSameNode:(DOMNode *)other;
- (BOOL)isEqualNode:(DOMNode *)other;
- (NSString *)textContent;
- (void)setTextContent:(NSString *)text;
@end
@interface DOMNodeList : DOMObject
......@@ -172,6 +176,8 @@ enum {
- (DOMNodeList *)getElementsByTagNameNS:(NSString *)namespaceURI :(NSString *)localName;
- (BOOL)hasAttribute:(NSString *)name;
- (BOOL)hasAttributeNS:(NSString *)namespaceURI :(NSString *)localName;
- (void)focus;
- (void)blur;
@end
@interface DOMText : DOMCharacterData
......@@ -234,4 +240,5 @@ enum {
- (DOMAttr *)createAttributeNS:(NSString *)namespaceURI :(NSString *)qualifiedName;
- (DOMNodeList *)getElementsByTagNameNS:(NSString *)namespaceURI :(NSString *)localName;
- (DOMElement *)getElementById:(NSString *)elementId;
- (DOMNode *)adoptNode:(DOMNode *)source;
@end
......@@ -112,3 +112,38 @@ enum {
- (BOOL)horizontalOverflow;
- (BOOL)verticalOverflow;
@end;
enum {
DOM_KEY_LOCATION_STANDARD = 0x00,
DOM_KEY_LOCATION_LEFT = 0x01,
DOM_KEY_LOCATION_RIGHT = 0x02,
DOM_KEY_LOCATION_NUMPAD = 0x03,
};
@interface DOMKeyboardEvent : DOMUIEvent
- (NSString*)keyIdentifier;
- (unsigned)keyLocation;
- (BOOL)ctrlKey;
- (BOOL)shiftKey;
- (BOOL)altKey;
- (BOOL)metaKey;
- (BOOL)getModifierState:(NSString *)keyIdentifierArg;
@end
@interface DOMKeyboardEvent (NonStandardAdditions)
- (int)keyCode;
- (int)charCode;
@end
@interface DOMWheelEvent : DOMUIEvent
- (int)screenX;
- (int)screenY;
- (int)clientX;
- (int)clientY;
- (BOOL)ctrlKey;
- (BOOL)shiftKey;
- (BOOL)altKey;
- (BOOL)metaKey;
- (BOOL)isHorizontal;
- (int)wheelDelta;
@end
......@@ -25,11 +25,22 @@
#import <WebCore/DOMCSS.h>
#import <WebCore/DOMHTML.h>
#import <WebCore/DOMRange.h>
@class DOMCSSStyleDeclaration;
@interface DOMDocument (DOMDocumentExtensions)
@interface DOMImplementation (DOMImplementationExtensions)
- (DOMHTMLDocument *)createHTMLDocument:(NSString *)title;
@end
@interface DOMDocument (DOMDocumentCSSExtensions)
- (DOMCSSStyleDeclaration *)createCSSStyleDeclaration;
- (DOMCSSRuleList *)getMatchedCSSRules:(DOMElement *)elt :(NSString *)pseudoElt;
@end
@interface DOMHTMLDocument (DOMHTMLDocumentExtensions)
- (DOMDocumentFragment *)createDocumentFragmentWithMarkupString:(NSString *)markupString baseURL:(NSURL *)baseURL;
- (DOMDocumentFragment *)createDocumentFragmentWithText:(NSString *)text;
@end
@interface DOMHTMLElement (DOMHTMLElementExtensions)
......@@ -45,6 +56,23 @@
- (NSString *)contentEditable;
- (void)setContentEditable:(NSString *)contentEditable;
- (BOOL)isContentEditable;
- (NSString *)titleDisplayString;
- (int)offsetLeft;
- (int)offsetTop;
- (int)offsetWidth;
- (int)offsetHeight;
- (DOMHTMLElement *)offsetParent;
- (int)clientWidth;
- (int)clientHeight;
- (int)scrollLeft;
- (void)setScrollLeft:(int)scroll;
- (int)scrollTop;
- (void)setScrollTop:(int)scroll;
- (int)scrollWidth;
- (int)scrollHeight;
@end
@interface DOMHTMLEmbedElement : DOMHTMLElement
......@@ -64,4 +92,55 @@
@interface DOMRGBColor (DOMRGBColorExtensions)
- (DOMCSSPrimitiveValue *)alpha;
- (NSColor *)color;
@end
@interface DOMAttr (DOMAttrExtensions)
- (DOMCSSStyleDeclaration *)style;
@end
@interface DOMCSSStyleDeclaration (DOMCSSStyleDeclarationExtensions)
- (NSString *)getPropertyShorthand:(NSString *)propertyName;
- (BOOL)isPropertyImplicit:(NSString *)propertyName;
@end
@interface DOMNode (DOMNodeExtensions)
- (NSRect)boundingBox;
- (NSArray *)lineBoxRects;
@end
@interface DOMRange (DOMRangeExtensions)
- (NSString *)text;
@end
@interface DOMElement (DOMElementExtensions)
- (NSImage *)image;
- (void)scrollIntoView:(BOOL)alignTop;
- (void)scrollIntoViewIfNeeded:(BOOL)centerIfNeeded;
@end
@interface DOMHTMLInputElement (DOMHTMLInputElementExtensions)
- (NSString *)altDisplayString;
- (NSURL *)absoluteImageURL;
@end
@interface DOMHTMLImageElement (DOMHTMLImageElementExtensions)
- (NSString *)altDisplayString;
- (NSURL *)absoluteImageURL;
@end
@interface DOMHTMLObjectElement (DOMHTMLObjectElementExtensions)
- (NSURL *)absoluteImageURL;
@end
@interface DOMHTMLAnchorElement (DOMHTMLAnchorElementExtensions)
- (NSURL *)absoluteLinkURL;
@end
@interface DOMHTMLAreaElement (DOMHTMLAreaElementExtensions)
- (NSURL *)absoluteLinkURL;
@end
@interface DOMHTMLLinkElement (DOMHTMLLinkElementExtensions)
- (NSURL *)absoluteLinkURL;
@end
......@@ -29,6 +29,7 @@
#import "DOMHTMLInternal.h"
#import "DOMInternal.h"
#import "DOMPrivate.h"
#import "DOMExtensions.h"
#import "DocumentFragment.h"
#import "FoundationExtras.h"
#import "HTMLAppletElement.h"
......@@ -87,6 +88,8 @@
#import "markup.h"
#import "RenderTextControl.h"
#import "FrameView.h"
#import "csshelper.h"
#import "KURL.h"
using namespace WebCore;
using namespace HTMLNames;
......@@ -285,11 +288,6 @@ using namespace HTMLNames;
return [self _HTMLElement]->title();
}
- (NSString *)titleDisplayString
{
return [self _HTMLElement]->title().replace('\\', [self _element]->document()->backslashAsCurrencySymbol());
}
- (void)setTitle:(NSString *)title
{
[self _HTMLElement]->setTitle(title);
......@@ -343,6 +341,11 @@ using namespace HTMLNames;
@implementation DOMHTMLElement (DOMHTMLElementExtensions)
- (NSString *)titleDisplayString
{
return [self _HTMLElement]->title().replace('\\', [self _element]->document()->backslashAsCurrencySymbol());
}
- (NSString *)innerHTML
{
return [self _HTMLElement]->innerHTML();
......@@ -594,19 +597,30 @@ using namespace HTMLNames;
return [DOMNodeList _nodeListWith:nodeList];
}
- (DOMDocumentFragment *)createDocumentFragmentWithMarkupString:(NSString *)markupString baseURL:(NSURL *)baseURL
{
RefPtr<DocumentFragment> fragment = createFragmentFromMarkup([self _document], markupString, [baseURL absoluteString]);
return [DOMDocumentFragment _documentFragmentWith:fragment.get()];
}
- (DOMDocumentFragment *)createDocumentFragmentWithText:(NSString *)text
{
return [DOMDocumentFragment _documentFragmentWith:createFragmentFromText([self _document], DeprecatedString::fromNSString(text)).get()];
}
@end
@implementation DOMHTMLDocument (WebPrivate)
- (DOMDocumentFragment *)_createDocumentFragmentWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString
{
RefPtr<DocumentFragment> fragment = createFragmentFromMarkup([self _document], markupString, baseURLString);
return [DOMDocumentFragment _documentFragmentWith:fragment.get()];
NSURL *baseURL = KURL([self _document]->completeURL(parseURL(baseURLString)).deprecatedString()).getNSURL();
return [self createDocumentFragmentWithMarkupString:markupString baseURL:baseURL];
}
- (DOMDocumentFragment *)_createDocumentFragmentWithText:(NSString *)text
{
return [DOMDocumentFragment _documentFragmentWith:createFragmentFromText([self _document], DeprecatedString::fromNSString(text)).get()];
return [self createDocumentFragmentWithText:text];
}
@end
......
......@@ -73,130 +73,3 @@
@interface DOMHTMLSelectElement(FormsAutoFillTransition)
- (void)_activateItemAtIndex:(int)index;
@end
// BEGIN PENDING PUBLIC APIS
// These APIs will be made public eventually.
@interface DOMAttr (DOMAttrExtensions)
- (DOMCSSStyleDeclaration *)style;
@end
@interface DOMDocument (DOMViewCSSExtensions)
- (DOMCSSRuleList *)getMatchedCSSRules:(DOMElement *)elt :(NSString *)pseudoElt;
@end
@interface DOMCSSStyleDeclaration (DOMCSSStyleDeclarationExtensions)
- (NSString *)getPropertyShorthand:(NSString *)propertyName;
- (BOOL)isPropertyImplicit:(NSString *)propertyName;
@end
@interface DOMNode (DOMNodePendingPublic)
- (BOOL)isSameNode:(DOMNode *) other;
- (BOOL)isEqualNode:(DOMNode *) other;
- (NSRect)boundingBox;
- (NSArray *)lineBoxRects;
- (NSString *)textContent;
- (void)setTextContent:(NSString *)text;
- (void)addEventListener:(NSString *)type :(id <DOMEventListener>)listener :(BOOL)useCapture;
- (void)removeEventListener:(NSString *)type :(id <DOMEventListener>)listener :(BOOL)useCapture;
- (BOOL)dispatchEvent:(DOMEvent *)event;
@end
@interface DOMElement (DOMElementExtensions)
- (NSImage *)image;
- (void)focus;
- (void)blur;
- (void)scrollIntoView:(BOOL)alignTop;
- (void)scrollIntoViewIfNeeded:(BOOL)centerIfNeeded;
@end
@interface DOMHTMLElement (DOMHTMLElementPendingPublic)
- (NSString *)titleDisplayString;
- (int)offsetLeft;
- (int)offsetTop;
- (int)offsetWidth;
- (int)offsetHeight;
- (DOMHTMLElement *)offsetParent;
- (int)clientWidth;
- (int)clientHeight;
- (int)scrollLeft;
- (void)setScrollLeft:(int)scroll;
- (int)scrollTop;
- (void)setScrollTop:(int)scroll;
- (int)scrollWidth;
- (int)scrollHeight;
@end
@interface DOMHTMLInputElement (DOMHTMLInputElementPendingPublic)
- (NSString *)altDisplayString;
- (NSURL *)absoluteImageURL;
@end
@interface DOMHTMLImageElement (DOMHTMLImageElementPendingPublic)
- (NSString *)altDisplayString;
- (NSURL *)absoluteImageURL;
@end
@interface DOMHTMLObjectElement (DOMHTMLObjectElementPendingPublic)
- (NSURL *)absoluteImageURL;
@end
@interface DOMHTMLAnchorElement (DOMHTMLAnchorElementPendingPublic)
- (NSURL *)absoluteLinkURL;
@end
@interface DOMHTMLAreaElement (DOMHTMLAreaElementPendingPublic)
- (NSURL *)absoluteLinkURL;
@end
@interface DOMHTMLLinkElement (DOMHTMLLinkElementPendingPublic)
- (NSURL *)absoluteLinkURL;
@end
@interface DOMImplementation (DOMImplementationPendingPublic)
- (DOMHTMLDocument *)createHTMLDocument:(NSString *)title;
@end
enum {
DOM_KEY_LOCATION_STANDARD = 0x00,
DOM_KEY_LOCATION_LEFT = 0x01,
DOM_KEY_LOCATION_RIGHT = 0x02,
DOM_KEY_LOCATION_NUMPAD = 0x03,
};
@interface DOMKeyboardEvent : DOMUIEvent
- (NSString*)keyIdentifier;
- (unsigned)keyLocation;
- (BOOL)ctrlKey;
- (BOOL)shiftKey;
- (BOOL)altKey;
- (BOOL)metaKey;
- (BOOL)getModifierState:(NSString *)keyIdentifierArg;
@end
@interface DOMKeyboardEvent (NonStandardAdditions)
- (int)keyCode;
- (int)charCode;
@end
@interface DOMWheelEvent : DOMUIEvent
- (int)screenX;
- (int)screenY;
- (int)clientX;
- (int)clientY;
- (BOOL)ctrlKey;
- (BOOL)shiftKey;
- (BOOL)altKey;
- (BOOL)metaKey;
- (BOOL)isHorizontal;
- (int)wheelDelta;
@end
// END
// Pending DOM3 APIs
@interface DOMDocument (DOM3)
- (DOMNode *)adoptNode:(DOMNode *)source;
@end
......@@ -23,8 +23,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if XPATH_SUPPORT
#import <WebCore/DOMCore.h>
extern NSString * const DOMXPathException;
......@@ -73,5 +71,3 @@ enum {
- (id <DOMXPathNSResolver>)createNSResolver:(DOMNode *)nodeResolver;
- (DOMXPathResult *)evaluate:(NSString *)expression :(DOMNode *)contextNode :(id <DOMXPathNSResolver>)resolver :(unsigned short)type :(DOMXPathResult *)result;
@end
#endif // XPATH_SUPPORT
......@@ -24,10 +24,10 @@
*/
#import "config.h"
#import "DOMXPath.h"
#if XPATH_SUPPORT
#import "DOMXPath.h"
#import "DOMInternal.h"
#import "DOMXPathInternal.h"
#import "Document.h"
......
2006-07-09 Timothy Hatcher <timothy@apple.com>
Reviewed by Darin.
Bug 9820: Move new DOM API that has been through API review to public headers
http://bugzilla.opendarwin.org/show_bug.cgi?id=9820
* Misc/WebElementDictionary.m: include DOMExtensions.h
* Misc/WebNSViewExtras.m: include DOMExtensions.h
* WebKit.xcodeproj/project.pbxproj: make DOMXPath.h public
2006-07-09 Timothy Hatcher <timothy@apple.com>
Reviewed by Kevin.
......
......@@ -35,7 +35,7 @@
#import "WebViewPrivate.h"
#import <WebKit/DOMCore.h>
#import <WebKit/DOMPrivate.h>
#import <WebKit/DOMExtensions.h>
typedef enum {
WebElementSelf,
......
......@@ -28,7 +28,7 @@
#import <WebKit/WebNSViewExtras.h>
#import <WebCore/DOMPrivate.h>
#import <WebCore/DOMExtensions.h>
#import <WebKit/WebDataSource.h>
#import <WebKit/WebFramePrivate.h>
#import <WebKit/WebFrameViewInternal.h>
......
......@@ -1290,11 +1290,11 @@
);
name = DOMXPath.h;
outputPaths = (
"$(TARGET_BUILD_DIR)/$(PRIVATE_HEADERS_FOLDER_PATH)/DOMXPath.h",
"$(TARGET_BUILD_DIR)/$(PUBLIC_HEADERS_FOLDER_PATH)/DOMXPath.h",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "mkdir -p \"$TARGET_BUILD_DIR/$PRIVATE_HEADERS_FOLDER_PATH\"\nsed -e s/WebCore/WebKit/ \"$WEBCORE_PRIVATE_HEADERS_DIR/DOMXPath.h\" > \"$TARGET_BUILD_DIR/$PRIVATE_HEADERS_FOLDER_PATH/DOMXPath.h\"";
shellScript = "mkdir -p \"$TARGET_BUILD_DIR/$PUBLIC_HEADERS_FOLDER_PATH\"\nsed -e s/WebCore/WebKit/ \"$WEBCORE_PRIVATE_HEADERS_DIR/DOMXPath.h\" > \"$TARGET_BUILD_DIR/$PUBLIC_HEADERS_FOLDER_PATH/DOMXPath.h\"";
};
9339323E0825A64200AADA6B /* npruntime.h */ = {
isa = PBXShellScriptBuildPhase;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment