DOMDocument in 10.10
DOMDocument in 10.10
- Subject: DOMDocument in 10.10
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Sat, 18 Oct 2014 19:33:23 +0700
WebFrame *mainFrame = [ webView mainFrame ];
DOMDocument *domDoc = [ mainFrame DOMDocument ];
When I print domDoc, I get with 10.9 something like:
<DOMHTMLDocument [#document]: 0x105df8400 ''> with 1 children
<DOMHTMLHtmlElement [HTML]: 0x10401c660 ''> with 3 children
[ 0] <DOMHTMLHeadElement [HEAD]: 0x10401c2a0 ''> with 15 children
[ 0] DOMText = "** white **"
[ 1] DOMHTMLMetaElement
[ 2] DOMText = "** white **"
[ 3] DOMHTMLMetaElement
[ 4] DOMText = "** white **"
[ 5] <DOMHTMLTitleElement [TITLE]: 0x10404c9a0 ''> with 1 children
[ 0] DOMText = "พจนานุกรม ฉบับราชบัณฑิตยสถาน พ.ศ. ๒๕๕๔"
[--] <DOMHTMLTitleElement ----->
[ 6] DOMText = "** white **"
[ 7] <DOMHTMLScriptElement [SCRIPT]: 0x10400d750 ''> with 1 children
[ 0] DOMText = "function is_mobile() ...."
[--] <DOMHTMLScriptElement ----->
[ 8] DOMText = "** white **"
[ 9] DOMHTMLLinkElement
[10] DOMText = "** white **"
[11] DOMHTMLScriptElement
[12] DOMText = "** white **"
[13] <DOMHTMLScriptElement [SCRIPT]: 0x10400d3f0 ''> with 1 children
[ 0] DOMText = "function checkForm(f) ..."
[--] <DOMHTMLScriptElement ----->
[14] DOMText = "** white **"
[--] <DOMHTMLHeadElement ----->
[ 1] DOMText = "** white **"
[ 2] <DOMHTMLBodyElement [BODY]: 0x10401c480 ''> with 5 children
...
[--] <DOMHTMLBodyElement ----->
<DOMHTMLHtmlElement ----->
<DOMHTMLDocument ----->
which looks about right.
Safaris Web Inspector shows similar structure.
But with 10.10 I get (for the same document):
<DOMHTMLDocument [#document]: 0x105df8400 ''> with 1 children
[ 0] <DOMHTMLHtmlElement [HTML]: 0x105e189c0 ''> with 1 children
[ 0] <DOMHTMLHeadElement [HEAD]: 0x105e18a20 ''> with 12 children
[ 0] DOMText = "** white **"
[ 1] DOMHTMLMetaElement
[ 2] DOMText = "** white **"
[ 3] DOMHTMLMetaElement
[ 4] DOMText = "** white **"
[ 5] <DOMHTMLTitleElement [TITLE]: 0x105e19a10 ''> with 1 children
[ 0] DOMText = "พจนานุกรม ฉบับราชบัณฑิตยสถาน พ.ศ. ๒๕๕๔"
[--] <DOMHTMLTitleElement ----->
[ 6] DOMText = "** white **"
[ 7] <DOMHTMLScriptElement [SCRIPT]: 0x105dc03f0 ''> with 1 children
[ 0] DOMText = "function is_mobile ...."
[--] <DOMHTMLScriptElement ----->
[ 8] DOMText = "** white **"
[ 9] DOMHTMLLinkElement
[10] DOMText = "** white **"
[11] DOMHTMLScriptElement
[--] <DOMHTMLHeadElement ----->
[--] <DOMHTMLHtmlElement ----->
<DOMHTMLDocument ----->
Note: the head has only 12 children (the first 10 are identical to 10.9), and there is no body at all.
What am I doing wrong?
Or, if this is a known 10.10 bug: how to work around this - I really need the body of the page.
Gerriet.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden