Changeset 86714 in webkit
- Timestamp:
- May 17, 2011 3:49:36 PM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r86694 r86714 1 2011-05-17 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Dan Bernstein. 4 5 Add API to determine if a frame has any form elements without going to javascript 6 https://bugs.webkit.org/show_bug.cgi?id=60999 7 8 * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: 9 (WKBundleFrameContainsAnyFormElements): 10 * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h: 11 * WebProcess/WebPage/WebFrame.cpp: 12 (WebKit::WebFrame::containsAnyFormElements): 13 * WebProcess/WebPage/WebFrame.h: 14 Add WKBundleFrameContainsAnyFormElements which does a walk of the document to determine 15 if there are any form elements. 16 1 17 2011-05-17 Andreas Kling <kling@webkit.org> 2 18 -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
r82773 r86714 226 226 return toCopiedAPI(toImpl(frameRef)->mimeTypeForResourceWithURL(WebCore::KURL(WebCore::KURL(), toImpl(urlRef)->string()))); 227 227 } 228 229 bool WKBundleFrameContainsAnyFormElements(WKBundleFrameRef frameRef) 230 { 231 return toImpl(frameRef)->containsAnyFormElements(); 232 } -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h
r79793 r86714 50 50 WK_EXPORT void WKBundleFrameClearOpener(WKBundleFrameRef frame); 51 51 52 WK_EXPORT bool WKBundleFrameContainsAnyFormElements(WKBundleFrameRef frame); 53 52 54 #ifdef __cplusplus 53 55 } -
trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
r85783 r86714 47 47 #include <WebCore/FrameView.h> 48 48 #include <WebCore/HTMLFrameOwnerElement.h> 49 #include <WebCore/HTMLNames.h> 49 50 #include <WebCore/JSCSSStyleDeclaration.h> 50 51 #include <WebCore/JSElement.h> … … 550 551 } 551 552 553 bool WebFrame::containsAnyFormElements() const 554 { 555 if (!m_coreFrame) 556 return false; 557 558 Document* document = m_coreFrame->document(); 559 if (!document) 560 return false; 561 562 for (Node* node = document->documentElement(); node; node = node->traverseNextNode()) { 563 if (!node->isElementNode()) 564 continue; 565 if (static_cast<Element*>(node)->hasTagName(HTMLNames::formTag)) 566 return true; 567 } 568 return false; 569 } 570 552 571 WebFrame* WebFrame::frameForContext(JSContextRef context) 553 572 { -
trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.h
r82773 r86714 97 97 bool hasVerticalScrollbar() const; 98 98 bool getDocumentBackgroundColor(double* red, double* green, double* blue, double* alpha); 99 bool containsAnyFormElements() const; 99 100 100 101 static WebFrame* frameForContext(JSContextRef);
Note: See TracChangeset
for help on using the changeset viewer.