Mac Developer Library

Developer

WebKit Framework Reference DOMDocument Additions Reference

Options
Deployment Target:

On This Page
Language:

DOMDocument

Additions to the DOMDocument class facilitate communication between the DOM API and WebKit and help convert DOM URL element attributes into web-friendly NSURL objects.

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


import WebKit @import WebKit;

Availability


Available in OS X v10.3.9 and later.
  • Returns the web frame associated with the DOM document.

    Declaration

    Swift

    var webFrame: WebFrame! { get }

    Objective-C

    @property(nonatomic, readonly, strong) WebFrame *webFrame

    Return Value

    The web frame object for the receiver.

    Import Statement

    import WebKit

    Availability

    Available in OS X v10.3.9 and later.

  • Constructs a URL given an attribute string.

    Declaration

    Swift

    func URLWithAttributeString(_ string: String!) -> NSURL!

    Objective-C

    - (NSURL *)URLWithAttributeString:(NSString *)string

    Parameters

    string

    The HTML attribute string to convert.

    Return Value

    An NSURL object containing an absolute URL derived from the specified attribute string.

    Discussion

    This method constructs a URL given the string value of an element attribute. Examples include the href attribute of a DOMHTMLAnchorElement object, or the src attribute of a DOMHTMLImageElement object. This method only applies to attributes that refer to URLs.

    This method is similar to URLWithString: in the NSURL class, except that URLWithAttributeString: handles relative URLs automatically based on the current document’s location.

    Import Statement

    import WebKit

    Availability

    Available in OS X v10.3.9 and later.