+2006-10-25 Darin Adler <darin@apple.com>
+
+ Reviewed by Anders.
+
+ - removed 55 methods from WebCoreFrameBridge
+ - changed callers to use Frame directly instead
+ - put FrameLoaderTypes.h types into the WebCore namespace
+ - first steps to get FrameLoader.h ready for cross-platform duty
+
+ * WebCore.exp:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bridge/mac/BrowserExtensionMac.mm:
+ (WebCore::BrowserExtensionMac::createNewWindow):
+ * bridge/mac/FrameMac.h:
+ * bridge/mac/FrameMac.mm:
+ (WebCore::FrameMac::loadRequest):
+ (WebCore::FrameMac::startRedirectionTimer):
+ (WebCore::FrameMac::stopRedirectionTimer):
+ (WebCore::FrameMac::passSubframeEventToSubframe):
+ (WebCore::FrameMac::handledOnloadEvents):
+ (WebCore::FrameMac::isLoadTypeReload):
+ * bridge/mac/WebCoreFrameBridge.h:
+ * bridge/mac/WebCoreFrameBridge.mm:
+ (-[WebCoreFrameBridge executionContextForView:]):
+ (updateRenderingForBindings):
+ (-[WebCoreFrameBridge canTargetLoadInFrame:]):
+ (-[WebCoreFrameBridge forceLayoutAdjustingViewSize:]):
+ (-[WebCoreFrameBridge forceLayoutWithMinimumPageWidth:maximumPageWidth:adjustingViewSize:]):
+ (-[WebCoreFrameBridge installInFrame:]):
+ (-[WebCoreFrameBridge numPendingOrLoadingRequests]):
+ (-[WebCoreFrameBridge replaceSelectionWithNode:selectReplacement:smartReplace:matchStyle:]):
+ (-[WebCoreFrameBridge baseWritingDirectionForSelectionStart]):
+ (-[WebCoreFrameBridge dragOperationForDraggingInfo:]):
+ (stringByCollapsingNonPrintingCharacters):
+ (-[WebCoreFrameBridge startLoadingResource:withMethod:URL:customHeaders:]):
+ (-[WebCoreFrameBridge startLoadingResource:withMethod:URL:customHeaders:postData:]):
+ (-[WebCoreFrameBridge syncLoadResourceWithMethod:URL:customHeaders:postData:finalURL:responseHeaders:statusCode:]):
+ * loader/FrameLoaderTypes.h:
+ * loader/mac/FrameLoader.h:
+ * loader/mac/FrameLoader.mm:
+ (WebCore::FrameLoader::FrameLoader):
+ (WebCore::FrameLoader::setupForReplace):
+ (WebCore::FrameLoader::load):
+ (WebCore::FrameLoader::activeDocumentLoader):
+ (WebCore::FrameLoader::state):
+ (WebCore::FrameLoader::setState):
+ (WebCore::FrameLoader::clearProvisionalLoad):
+ (WebCore::FrameLoader::markLoadComplete):
+ (WebCore::FrameLoader::commitProvisionalLoad):
+ (WebCore::FrameLoader::receivedMainResourceError):
+ (WebCore::FrameLoader::handleFallbackContent):
+ (WebCore::FrameLoader::isLoadingMainFrame):
+ (WebCore::FrameLoader::continueAfterNewWindowPolicy):
+ (WebCore::FrameLoader::continueAfterNavigationPolicy):
+ (WebCore::FrameLoader::continueAfterWillSubmitForm):
+ (WebCore::FrameLoader::continueLoadRequestAfterNavigationPolicy):
+ (WebCore::FrameLoader::transitionToCommitted):
+ (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
+ (WebCore::FrameLoader::continueLoadRequestAfterNewWindowPolicy):
+ (-[WebCoreFrameLoaderAsDelegate continueAfterNewWindowPolicy:]):
+ (-[WebCoreFrameLoaderAsDelegate continueAfterNavigationPolicy:]):
+ (-[WebCoreFrameLoaderAsDelegate continueAfterWillSubmitForm:]):
+ * loader/mac/ImageDocumentMac.mm:
+ (WebCore::finishImageLoad):
+ * loader/mac/WebDocumentLoader.mm:
+ (WebCore::DocumentLoader::isLoadingInAPISense):
+ * loader/mac/WebMainResourceLoader.h:
+ * loader/mac/WebMainResourceLoader.mm:
+ (WebCore::MainResourceLoader::continueAfterContentPolicy):
+ (-[WebCoreMainResourceLoaderAsPolicyDelegate continueAfterContentPolicy:]):
+ * loader/mac/WebSubresourceLoader.mm:
+ (-[WebCoreSubresourceHandle initWithLoader:]):
+ * platform/mac/ListBoxMac.mm:
+ (-[WebCoreTableView keyDown:]):
+ (-[WebCoreTableView keyUp:]):
+ * platform/mac/WebCoreTextField.mm:
+ (-[WebCoreTextFieldController textView:shouldHandleEvent:]):
+
2006-10-25 Steve Falkenburg <sfalken@apple.com>
Reviewed by Darin.
__ZN7WebCore11FrameLoader12shouldReloadEP5NSURLS2_
__ZN7WebCore11FrameLoader14detachChildrenEv
__ZN7WebCore11FrameLoader16detachFromParentEv
-__ZN7WebCore11FrameLoader17actionInformationE13FrameLoadTypebP7NSEventP5NSURL
-__ZN7WebCore11FrameLoader17actionInformationE14NavigationTypeP7NSEventP5NSURL
+__ZN7WebCore11FrameLoader17actionInformationENS_13FrameLoadTypeEbP7NSEventP5NSURL
+__ZN7WebCore11FrameLoader17actionInformationENS_14NavigationTypeEP7NSEventP5NSURL
__ZN7WebCore11FrameLoader21addPlugInStreamLoaderEPNS_17WebResourceLoaderE
__ZN7WebCore11FrameLoader21commitProvisionalLoadEP12NSDictionary
__ZN7WebCore11FrameLoader22defersCallbacksChangedEv
__ZN7WebCore11FrameLoader24removePlugInStreamLoaderEPNS_17WebResourceLoaderE
__ZN7WebCore11FrameLoader25provisionalDocumentLoaderEv
__ZN7WebCore11FrameLoader4loadEP12NSURLRequest
-__ZN7WebCore11FrameLoader4loadEP12NSURLRequestP12NSDictionary13FrameLoadTypeN3WTF10PassRefPtrINS_9FormStateEEE
+__ZN7WebCore11FrameLoader4loadEP12NSURLRequestP12NSDictionaryNS_13FrameLoadTypeEN3WTF10PassRefPtrINS_9FormStateEEE
__ZN7WebCore11FrameLoader4loadEP12NSURLRequestP8NSString
-__ZN7WebCore11FrameLoader4loadEP5NSURLP8NSString13FrameLoadTypeS4_P7NSEventP10DOMElementP12NSDictionary
+__ZN7WebCore11FrameLoader4loadEP5NSURLP8NSStringNS_13FrameLoadTypeES4_P7NSEventPNS_7ElementEP12NSDictionary
__ZN7WebCore11FrameLoader4loadEPNS_14DocumentLoaderE
-__ZN7WebCore11FrameLoader4loadEPNS_14DocumentLoaderE13FrameLoadTypeN3WTF10PassRefPtrINS_9FormStateEEE
+__ZN7WebCore11FrameLoader4loadEPNS_14DocumentLoaderENS_13FrameLoadTypeEN3WTF10PassRefPtrINS_9FormStateEEE
__ZN7WebCore11FrameLoader6reloadEv
__ZN7WebCore11FrameLoader8safeLoadEP5NSURL
__ZN7WebCore11FrameLoader9setClientEPNS_17FrameLoaderClientE
+__ZN7WebCore11RenderLayer18gAlignCenterAlwaysE
+__ZN7WebCore12AtomicString3addEPNS_10StringImplE
__ZN7WebCore14DocumentLoader12setCommittedEb
__ZN7WebCore14DocumentLoader13attachToFrameEv
__ZN7WebCore14DocumentLoader15detachFromFrameEv
__ZN7WebCore17FrameLoaderClientD2Ev
__ZN7WebCore17WebResourceLoader14cancelledErrorEv
__ZN7WebCore17WebResourceLoader20inConnectionCallbackEv
-__ZN7WebCore21isBackForwardLoadTypeE13FrameLoadType
+__ZN7WebCore19SelectionController5clearEv
+__ZN7WebCore21isBackForwardLoadTypeENS_13FrameLoadTypeE
__ZN7WebCore26NetscapePlugInStreamLoader6createEPNS_5FrameEP11objc_object
__ZN7WebCore4KURLC1EP5NSURL
+__ZN7WebCore5Frame11setSettingsEPNS_8SettingsE
+__ZN7WebCore5Frame12canCachePageEv
+__ZN7WebCore5Frame12ownerElementEv
__ZN7WebCore5Frame14scrollToAnchorERKNS_4KURLE
+__ZN7WebCore5Frame17setWindowHasFocusEb
__ZN7WebCore5Frame20setSelectionFromNoneEv
__ZN7WebCore5Frame21setProhibitsScrollingEb
+__ZN7WebCore5Frame26isSelectionInPasswordFieldEv
__ZN7WebCore5Frame6indentEv
__ZN7WebCore5Frame7outdentEv
+__ZN7WebCore5RangeD1Ev
+__ZN7WebCore6StringC1EP8NSString
+__ZN7WebCore8FrameMac10mouseMovedEP7NSEvent
__ZN7WebCore8FrameMac10wheelEventEP7NSEvent
__ZN7WebCore8FrameMac11mayDHTMLCutEv
+__ZN7WebCore8FrameMac11shouldCloseEv
__ZN7WebCore8FrameMac11tryDHTMLCutEv
__ZN7WebCore8FrameMac12mayDHTMLCopyEv
+__ZN7WebCore8FrameMac12mouseDraggedEP7NSEvent
__ZN7WebCore8FrameMac12tryDHTMLCopyEv
__ZN7WebCore8FrameMac13mayDHTMLPasteEv
__ZN7WebCore8FrameMac13tryDHTMLPasteEv
+__ZN7WebCore8FrameMac18windowScriptObjectEv
+__ZN7WebCore8FrameMac20sendContextMenuEventEP7NSEvent
+__ZN7WebCore8FrameMac20windowScriptNPObjectEv
__ZN7WebCore8FrameMac26dashboardRegionsDictionaryEv
+__ZN7WebCore8FrameMac7mouseUpEP7NSEvent
+__ZN7WebCore8FrameMac8keyEventEP7NSEvent
+__ZN7WebCore8FrameMac9mouseDownEP7NSEvent
+__ZN7WebCore9FrameTree11appendChildEN3WTF10PassRefPtrINS_5FrameEEE
+__ZN7WebCore9FrameTree7setNameERKNS_12AtomicStringE
+__ZNK7WebCore10StringImplcvP8NSStringEv
__ZNK7WebCore11FrameLoader14documentLoaderEv
__ZNK7WebCore11FrameLoader15defersCallbacksEv
__ZNK7WebCore11FrameLoader15firstLayoutDoneEv
__ZNK7WebCore14DocumentLoader9isLoadingEv
__ZNK7WebCore17WebResourceLoader11frameLoaderEv
__ZNK7WebCore26NetscapePlugInStreamLoader6isDoneEv
+__ZNK7WebCore4Page19dragCaretControllerEv
+__ZNK7WebCore5Frame13selectionRectEv
__ZNK7WebCore5Frame15containsPluginsEv
+__ZNK7WebCore5Frame15revealSelectionERKNS_11RenderLayer15ScrollAlignmentE
__ZNK7WebCore5Frame16inViewSourceModeEv
+__ZNK7WebCore5Frame19selectionControllerEv
__ZNK7WebCore5Frame19setInViewSourceModeEb
+__ZNK7WebCore5Frame20visibleSelectionRectEv
__ZNK7WebCore5Frame30applyEditingStyleToBodyElementEv
__ZNK7WebCore5Frame33removeEditingStyleFromBodyElementEv
+__ZNK7WebCore5Frame4pageEv
__ZNK7WebCore5Frame4treeEv
__ZNK7WebCore5Frame6loaderEv
+__ZNK7WebCore5Frame8documentEv
+__ZNK7WebCore5Frame8referrerEv
+__ZNK7WebCore7IntRectcv7_NSRectEv
+__ZNK7WebCore8FrameMac14selectionImageEb
__ZNK7WebCore8FrameMac17eventMayStartDragEP7NSEvent
+__ZNK7WebCore8FrameMac19bodyBackgroundColorEv
__ZNK7WebCore8FrameMac31fontAttributesForSelectionStartEv
+__ZNK7WebCore9FloatRectcv7_NSRectEv
+__ZNK7WebCore9FrameTree12traverseNextEPNS_5FrameE
+__ZNK7WebCore9FrameTree14isDescendantOfEPNS_5FrameE
+__ZNK7WebCore9FrameTree20traverseNextWithWrapEb
+__ZNK7WebCore9FrameTree24traversePreviousWithWrapEb
+__ZNK7WebCore9FrameTree4findERKNS_12AtomicStringE
+__ZNK7WebCore9FrameTree5childERKNS_12AtomicStringE
+__ZNK7WebCore9Selection17isContentEditableEv
+__ZNK7WebCore9Selection23isContentRichlyEditableEv
+__ZNK7WebCore9Selection7toRangeEv
__ZTVN7WebCore17FrameLoaderClientE
_canonicalURL
_stringIsFileURL
6593923A09AE435C002C531F /* KURLMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6593923909AE435C002C531F /* KURLMac.mm */; };
659DDC8209E198BA001BF3C6 /* JSDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 659DDC8009E198BA001BF3C6 /* JSDocument.cpp */; };
659DDC8309E198BA001BF3C6 /* JSDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 659DDC8109E198BA001BF3C6 /* JSDocument.h */; };
- 65A21468097A329100B9050A /* Page.h in Headers */ = {isa = PBXBuildFile; fileRef = 65A21467097A329100B9050A /* Page.h */; };
+ 65A21468097A329100B9050A /* Page.h in Headers */ = {isa = PBXBuildFile; fileRef = 65A21467097A329100B9050A /* Page.h */; settings = {ATTRIBUTES = (Private, ); }; };
65A21484097A3F5300B9050A /* FrameTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65A21482097A3F5300B9050A /* FrameTree.cpp */; };
65A21485097A3F5300B9050A /* FrameTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 65A21483097A3F5300B9050A /* FrameTree.h */; settings = {ATTRIBUTES = (Private, ); }; };
65BAAABE0ADCA015005BB5A4 /* RetainPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 65BAAABD0ADCA015005BB5A4 /* RetainPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
93309E09099E64920056E581 /* ReplaceSelectionCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93309DBA099E64910056E581 /* ReplaceSelectionCommand.cpp */; };
93309E0A099E64920056E581 /* ReplaceSelectionCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 93309DBB099E64910056E581 /* ReplaceSelectionCommand.h */; };
93309E0B099E64920056E581 /* Selection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93309DBC099E64910056E581 /* Selection.cpp */; };
- 93309E0C099E64920056E581 /* Selection.h in Headers */ = {isa = PBXBuildFile; fileRef = 93309DBD099E64910056E581 /* Selection.h */; };
+ 93309E0C099E64920056E581 /* Selection.h in Headers */ = {isa = PBXBuildFile; fileRef = 93309DBD099E64910056E581 /* Selection.h */; settings = {ATTRIBUTES = (Private, ); }; };
93309E0D099E64920056E581 /* SelectionController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93309DBE099E64910056E581 /* SelectionController.cpp */; };
- 93309E0E099E64920056E581 /* SelectionController.h in Headers */ = {isa = PBXBuildFile; fileRef = 93309DBF099E64910056E581 /* SelectionController.h */; };
+ 93309E0E099E64920056E581 /* SelectionController.h in Headers */ = {isa = PBXBuildFile; fileRef = 93309DBF099E64910056E581 /* SelectionController.h */; settings = {ATTRIBUTES = (Private, ); }; };
93309E0F099E64920056E581 /* SetNodeAttributeCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93309DC0099E64910056E581 /* SetNodeAttributeCommand.cpp */; };
93309E10099E64920056E581 /* SetNodeAttributeCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 93309DC1099E64910056E581 /* SetNodeAttributeCommand.h */; };
93309E11099E64920056E581 /* SplitElementCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93309DC2099E64910056E581 /* SplitElementCommand.cpp */; };
93EEC26F09C3218000C515D1 /* CanvasPattern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93EEC26E09C3218000C515D1 /* CanvasPattern.cpp */; };
93EEC27109C3218800C515D1 /* CanvasStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93EEC27009C3218800C515D1 /* CanvasStyle.cpp */; };
93F198E508245E59001E9ABC /* HTMLDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D23C02DE4396018635CA /* HTMLDocument.h */; };
- 93F198E608245E59001E9ABC /* HTMLElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D23F02DE4396018635CA /* HTMLElement.h */; };
+ 93F198E608245E59001E9ABC /* HTMLElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D23F02DE4396018635CA /* HTMLElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
93F198EF08245E59001E9ABC /* HTMLParser.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D25102DE4396018635CA /* HTMLParser.h */; };
93F198F008245E59001E9ABC /* HTMLTokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D25302DE4396018635CA /* HTMLTokenizer.h */; };
93F198F608245E59001E9ABC /* Decoder.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D27902DE43D7018635CA /* Decoder.h */; };
- 93F1991808245E59001E9ABC /* Range.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30402DE4476018635CA /* Range.h */; };
+ 93F1991808245E59001E9ABC /* Range.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30402DE4476018635CA /* Range.h */; settings = {ATTRIBUTES = (Private, ); }; };
93F1992108245E59001E9ABC /* XMLTokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30A02DE4476018635CA /* XMLTokenizer.h */; };
93F1992908245E59001E9ABC /* DeprecatedCString.h in Headers */ = {isa = PBXBuildFile; fileRef = F587868302DE3B8601EA4122 /* DeprecatedCString.h */; settings = {ATTRIBUTES = (Private, ); }; };
93F1992F08245E59001E9ABC /* Cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = F587868402DE3B8601EA4122 /* Cursor.h */; };
93F199BD08245E59001E9ABC /* AXObjectCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 55998A5C052B59CC0017A6C1 /* AXObjectCache.h */; };
93F199BE08245E59001E9ABC /* BlockExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 65A640F00533BB1F0085E777 /* BlockExceptions.h */; settings = {ATTRIBUTES = (); }; };
93F199C208245E59001E9ABC /* WebCoreKeyGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 84B2B1F7056BEF3A00D2B771 /* WebCoreKeyGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 93F199CF08245E59001E9ABC /* AtomicStringList.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3B364705C9D5E200E42902 /* AtomicStringList.h */; };
+ 93F199CF08245E59001E9ABC /* AtomicStringList.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3B364705C9D5E200E42902 /* AtomicStringList.h */; settings = {ATTRIBUTES = (Private, ); }; };
93F199D508245E59001E9ABC /* WebCoreEditCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = BEF7EEA005FF8F0D009717EE /* WebCoreEditCommand.h */; };
93F199DE08245E59001E9ABC /* Position.h in Headers */ = {isa = PBXBuildFile; fileRef = BE91FC8B06133666005E3790 /* Position.h */; settings = {ATTRIBUTES = (Private, ); }; };
93F199E008245E59001E9ABC /* Slider.h in Headers */ = {isa = PBXBuildFile; fileRef = BC86FB8D061F5C23006BB822 /* Slider.h */; };
A80E6D0C0A1989CA007FB8C5 /* CSSStyleRule.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E6CE20A1989CA007FB8C5 /* CSSStyleRule.h */; };
A80E6D0D0A1989CA007FB8C5 /* CSSRule.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E6CE30A1989CA007FB8C5 /* CSSRule.h */; };
A80E6DFB0A199067007FB8C5 /* CSSMutableStyleDeclaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E6DF90A199067007FB8C5 /* CSSMutableStyleDeclaration.cpp */; };
- A80E6DFC0A199067007FB8C5 /* CSSMutableStyleDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E6DFA0A199067007FB8C5 /* CSSMutableStyleDeclaration.h */; };
- A80E6E0F0A19911C007FB8C5 /* CSSStyleDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E6E0D0A19911C007FB8C5 /* CSSStyleDeclaration.h */; };
+ A80E6DFC0A199067007FB8C5 /* CSSMutableStyleDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E6DFA0A199067007FB8C5 /* CSSMutableStyleDeclaration.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ A80E6E0F0A19911C007FB8C5 /* CSSStyleDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E6E0D0A19911C007FB8C5 /* CSSStyleDeclaration.h */; settings = {ATTRIBUTES = (Private, ); }; };
A80E6E100A19911C007FB8C5 /* CSSStyleDeclaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E6E0E0A19911C007FB8C5 /* CSSStyleDeclaration.cpp */; };
A80E734D0A199C77007FB8C5 /* StyleList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E73460A199C77007FB8C5 /* StyleList.cpp */; };
A80E734E0A199C77007FB8C5 /* CSSNamespace.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E73470A199C77007FB8C5 /* CSSNamespace.h */; };
A818721F0977D3C0005826D9 /* ContainerNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A81872140977D3C0005826D9 /* ContainerNode.cpp */; };
A81872200977D3C0005826D9 /* ChildNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = A81872150977D3C0005826D9 /* ChildNodeList.h */; };
A81872210977D3C0005826D9 /* NodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A81872160977D3C0005826D9 /* NodeList.cpp */; };
- A81872230977D3C0005826D9 /* NamedNodeMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A81872180977D3C0005826D9 /* NamedNodeMap.h */; };
+ A81872230977D3C0005826D9 /* NamedNodeMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A81872180977D3C0005826D9 /* NamedNodeMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
A81872240977D3C0005826D9 /* NameNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A81872190977D3C0005826D9 /* NameNodeList.cpp */; };
A81872250977D3C0005826D9 /* ChildNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A818721A0977D3C0005826D9 /* ChildNodeList.cpp */; };
A82398A609B3ACDB00B60641 /* PlugInInfoStore.h in Headers */ = {isa = PBXBuildFile; fileRef = A82398A509B3ACDB00B60641 /* PlugInInfoStore.h */; };
A88AD50D095248F0001DD196 /* ksvg.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0F8ED089701F400BA5114 /* ksvg.h */; };
A88AD52F09524B92001DD196 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A85D7A2F0879EBA9006A9172 /* QuartzCore.framework */; };
A88AD5AA09525131001DD196 /* SVGCSSStyleSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0F6FB089701F100BA5114 /* SVGCSSStyleSelector.cpp */; };
- A8C4A7FD09D563270003AC8D /* StyledElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C4A7EB09D563270003AC8D /* StyledElement.h */; };
+ A8C4A7FD09D563270003AC8D /* StyledElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C4A7EB09D563270003AC8D /* StyledElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
A8C4A7FE09D563270003AC8D /* StyledElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C4A7EC09D563270003AC8D /* StyledElement.cpp */; };
A8C4A80009D563270003AC8D /* Node.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C4A7EE09D563270003AC8D /* Node.cpp */; };
- A8C4A80109D563270003AC8D /* NamedMappedAttrMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C4A7EF09D563270003AC8D /* NamedMappedAttrMap.h */; };
+ A8C4A80109D563270003AC8D /* NamedMappedAttrMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C4A7EF09D563270003AC8D /* NamedMappedAttrMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
A8C4A80209D563270003AC8D /* NamedMappedAttrMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C4A7F009D563270003AC8D /* NamedMappedAttrMap.cpp */; };
- A8C4A80309D563270003AC8D /* NamedAttrMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C4A7F109D563270003AC8D /* NamedAttrMap.h */; };
+ A8C4A80309D563270003AC8D /* NamedAttrMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C4A7F109D563270003AC8D /* NamedAttrMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
A8C4A80409D563270003AC8D /* NamedAttrMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C4A7F209D563270003AC8D /* NamedAttrMap.cpp */; };
- A8C4A80509D563270003AC8D /* MappedAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C4A7F309D563270003AC8D /* MappedAttribute.h */; };
+ A8C4A80509D563270003AC8D /* MappedAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C4A7F309D563270003AC8D /* MappedAttribute.h */; settings = {ATTRIBUTES = (Private, ); }; };
A8C4A80609D563270003AC8D /* MappedAttribute.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C4A7F409D563270003AC8D /* MappedAttribute.cpp */; };
A8C4A80709D563270003AC8D /* Element.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C4A7F509D563270003AC8D /* Element.h */; settings = {ATTRIBUTES = (Private, ); }; };
A8C4A80809D563270003AC8D /* Element.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C4A7F609D563270003AC8D /* Element.cpp */; };
- A8C4A80909D563270003AC8D /* CSSMappedAttributeDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C4A7F709D563270003AC8D /* CSSMappedAttributeDeclaration.h */; };
+ A8C4A80909D563270003AC8D /* CSSMappedAttributeDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C4A7F709D563270003AC8D /* CSSMappedAttributeDeclaration.h */; settings = {ATTRIBUTES = (Private, ); }; };
A8C4A80A09D563270003AC8D /* CSSMappedAttributeDeclaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C4A7F809D563270003AC8D /* CSSMappedAttributeDeclaration.cpp */; };
A8C4A80B09D563270003AC8D /* Attribute.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C4A7F909D563270003AC8D /* Attribute.h */; settings = {ATTRIBUTES = (Private, ); }; };
A8C4A80C09D563270003AC8D /* Attribute.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C4A7FA09D563270003AC8D /* Attribute.cpp */; };
A8C4A80D09D563270003AC8D /* Attr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C4A7FB09D563270003AC8D /* Attr.h */; settings = {ATTRIBUTES = (Private, ); }; };
A8C4A80E09D563270003AC8D /* Attr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C4A7FC09D563270003AC8D /* Attr.cpp */; };
- A8C4A84C09D5649D0003AC8D /* MappedAttributeEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C4A84B09D5649D0003AC8D /* MappedAttributeEntry.h */; };
+ A8C4A84C09D5649D0003AC8D /* MappedAttributeEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C4A84B09D5649D0003AC8D /* MappedAttributeEntry.h */; settings = {ATTRIBUTES = (Private, ); }; };
A8CFF04D0A154F09000A4234 /* FixedTableLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8CFF0480A154F09000A4234 /* FixedTableLayout.cpp */; };
A8CFF04E0A154F09000A4234 /* AutoTableLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = A8CFF0490A154F09000A4234 /* AutoTableLayout.h */; };
A8CFF04F0A154F09000A4234 /* FixedTableLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = A8CFF04A0A154F09000A4234 /* FixedTableLayout.h */; };
BC73E25E0978682700EDFF8A /* FloatSize.h in Headers */ = {isa = PBXBuildFile; fileRef = BC73E25C0978682700EDFF8A /* FloatSize.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC73E3190978AFFC00EDFF8A /* IntPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = BC73E3180978AFFB00EDFF8A /* IntPoint.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC73E3920978CED700EDFF8A /* FloatPoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC73E3900978CED700EDFF8A /* FloatPoint.cpp */; };
- BC73E3930978CED700EDFF8A /* FloatPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = BC73E3910978CED700EDFF8A /* FloatPoint.h */; };
+ BC73E3930978CED700EDFF8A /* FloatPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = BC73E3910978CED700EDFF8A /* FloatPoint.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC837C720A9D0D1A006B186A /* FloatPointCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC837C670A9D0D1A006B186A /* FloatPointCG.cpp */; };
BC837C730A9D0D1A006B186A /* FloatRectCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC837C680A9D0D1A006B186A /* FloatRectCG.cpp */; };
BC837C740A9D0D1A006B186A /* FloatSizeCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC837C690A9D0D1A006B186A /* FloatSizeCG.cpp */; };
BC9C328B09933A6E001D6924 /* ImageAnimationObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9C328A09933A6D001D6924 /* ImageAnimationObserver.h */; };
BCAA90C30A7EBA60008B1229 /* ScrollBar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCAA90C20A7EBA60008B1229 /* ScrollBar.cpp */; };
BCB16AF90979A08500467741 /* FloatRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16AF50979A08500467741 /* FloatRect.cpp */; };
- BCB16AFA0979A08500467741 /* FloatRect.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16AF60979A08500467741 /* FloatRect.h */; };
+ BCB16AFA0979A08500467741 /* FloatRect.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16AF60979A08500467741 /* FloatRect.h */; settings = {ATTRIBUTES = (Private, ); }; };
BCB16AFB0979A08500467741 /* IntRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16AF70979A08500467741 /* IntRect.cpp */; };
BCB16AFC0979A08500467741 /* IntRect.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16AF80979A08500467741 /* IntRect.h */; settings = {ATTRIBUTES = (Private, ); }; };
BCB16B8B0979B01400467741 /* DeprecatedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16B880979B01400467741 /* DeprecatedArray.h */; settings = {ATTRIBUTES = (Private, ); }; };
#import "BlockExceptions.h"
#import "FloatRect.h"
-#import "FrameMac.h"
#import "FrameLoadRequest.h"
+#import "FrameMac.h"
#import "FrameTree.h"
#import "KURL.h"
#import "Page.h"
NSString *frameName = request.m_frameName.isEmpty() ? nil : (NSString*)request.m_frameName;
if (frameName) {
- // FIXME: Can't we just use m_frame->findFrame?
- // ANSWER: No, because such a method doesn't exist - YET
- if (WebCoreFrameBridge *frameBridge = [m_frame->bridge() findFrameNamed:frameName]) {
+ if (Frame* frame = m_frame->tree()->find(frameName)) {
if (!url.isEmpty())
- [frameBridge _frame]->loadRequest(request, true, nil, nil, nil);
-
- [frameBridge activateWindow];
-
- newFrame = [frameBridge _frame];
-
+ Mac(frame)->loadRequest(request, true, nil, nil, nil);
+ [Mac(frame)->bridge() activateWindow];
+ newFrame = frame;
return;
}
}
#ifdef __OBJC__
-// Avoid clashes with KJS::DOMElement in KHTML code.
-@class DOMElement;
-typedef DOMElement ObjCDOMElement;
-
@class WebCorePageState;
@class NSArray;
@class NSAttributedString;
#else
-// Avoid clashes with KJS::DOMElement in KHTML code.
-class ObjCDOMElement;
-
class WebCorePageState;
class NSArray;
class NSAttributedString;
FrameMac(Page*, Element*, PassRefPtr<EditorClient>);
~FrameMac();
- // FIXME: Merge these and move them into WebFrameLoader.
- void loadRequest(const FrameLoadRequest&, bool userGesture, NSEvent* triggeringEvent = 0, ObjCDOMElement* submitForm = 0, NSMutableDictionary* formValues = 0);
+ // FIXME: Merge these and move them into FrameLoader.
+ void loadRequest(const FrameLoadRequest&, bool userGesture, NSEvent* triggeringEvent = 0, Element* submitForm = 0, NSMutableDictionary* formValues = 0);
virtual void urlSelected(const FrameLoadRequest&, const Event* triggeringEvent);
virtual Frame* createFrame(const KURL&, const String& name, Element* ownerElement, const String& referrer);
void openURLFromPageCache(WebCorePageState*);
#import "WebCoreSystemInterface.h"
#import "WebCoreViewFactory.h"
#import "WebDashboardRegion.h"
+#import "WebFrameLoaderClient.h"
#import "WebScriptObjectPrivate.h"
#import "csshelper.h"
#import "htmlediting.h"
#pragma mark BEGIN LOADING FUNCTIONS
-void FrameMac::loadRequest(const FrameLoadRequest& request, bool userGesture, NSEvent* triggeringEvent, ObjCDOMElement* submitForm, NSMutableDictionary* formValues)
+void FrameMac::loadRequest(const FrameLoadRequest& request, bool userGesture, NSEvent* triggeringEvent, Element* submitForm, NSMutableDictionary* formValues)
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
if (!argsReferrer.isEmpty())
referrer = argsReferrer;
else
- referrer = [_bridge referrer];
+ referrer = FrameMac::referrer();
BOOL hideReferrer;
if (![_bridge canLoadURL:request.m_request.url().getNSURL() fromReferrer:referrer hideReferrer:&hideReferrer])
return;
+ if (hideReferrer)
+ referrer = nil;
- WebCoreFrameBridge *targetFrame = [_bridge findFrameNamed:request.m_frameName];
- if (![_bridge canTargetLoadInFrame:targetFrame]) {
+ WebCoreFrameBridge *targetFrame = Mac(tree()->find(request.m_frameName))->bridge();
+ if (![_bridge canTargetLoadInFrame:targetFrame])
return;
- }
if (request.m_request.httpMethod() != "POST") {
FrameLoadType loadType;
else
loadType = FrameLoadTypeStandard;
- d->m_frameLoader->load(request.m_request.url().getNSURL(), (hideReferrer ? nil : referrer), loadType,
+ d->m_frameLoader->load(request.m_request.url().getNSURL(), referrer, loadType,
(request.m_frameName.length() ? (NSString *)request.m_frameName : nil), triggeringEvent, submitForm, formValues);
} else
- d->m_frameLoader->post(request.m_request.url().getNSURL(), (hideReferrer ? nil : referrer), (request.m_frameName.length() ? (NSString *)request.m_frameName : nil),
+ d->m_frameLoader->post(request.m_request.url().getNSURL(), referrer, (request.m_frameName.length() ? (NSString *)request.m_frameName : nil),
arrayFromFormData(request.m_request.httpBody()), request.m_request.httpContentType(), triggeringEvent, submitForm, formValues);
if (targetFrame != nil && _bridge != targetFrame) {
d->m_submittedFormURL = request.m_request.url();
}
- ObjCDOMElement* submitForm = [DOMElement _elementWith:d->m_formAboutToBeSubmitted.get()];
NSMutableDictionary* formValues = createNSDictionary(d->m_formValuesAboutToBeSubmitted);
- loadRequest(request, true, _currentEvent, submitForm, formValues);
+ loadRequest(request, true, _currentEvent, d->m_formAboutToBeSubmitted.get(), formValues);
[formValues release];
clearRecordedFormValues();
if (d->m_scheduledRedirection != historyNavigationScheduled) {
NSTimeInterval interval = d->m_redirectionTimer.nextFireInterval();
NSDate *fireDate = [[NSDate alloc] initWithTimeIntervalSinceNow:interval];
- [_bridge reportClientRedirectToURL:KURL(d->m_redirectURL).getNSURL()
- delay:d->m_delayRedirect
- fireDate:fireDate
- lockHistory:d->m_redirectLockHistory
- isJavaScriptFormAction:d->m_executingJavaScriptFormAction];
+ loader()->clientRedirected(KURL(d->m_redirectURL).getNSURL(),
+ d->m_delayRedirect, fireDate, d->m_redirectLockHistory, d->m_executingJavaScriptFormAction);
[fireDate release];
}
}
// Don't report history navigations, just actual redirection.
if (wasActive && d->m_scheduledRedirection != historyNavigationScheduled)
- [_bridge reportClientRedirectCancelled:d->m_cancelWithLoadInProgress];
+ loader()->clientRedirectCancelledOrFinished(d->m_cancelWithLoadInProgress);
}
String FrameMac::userAgent() const
_sendingEventToSubview = false;
}
-bool FrameMac::passSubframeEventToSubframe(MouseEventWithHitTestResults& event, Frame* subframePart)
+bool FrameMac::passSubframeEventToSubframe(MouseEventWithHitTestResults& event, Frame* subframe)
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
switch ([_currentEvent type]) {
- case NSMouseMoved: {
- ASSERT(subframePart);
- [Mac(subframePart)->_bridge mouseMoved:_currentEvent];
+ case NSMouseMoved:
+ Mac(subframe)->mouseMoved(_currentEvent);
return true;
- }
case NSLeftMouseDown: {
- Node *node = event.targetNode();
- if (!node) {
+ Node* node = event.targetNode();
+ if (!node)
return false;
- }
RenderObject *renderer = node->renderer();
- if (!renderer || !renderer->isWidget()) {
+ if (!renderer || !renderer->isWidget())
return false;
- }
Widget *widget = static_cast<RenderWidget*>(renderer)->widget();
if (!widget || !widget->isFrameView())
return false;
- if (!passWidgetMouseDownEventToWidget(static_cast<RenderWidget*>(renderer))) {
+ if (!passWidgetMouseDownEventToWidget(static_cast<RenderWidget*>(renderer)))
return false;
- }
_mouseDownWasInSubframe = true;
return true;
}
case NSLeftMouseUp: {
- if (!_mouseDownWasInSubframe) {
+ if (!_mouseDownWasInSubframe)
return false;
- }
NSView *view = mouseDownViewIfStillGood();
- if (!view) {
+ if (!view)
return false;
- }
ASSERT(!_sendingEventToSubview);
_sendingEventToSubview = true;
[view mouseUp:_currentEvent];
return true;
}
case NSLeftMouseDragged: {
- if (!_mouseDownWasInSubframe) {
+ if (!_mouseDownWasInSubframe)
return false;
- }
NSView *view = mouseDownViewIfStillGood();
- if (!view) {
+ if (!view)
return false;
- }
ASSERT(!_sendingEventToSubview);
_sendingEventToSubview = true;
[view mouseDragged:_currentEvent];
void FrameMac::handledOnloadEvents()
{
- [_bridge handledOnloadEvents];
+ loader()->client()->dispatchDidHandleOnloadEvents();
}
bool FrameMac::shouldClose()
bool FrameMac::isLoadTypeReload()
{
- return [_bridge isLoadTypeReload];
+ return loader()->loadType() == FrameLoadTypeReload;
}
int FrameMac::getHistoryLength()
+ (NSArray *)supportedImageMIMETypes;
+ (NSArray *)supportedImageResourceMIMETypes; // includes types like PDF
-- (void)initializeSettings:(WebCoreSettings *)settings;
-
-- (void)setName:(NSString *)name;
-- (NSString *)name;
-
-- (WebCorePageBridge *)page;
-
-- (WebCoreFrameBridge *)firstChild;
-- (WebCoreFrameBridge *)lastChild;
-- (WebCoreFrameBridge *)previousSibling;
-- (WebCoreFrameBridge *)nextSibling;
-
-- (BOOL)isMainFrame;
-
-- (void)appendChild:(WebCoreFrameBridge *)child;
-- (void)removeChild:(WebCoreFrameBridge *)child;
-
-- (unsigned)childCount;
-- (BOOL)isDescendantOfFrame:(WebCoreFrameBridge *)ancestor;
-- (WebCoreFrameBridge *)traverseNextFrameStayWithin:(WebCoreFrameBridge *)stayWithin;
-
-- (WebCoreFrameBridge *)nextFrameWithWrap:(BOOL)wrap;
-- (WebCoreFrameBridge *)previousFrameWithWrap:(BOOL)wrap;
-
-- (WebCoreFrameBridge *)childFrameNamed:(NSString *)name;
-- (WebCoreFrameBridge *)findFrameNamed:(NSString *)name;
-
- (void)openURL:(NSURL *)URL reload:(BOOL)reload
contentType:(NSString *)contentType refresh:(NSString *)refresh lastModified:(NSDate *)lastModified
pageCache:(NSDictionary *)pageCache;
- (void)saveDocumentState;
- (void)restoreDocumentState;
-- (BOOL)canCachePage;
- (BOOL)saveDocumentToPageCache;
- (void)clearFrame;
-- (void)handleFallbackContent;
-- (NSURL *)URL;
- (NSURL *)baseURL;
-- (NSString *)referrer;
-- (WebCoreFrameBridge *)opener;
-- (void)setOpener:(WebCoreFrameBridge *)bridge;
- (void)installInFrame:(NSView *)view;
- (void)removeFromFrame;
- (void)adjustPageHeightNew:(float *)newBottom top:(float)oldTop bottom:(float)oldBottom limit:(float)bottomLimit;
- (NSArray*)computePageRectsWithPrintWidthScaleFactor:(float)printWidthScaleFactor printHeight:(float)printHeight;
-- (void)setActivationEventNumber:(int)num;
-- (void)mouseDown:(NSEvent *)event;
-- (void)mouseUp:(NSEvent *)event;
-- (void)mouseMoved:(NSEvent *)event;
-- (void)mouseDragged:(NSEvent *)event;
-
-// these return YES if event is eaten by WebCore
-- (BOOL)sendContextMenuEvent:(NSEvent *)event;
-
- (NSView *)nextKeyView;
- (NSView *)previousKeyView;
- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)string forceUserGesture:(BOOL)forceUserGesture;
- (NSAppleEventDescriptor *)aeDescByEvaluatingJavaScriptFromString:(NSString *)string;
-- (DOMDocument *)DOMDocument;
-- (DOMHTMLElement *)frameElement;
-
-- (BOOL)isSelectionInPasswordField;
-- (BOOL)isSelectionEditable;
-- (BOOL)isSelectionRichlyEditable;
-- (WebSelectionState)selectionState;
-
- (BOOL)mayCopy;
- (NSAttributedString *)selectedAttributedString;
- (NSString *)selectedString;
-- (void)setSelectionFromNone;
-- (void)setIsActive:(BOOL)flag;
-
-- (void)setWindowHasFocus:(BOOL)flag;
-
- (NSString *)stringForRange:(DOMRange *)range;
- (NSString *)markupStringFromNode:(DOMNode *)node nodes:(NSArray **)nodes;
- (void)deselectAll;
- (void)deselectText;
-- (NSRect)selectionRect;
-- (NSRect)visibleSelectionRect;
-- (void)centerSelectionInVisibleArea;
-- (NSImage *)selectionImageForcingWhiteText:(BOOL)forceWhiteText;
- (NSRect)caretRectAtNode:(DOMNode *)node offset:(int)offset affinity:(NSSelectionAffinity)affinity;
- (NSRect)firstRectForDOMRange:(DOMRange *)range;
- (void)scrollDOMRangeToVisible:(DOMRange *)range;
- (void)setSelectedDOMRange:(DOMRange *)range affinity:(NSSelectionAffinity)selectionAffinity closeTyping:(BOOL)closeTyping;
-- (DOMRange *)selectedDOMRange;
- (NSSelectionAffinity)selectionAffinity;
// Emacs-style-editing "mark"
- (NSString *)stringWithData:(NSData *)data; // using the encoding of the frame's main resource
+ (NSString *)stringWithData:(NSData *)data textEncodingName:(NSString *)textEncodingName; // nil for textEncodingName means Latin-1
-- (BOOL)interceptKeyEvent:(NSEvent *)event toView:(NSView *)view;
-
- (void)setShouldCreateRenderers:(BOOL)f;
- (BOOL)shouldCreateRenderers;
- (int)numPendingOrLoadingRequests;
- (BOOL)doneProcessingData;
-- (BOOL)shouldClose;
- (void)setBaseBackgroundColor:(NSColor *)backgroundColor;
- (void)setDrawsBackground:(BOOL)drawsBackround;
-- (NSColor *)bodyBackgroundColor;
- (NSColor *)selectionColor;
-- (void)adjustViewSize;
-
- (id)accessibilityTree;
- (void)undoEditing:(id)arg;
- (void)setSelectionToDragCaret;
- (void)moveSelectionToDragCaret:(DOMDocumentFragment *)selectionFragment smartMove:(BOOL)smartMove;
- (void)moveDragCaretToPoint:(NSPoint)point;
-- (void)removeDragCaret;
- (DOMRange *)dragCaretDOMRange;
- (BOOL)isDragCaretRichlyEditable;
- (DOMRange *)editableDOMRangeForPoint:(NSPoint)point;
- (BOOL)selectionStartHasStyle:(DOMCSSStyleDeclaration *)style;
- (NSCellStateValue)selectionHasStyle:(DOMCSSStyleDeclaration *)style;
-- (WebScriptObject *)windowScriptObject;
-- (NPObject *)windowScriptNPObject;
-
- (NSDragOperation)dragOperationForDraggingInfo:(id <NSDraggingInfo>)info;
- (void)dragExitedWithDraggingInfo:(id <NSDraggingInfo>)info;
- (BOOL)concludeDragForDraggingInfo:(id <NSDraggingInfo>)info;
- (void)setTitle:(NSString *)title;
- (NSURL*)originalRequestURL;
-- (BOOL)isLoadTypeReload;
- (void)frameDetached;
- (void)tokenizerProcessedData;
- (void)receivedData:(NSData *)data textEncodingName:(NSString *)textEncodingName;
- (void)objectLoadedFromCacheWithURL:(NSURL *)URL response:(NSURLResponse *)response data:(NSData *)data;
- (NSData *)syncLoadResourceWithMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)requestHeaders postData:(NSArray *)postData finalURL:(NSURL **)finalNSURL responseHeaders:(NSDictionary **)responseHeaderDict statusCode:(int *)statusCode;
- (BOOL)isReloading;
-- (void)reportClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date lockHistory:(BOOL)lockHistory isJavaScriptFormAction:(BOOL)isJavaScriptFormAction;
-- (void)reportClientRedirectCancelled:(BOOL)cancelWithLoadInProgress;
- (NSString *)incomingReferrer;
-- (NSURLResponse*)mainResourceURLResponse;
- (void)loadEmptyDocumentSynchronously;
-- (void)handledOnloadEvents;
@end
using KJS::DateInstance;
using KJS::ExecState;
using KJS::GetterSetterType;
-using KJS::Identifier;
-using KJS::Interpreter;
using KJS::JSLock;
using KJS::JSObject;
-using KJS::JSType;
using KJS::JSValue;
-using KJS::List;
using KJS::NullType;
using KJS::NumberType;
using KJS::ObjectType;
using KJS::SavedBuiltins;
using KJS::SavedProperties;
using KJS::StringType;
-using KJS::UString;
using KJS::UndefinedType;
using KJS::UnspecifiedType;
using KJS::Window;
NSString *WebCorePageCacheStateKey = @"WebCorePageCacheState";
@interface WebCoreFrameBridge (WebCoreBridgeInternal)
-- (RootObject *)executionContextForView:(NSView *)aView;
+- (RootObject*)executionContextForView:(NSView *)aView;
@end
-static RootObject *rootForView(void *v)
+static RootObject* rootForView(void* v)
{
NSView *aView = (NSView *)v;
WebCoreFrameBridge *aBridge = [[WebCoreViewFactory sharedFactory] bridgeForView:aView];
static pthread_t mainThread = 0;
-static void updateRenderingForBindings (ExecState *exec, JSObject *rootObject)
+static void updateRenderingForBindings(ExecState* exec, JSObject* rootObject)
{
if (pthread_self() != mainThread)
return;
if (!rootObject)
return;
- Window *window = static_cast<Window*>(rootObject);
+ Window* window = static_cast<Window*>(rootObject);
if (!window)
return;
- Document *doc = static_cast<Document*>(window->frame()->document());
+ Document* doc = static_cast<Document*>(window->frame()->document());
if (doc)
doc->updateRendering();
}
return Mac(frame)->bridge();
}
-- (WebCoreFrameBridge *)firstChild
-{
- return bridge(m_frame->tree()->firstChild());
-}
-
-- (WebCoreFrameBridge *)lastChild
-{
- return bridge(m_frame->tree()->lastChild());
-}
-
-- (unsigned)childCount
-{
- return m_frame->tree()->childCount();
-}
-
-- (WebCoreFrameBridge *)previousSibling;
-{
- return bridge(m_frame->tree()->previousSibling());
-}
-
-- (WebCoreFrameBridge *)nextSibling;
-{
- return bridge(m_frame->tree()->nextSibling());
-}
-
-- (BOOL)isDescendantOfFrame:(WebCoreFrameBridge *)ancestor
-{
- return m_frame->tree()->isDescendantOf(ancestor->m_frame);
-}
-
-- (WebCoreFrameBridge *)traverseNextFrameStayWithin:(WebCoreFrameBridge *)stayWithin
-{
- return bridge(m_frame->tree()->traverseNext(stayWithin->m_frame));
-}
-
-- (void)appendChild:(WebCoreFrameBridge *)child
-{
- m_frame->tree()->appendChild(adoptRef(child->m_frame));
-}
-
-- (void)removeChild:(WebCoreFrameBridge *)child
-{
- m_frame->tree()->removeChild(child->m_frame);
-}
-
-- (WebCoreFrameBridge *)childFrameNamed:(NSString *)name
-{
- return bridge(m_frame->tree()->child(name));
-}
-
-- (WebCoreFrameBridge *)nextFrameWithWrap:(BOOL)wrapFlag
-{
- return bridge(m_frame->tree()->traverseNextWithWrap(wrapFlag));
-}
-
-- (WebCoreFrameBridge *)previousFrameWithWrap:(BOOL)wrapFlag
-{
- return bridge(m_frame->tree()->traversePreviousWithWrap(wrapFlag));
-}
-
- (NSString *)domain
{
Document *doc = m_frame->document();
// <rdar://problem/3715785> multiple frame injection vulnerability reported by Secunia, affects almost all browsers
// don't mess with navigation within the same page/frameset
- if ([self page] == [targetFrame page])
+ if (m_frame->page() == [targetFrame _frame]->page())
return YES;
// Normally, domain should be called on the DOMDocument since it is a DOM method, but this fix is needed for
// Jaguar as well where the DOM API doesn't exist.
NSString *thisDomain = [self domain];
- if ([thisDomain length] == 0) {
+ if ([thisDomain length] == 0)
// Allow if the request is made from a local file.
return YES;
- }
Frame *target = [targetFrame _frame];
WebCoreFrameBridge *parentBridge = target ? Mac(target->tree()->parent())->bridge() : nil;
return NO;
}
-- (WebCoreFrameBridge *)findFrameNamed:(NSString *)name
-{
- return bridge(m_frame->tree()->find(name));
-}
-
+ (NSArray *)supportedNonImageMIMETypes
{
return [NSArray arrayWithObjects:
return self;
}
-- (WebCorePageBridge *)page
-{
- return m_frame->page()->bridge();
-}
-
-- (void)initializeSettings:(WebCoreSettings *)settings
-{
- m_frame->setSettings([settings settings]);
-}
-
- (void)dealloc
{
ASSERT(_closed);
return result;
}
-- (BOOL)canCachePage
-{
- return m_frame->canCachePage();
-}
-
- (void)clearFrame
{
m_frame = 0;
}
-- (void)handleFallbackContent
-{
- // this needs to be callable even after teardown of the frame
- if (!m_frame)
- return;
- m_frame->handleFallbackContent();
-}
-
- (void)createFrameViewWithNSView:(NSView *)view marginWidth:(int)mw marginHeight:(int)mh
{
// If we own the view, delete the old one - otherwise the render m_frame will take care of deleting the view.
frameView->setMarginHeight(mh);
}
-- (BOOL)isSelectionInPasswordField
-{
- return m_frame->isSelectionInPasswordField();
-}
-
-- (BOOL)isSelectionEditable
-{
- return m_frame->selectionController()->isContentEditable();
-}
-
-- (BOOL)isSelectionRichlyEditable
-{
- return m_frame->selectionController()->isContentRichlyEditable();
-}
-
- (WebSelectionState)selectionState
{
switch (m_frame->selectionController()->state()) {
{
[self _setupRootForPrinting:YES];
m_frame->forceLayout();
- if (flag) {
- [self adjustViewSize];
- }
+ if (flag)
+ m_frame->view()->adjustViewSize();
[self _setupRootForPrinting:NO];
}
{
[self _setupRootForPrinting:YES];
m_frame->forceLayoutWithPageWidthRange(minPageWidth, maxPageWidth);
- if (flag) {
- [self adjustViewSize];
- }
+ if (flag)
+ m_frame->view()->adjustViewSize();
[self _setupRootForPrinting:NO];
}
{
// If this isn't the main frame, it must have a render m_frame set, or it
// won't ever get installed in the view hierarchy.
- ASSERT(self == [[self page] mainFrame] || m_frame->ownerElement());
+ ASSERT(m_frame == m_frame->page()->mainFrame() || m_frame->ownerElement());
m_frame->view()->setView(view);
// FIXME: frame tries to do this too, is it needed?
m_frame->view()->initScrollbars();
}
-- (void)setActivationEventNumber:(int)num
-{
- m_frame->setActivationEventNumber(num);
-}
-
-- (void)mouseDown:(NSEvent *)event
-{
- m_frame->mouseDown(event);
-}
-
-- (void)mouseDragged:(NSEvent *)event
-{
- m_frame->mouseDragged(event);
-}
-
-- (void)mouseUp:(NSEvent *)event
-{
- m_frame->mouseUp(event);
-}
-
-- (void)mouseMoved:(NSEvent *)event
-{
- m_frame->mouseMoved(event);
-}
-
-- (BOOL)sendContextMenuEvent:(NSEvent *)event
-{
- return m_frame->sendContextMenuEvent(event);
-}
-
- (DOMElement*)elementForView:(NSView*)view
{
// FIXME: implemented currently for only a subset of the KWQ widgets
return aeDescFromJSValue(m_frame->jScript()->interpreter()->globalExec(), result);
}
-- (WebScriptObject *)windowScriptObject
-{
- return m_frame->windowScriptObject();
-}
-
-- (NPObject *)windowScriptNPObject
-{
- return m_frame->windowScriptNPObject();
-}
-
-- (DOMDocument *)DOMDocument
-{
- return [DOMDocument _documentWith:m_frame->document()];
-}
-
-- (DOMHTMLElement *)frameElement
-{
- // Not [[self DOMDocument] _ownerElement], since our doc is not set up at the start of our own load.
- // FIXME: There really is no guarantee this is an HTML element.
- // For example, it could be something like an SVG foreign object element.
- // Because of that, I believe the cast here is wrong and also the public API
- // of WebKit might have to be changed.
- return (DOMHTMLElement *)[DOMElement _elementWith:m_frame->ownerElement()];
-}
-
- (NSAttributedString *)selectedAttributedString
{
// FIXME: should be a no-arg version of attributedString() that does this
return m_frame->attributedString([start _node], startOffset, [end _node], endOffset);
}
-- (NSRect)selectionRect
-{
- return m_frame->selectionRect();
-}
-
-- (NSRect)visibleSelectionRect
-{
- return m_frame->visibleSelectionRect();
-}
-
-- (void)centerSelectionInVisibleArea
-{
- m_frame->revealSelection(RenderLayer::gAlignCenterAlways);
-}
-
- (NSRect)caretRectAtNode:(DOMNode *)node offset:(int)offset affinity:(NSSelectionAffinity)affinity
{
return [node _node]->renderer()->caretRect(offset, static_cast<EAffinity>(affinity));
}
+
- (NSRect)firstRectForDOMRange:(DOMRange *)range
{
int extraWidthToEndOfLine = 0;
}
}
-- (NSImage *)selectionImageForcingWhiteText:(BOOL)forceWhiteText;
-{
- return m_frame->selectionImage(forceWhiteText);
-}
-
-- (void)setName:(NSString *)name
-{
- m_frame->tree()->setName(name);
-}
-
-- (NSString *)name
-{
- return m_frame->tree()->name();
-}
-
-- (NSURL *)URL
-{
- return m_frame->url().getNSURL();
-}
-
- (NSURL *)baseURL
{
return m_frame->completeURL(m_frame->document()->baseURL()).getNSURL();
}
-- (NSString *)referrer
-{
- return m_frame->referrer();
-}
-
-- (WebCoreFrameBridge *)opener
-{
- Frame *openerPart = m_frame->opener();
-
- if (openerPart)
- return Mac(openerPart)->bridge();
-
- return nil;
-}
-
-- (void)setOpener:(WebCoreFrameBridge *)bridge;
-{
- if (Frame* f = [bridge _frame])
- f->setOpener(m_frame);
-}
-
- (NSString *)stringWithData:(NSData *)data
{
Document* doc = m_frame->document();
renderer->setNeedsLayout(true);
}
-- (BOOL)interceptKeyEvent:(NSEvent *)event toView:(NSView *)view
-{
- return m_frame->keyEvent(event);
-}
-
- (NSString *)renderTreeAsExternalRepresentation
{
return externalRepresentation(m_frame->renderer()).getNSString();
}
-- (void)setSelectionFromNone
-{
- m_frame->setSelectionFromNone();
-}
-
-- (void)setIsActive:(BOOL)flag
-{
- m_frame->setIsActive(flag);
-}
-
-- (void)setWindowHasFocus:(BOOL)flag
-{
- m_frame->setWindowHasFocus(flag);
-}
-
- (void)setShouldCreateRenderers:(BOOL)f
{
_shouldCreateRenderers = f;
- (int)numPendingOrLoadingRequests
{
Document *doc = m_frame->document();
-
if (doc)
- return NumberOfPendingOrLoadingRequests (doc->docLoader());
+ return NumberOfPendingOrLoadingRequests(doc->docLoader());
return 0;
}
return YES;
}
-- (BOOL)shouldClose
-{
- return m_frame->shouldClose();
-}
-
-- (NSColor *)bodyBackgroundColor
-{
- return m_frame->bodyBackgroundColor();
-}
-
-// FIXME: Not sure what this method is for. It seems to only be used by plug-ins over in WebKit.
- (NSColor *)selectionColor
{
return m_frame->isActive() ? [NSColor selectedTextBackgroundColor] : [NSColor secondarySelectedControlColor];
}
-- (void)adjustViewSize
-{
- FrameView *view = m_frame->view();
- if (view)
- view->adjustViewSize();
-}
-
- (id)accessibilityTree
{
AXObjectCache::enableAccessibility();
m_frame->selectionController()->setSelection(selection, closeTyping);
}
-- (DOMRange *)selectedDOMRange
-{
- return [DOMRange _rangeWith:m_frame->selectionController()->toRange().get()];
-}
-
- (NSRange)convertToNSRange:(Range *)range
{
int exception = 0;
- (void)replaceSelectionWithNode:(DOMNode *)node selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle
{
- DOMDocumentFragment *fragment = [[self DOMDocument] createDocumentFragment];
+ DOMDocumentFragment *fragment = [DOMDocumentFragment _documentFragmentWith:m_frame->document()->createDocumentFragment().get()];
[fragment appendChild:node];
[self replaceSelectionWithFragment:fragment selectReplacement:selectReplacement smartReplace:smartReplace matchStyle:matchStyle];
}
m_frame->dragCaretController()->setSelection(dragCaret);
}
-- (void)removeDragCaret
-{
- m_frame->dragCaretController()->clear();
-}
-
- (DOMRange *)dragCaretDOMRange
{
return [DOMRange _rangeWith:m_frame->dragCaretController()->toRange().get()];
- (NSWritingDirection)baseWritingDirectionForSelectionStart
{
- // FIXME: remove this NSWritingDirection cast once <rdar://problem/4509035> is fixed
return m_frame ? m_frame->baseWritingDirectionForSelectionStart() : (NSWritingDirection)NSWritingDirectionLeftToRight;
}
if (!clipboard->destinationOperation(&op)) {
// The element accepted but they didn't pick an operation, so we pick one for them
// (as does WinIE).
- if (srcOp & NSDragOperationCopy) {
+ if (srcOp & NSDragOperationCopy)
op = NSDragOperationCopy;
- } else if (srcOp & NSDragOperationMove || srcOp & NSDragOperationGeneric) {
+ else if (srcOp & NSDragOperationMove || srcOp & NSDragOperationGeneric)
op = NSDragOperationMove;
- } else if (srcOp & NSDragOperationLink) {
+ else if (srcOp & NSDragOperationLink)
op = NSDragOperationLink;
- } else {
+ else
op = NSDragOperationGeneric;
- }
} else if (!(op & srcOp)) {
// make sure WC picked an op that was offered. Cocoa doesn't seem to enforce this,
// but IE does.
return [self canProvideDocumentSource];
}
-- (BOOL)isMainFrame
-{
- return m_frame->page()->mainFrame() == m_frame;
-}
-
static NSString *stringByCollapsingNonPrintingCharacters(NSString *string)
{
NSMutableString *result = [NSMutableString string];
while (position != length) {
NSRange nonSpace = [string rangeOfCharacterFromSet:charactersToNotTurnIntoSpaces
options:0 range:NSMakeRange(position, length - position)];
- if (nonSpace.location == NSNotFound) {
+ if (nonSpace.location == NSNotFound)
break;
- }
NSRange space = [string rangeOfCharacterFromSet:charactersToTurnIntoSpaces
options:0 range:NSMakeRange(nonSpace.location, length - nonSpace.location)];
- if (space.location == NSNotFound) {
+ if (space.location == NSNotFound)
space.location = length;
- }
if (space.location > nonSpace.location) {
- if (position != 0) {
+ if (position != 0)
[result appendString:@" "];
- }
[result appendString:[string substringWithRange:
NSMakeRange(nonSpace.location, space.location - nonSpace.location)]];
}
return [m_frame->loader()->activeDocumentLoader()->initialRequest() URL];
}
-- (BOOL)isLoadTypeReload
-{
- return m_frame->loader()->loadType() == FrameLoadTypeReload;
-}
-
- (void)frameDetached
{
m_frame->loader()->stopLoading();
- (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)resourceLoader withMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)customHeaders
{
- // If we are no longer attached to a Page, this must be an attempted load from an
- // onUnload handler, so let's just block it.
- if ([self page] == nil)
+ // If we are no longer attached to a page, this must be an attempted load from an
+ // onunload handler, so let's just block it.
+ if (!m_frame->page())
return nil;
// Since this is a subresource, we can load any URL (we ignore the return value).
// But we still want to know whether we should hide the referrer or not, so we call the canLoadURL method.
+ NSString *referrer = m_frame->referrer();
BOOL hideReferrer;
- [self canLoadURL:URL fromReferrer:[self referrer] hideReferrer:&hideReferrer];
+ [self canLoadURL:URL fromReferrer:referrer hideReferrer:&hideReferrer];
+ if (hideReferrer)
+ referrer = nil;
- return SubresourceLoader::create(m_frame, resourceLoader,
- method, URL, customHeaders, hideReferrer ? nil : [self referrer]);
+ return SubresourceLoader::create(m_frame, resourceLoader, method, URL, customHeaders, referrer);
}
- (void)objectLoadedFromCacheWithURL:(NSURL *)URL response:(NSURLResponse *)response data:(NSData *)data
customHeaders:(NSDictionary *)customHeaders postData:(NSArray *)postData
{
// If we are no longer attached to a Page, this must be an attempted load from an
- // onUnload handler, so let's just block it.
- if ([self page] == nil)
+ // onunload handler, so let's just block it.
+ if (!m_frame->page())
return nil;
// Since this is a subresource, we can load any URL (we ignore the return value).
// But we still want to know whether we should hide the referrer or not, so we call the canLoadURL method.
+ NSString *referrer = m_frame->referrer();
BOOL hideReferrer;
- [self canLoadURL:URL fromReferrer:[self referrer] hideReferrer:&hideReferrer];
+ [self canLoadURL:URL fromReferrer:referrer hideReferrer:&hideReferrer];
+ if (hideReferrer)
+ referrer = nil;
- return SubresourceLoader::create(m_frame, resourceLoader,
- method, URL, customHeaders, postData, hideReferrer ? nil : [self referrer]);
-}
-
-- (void)reportClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date lockHistory:(BOOL)lockHistory isJavaScriptFormAction:(BOOL)isJavaScriptFormAction
-{
- m_frame->loader()->clientRedirected(URL, seconds, date, lockHistory, isJavaScriptFormAction);
-}
-
-- (void)reportClientRedirectCancelled:(BOOL)cancelWithLoadInProgress
-{
- m_frame->loader()->clientRedirectCancelledOrFinished(cancelWithLoadInProgress);
+ return SubresourceLoader::create(m_frame, resourceLoader, method, URL, customHeaders, postData, referrer);
}
- (NSData *)syncLoadResourceWithMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)requestHeaders postData:(NSArray *)postData finalURL:(NSURL **)finalURL responseHeaders:(NSDictionary **)responseHeaderDict statusCode:(int *)statusCode
{
// Since this is a subresource, we can load any URL (we ignore the return value).
// But we still want to know whether we should hide the referrer or not, so we call the canLoadURL method.
+ NSString *referrer = m_frame->referrer();
BOOL hideReferrer;
- [self canLoadURL:URL fromReferrer:[self referrer] hideReferrer:&hideReferrer];
+ [self canLoadURL:URL fromReferrer:referrer hideReferrer:&hideReferrer];
+ if (hideReferrer)
+ referrer = nil;
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:URL];
[request setTimeoutInterval:10];
else
[request setCachePolicy:[m_frame->loader()->documentLoader()->request() cachePolicy]];
- if (!hideReferrer)
- setHTTPReferrer(request, [self referrer]);
+ if (referrer)
+ setHTTPReferrer(request, referrer);
- WebCorePageBridge *page = [self page];
- [request setMainDocumentURL:[[[page mainFrame] _frame]->loader()->documentLoader()->request() URL]];
+ [request setMainDocumentURL:[m_frame->page()->mainFrame()->loader()->documentLoader()->request() URL]];
[request setValue:[self userAgentForURL:[request URL]] forHTTPHeaderField:@"User-Agent"];
NSError *error = nil;
} else {
*finalURL = URL;
*responseHeaderDict = [NSDictionary dictionary];
- if ([error domain] == NSURLErrorDomain) {
+ if ([error domain] == NSURLErrorDomain)
*statusCode = [error code];
- } else {
+ else
*statusCode = 404;
- }
}
m_frame->loader()->sendRemainingDelegateMessages(identifier, response, [result length], error);
return result;
}
+
// -------------------
- (NSString *)incomingReferrer
return [m_frame->loader()->documentLoader()->request() cachePolicy] == NSURLRequestReloadIgnoringCacheData;
}
-- (void)handledOnloadEvents
-{
- m_frame->loader()->client()->dispatchDidHandleOnloadEvents();
-}
-
-- (NSURLResponse *)mainResourceURLResponse
-{
- return m_frame->loader()->documentLoader()->response();
-}
-
- (void)loadEmptyDocumentSynchronously
{
if (!m_frame)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-typedef enum {
- WebFrameStateProvisional,
-
- // This state indicates we are ready to commit to a page,
- // which means the view will transition to use the new data source.
- WebFrameStateCommittedPage,
-
- WebFrameStateComplete
-} WebFrameState;
+namespace WebCore {
-typedef enum {
- WebPolicyUse,
- WebPolicyDownload,
- WebPolicyIgnore,
-} WebPolicyAction;
+ enum FrameState {
+ FrameStateProvisional,
+ // This state indicates we are ready to commit to a page,
+ // which means the view will transition to use the new data source.
+ FrameStateCommittedPage,
+ FrameStateComplete
+ };
-typedef enum {
- FrameLoadTypeStandard,
- FrameLoadTypeBack,
- FrameLoadTypeForward,
- FrameLoadTypeIndexedBackForward, // a multi-item hop in the backforward list
- FrameLoadTypeReload,
- FrameLoadTypeReloadAllowingStaleData,
- FrameLoadTypeSame, // user loads same URL again (but not reload button)
- FrameLoadTypeInternal,
- FrameLoadTypeReplace
-} FrameLoadType;
+ enum PolicyAction {
+ PolicyUse,
+ PolicyDownload,
+ PolicyIgnore,
+ };
-typedef enum {
- NavigationTypeLinkClicked,
- NavigationTypeFormSubmitted,
- NavigationTypeBackForward,
- NavigationTypeReload,
- NavigationTypeFormResubmitted,
- NavigationTypeOther
-} NavigationType;
+ enum FrameLoadType {
+ FrameLoadTypeStandard,
+ FrameLoadTypeBack,
+ FrameLoadTypeForward,
+ FrameLoadTypeIndexedBackForward, // a multi-item hop in the backforward list
+ FrameLoadTypeReload,
+ FrameLoadTypeReloadAllowingStaleData,
+ FrameLoadTypeSame, // user loads same URL again (but not reload button)
+ FrameLoadTypeInternal,
+ FrameLoadTypeReplace
+ };
+
+ enum NavigationType {
+ NavigationTypeLinkClicked,
+ NavigationTypeFormSubmitted,
+ NavigationTypeBackForward,
+ NavigationTypeReload,
+ NavigationTypeFormResubmitted,
+ NavigationTypeOther
+ };
+
+}
*/
#import "FrameLoaderTypes.h"
-#import "RetainPtr.h"
#import <wtf/Forward.h>
#import <wtf/HashSet.h>
#import <wtf/Noncopyable.h>
#import <wtf/RefPtr.h>
-@class DOMElement;
+#if PLATFORM(MAC)
+
+#import "RetainPtr.h"
+
@class WebCoreFrameBridge;
@class WebCoreFrameLoaderAsDelegate;
@class WebPolicyDecider;
+#endif
+
namespace WebCore {
class DocumentLoader;
+ class Element;
class FormState;
class Frame;
class FrameLoaderClient;
Frame* frame() const { return m_frame; }
+#if PLATFORM(MAC)
// FIXME: This is not cool, people.
void prepareForLoadStart();
void setupForReplace();
void load(NSURLRequest *, NSDictionary *triggeringAaction, FrameLoadType, PassRefPtr<FormState>);
void load(DocumentLoader*);
void load(DocumentLoader*, FrameLoadType, PassRefPtr<FormState>);
- void load(NSURL *, NSString *referrer, FrameLoadType, NSString *target, NSEvent *event, DOMElement *form, NSDictionary *formValues);
+ void load(NSURL *, NSString *referrer, FrameLoadType, NSString *target, NSEvent *event, Element* form, NSDictionary *formValues);
// Also not cool.
void stopLoadingPlugIns();
DocumentLoader* activeDocumentLoader() const;
DocumentLoader* documentLoader() const;
DocumentLoader* provisionalDocumentLoader();
- WebFrameState state() const;
+ FrameState state() const;
static double timeOfLastCompletedLoad();
bool defersCallbacks() const;
void sendRemainingDelegateMessages(id identifier, NSURLResponse *, unsigned length, NSError *);
NSURLRequest *requestFromDelegate(NSURLRequest *, id& identifier, NSError *& error);
- void post(NSURL *, NSString *referrer, NSString *target, NSArray *postData, NSString *contentType, NSEvent *, DOMElement *form, NSDictionary *formValues);
+ void post(NSURL *, NSString *referrer, NSString *target, NSArray *postData, NSString *contentType, NSEvent *, Element* form, NSDictionary *formValues);
void checkLoadComplete();
void detachFromParent();
void setClient(FrameLoaderClient*);
FrameLoaderClient* client() const;
- void continueAfterWillSubmitForm(WebPolicyAction);
- void continueAfterNewWindowPolicy(WebPolicyAction);
- void continueAfterNavigationPolicy(WebPolicyAction);
+ void continueAfterWillSubmitForm(PolicyAction);
+ void continueAfterNewWindowPolicy(PolicyAction);
+ void continueAfterNavigationPolicy(PolicyAction);
void continueLoadRequestAfterNavigationPolicy(NSURLRequest *, FormState*);
void continueFragmentScrollAfterNavigationPolicy(NSURLRequest *);
void continueLoadRequestAfterNewWindowPolicy(NSURLRequest *, NSString *frameName, FormState*);
+#endif
private:
+#if PLATFORM(MAC)
// Also not cool.
void startLoading();
bool startLoadingMainResource(NSMutableURLRequest *, id identifier);
bool isLoadingPlugIns() const;
- void setState(WebFrameState);
+ void setState(FrameState);
WebCoreFrameBridge *bridge() const;
void handleUnimplementablePolicy(NSError *);
bool shouldReloadToHandleUnreachableURL(NSURLRequest *);
+#endif
Frame* m_frame;
- RetainPtr<WebCoreFrameLoaderAsDelegate> m_asDelegate;
+ FrameLoaderClient* m_client;
+
+ FrameState m_state;
+ FrameLoadType m_loadType;
RefPtr<MainResourceLoader> m_mainResourceLoader;
HashSet<RefPtr<WebResourceLoader> > m_subresourceLoaders;
HashSet<RefPtr<WebResourceLoader> > m_plugInStreamLoaders;
- FrameLoaderClient* m_client;
+#if PLATFORM(MAC)
+ RetainPtr<WebCoreFrameLoaderAsDelegate> m_asDelegate;
RefPtr<DocumentLoader> m_documentLoader;
RefPtr<DocumentLoader> m_provisionalDocumentLoader;
RefPtr<DocumentLoader> m_policyDocumentLoader;
- WebFrameState m_state;
- FrameLoadType m_loadType;
-
// state we'll need to continue after waiting for the policy delegate's decision
RetainPtr<WebPolicyDecider> m_policyDecider;
bool m_firstLayoutDone;
bool m_quickRedirectComing;
bool m_sentRedirectNotification;
- bool m_isStoppingLoad;
+ bool m_isStoppingLoad;
+#endif
};
}
#import "HTMLNames.h"
#import "LoaderNSURLExtras.h"
#import "LoaderNSURLRequestExtras.h"
+#import "Page.h"
#import "WebCoreFrameBridge.h"
#import "WebCoreIconDatabaseBridge.h"
#import "WebCoreSystemInterface.h"
FrameLoader::FrameLoader(Frame* frame)
: m_frame(frame)
, m_client(nil)
- , m_state(WebFrameStateCommittedPage)
+ , m_state(FrameStateCommittedPage)
, m_loadType(FrameLoadTypeStandard)
, m_delegateIsHandlingProvisionalLoadError(false)
, m_delegateIsDecidingNavigationPolicy(false)
void FrameLoader::setupForReplace()
{
- setState(WebFrameStateProvisional);
+ setState(FrameStateProvisional);
m_provisionalDocumentLoader = m_documentLoader;
m_documentLoader = nil;
detachChildren();
load(loader.get(), type, formState);
}
-void FrameLoader::load(NSURL *URL, NSString *referrer, FrameLoadType newLoadType, NSString *target, NSEvent *event, DOMElement *form, NSDictionary *values)
+void FrameLoader::load(NSURL *URL, NSString *referrer, FrameLoadType newLoadType, NSString *target, NSEvent *event, Element* form, NSDictionary *values)
{
bool isFormSubmission = values != nil;
if (!isFormSubmission
&& newLoadType != FrameLoadTypeReload
&& newLoadType != FrameLoadTypeSame
- && !shouldReload(URL, [bridge() URL])
+ && !shouldReload(URL, m_frame->url().getNSURL())
// We don't want to just scroll if a link from within a
// frameset is trying to reload the frameset into _top.
&& ![bridge() isFrameSet]) {
DocumentLoader* FrameLoader::activeDocumentLoader() const
{
- if (m_state == WebFrameStateProvisional)
+ if (m_state == FrameStateProvisional)
return m_provisionalDocumentLoader.get();
return m_documentLoader.get();
}
m_provisionalDocumentLoader = loader;
}
-WebFrameState FrameLoader::state() const
+FrameState FrameLoader::state() const
{
return m_state;
}
m_client->provisionalLoadStarted();
}
-void FrameLoader::setState(WebFrameState newState)
+void FrameLoader::setState(FrameState newState)
{
m_state = newState;
- if (newState == WebFrameStateProvisional)
+ if (newState == FrameStateProvisional)
provisionalLoadStarted();
- else if (newState == WebFrameStateComplete) {
+ else if (newState == FrameStateComplete) {
frameLoadCompleted();
storedTimeOfLastCompletedLoad = CFAbsoluteTimeGetCurrent();
if (m_documentLoader)
{
setProvisionalDocumentLoader(0);
m_client->progressCompleted();
- setState(WebFrameStateComplete);
+ setState(FrameStateComplete);
}
void FrameLoader::markLoadComplete()
{
- setState(WebFrameStateComplete);
+ setState(FrameStateComplete);
}
void FrameLoader::commitProvisionalLoad()
setDocumentLoader(m_provisionalDocumentLoader.get());
setProvisionalDocumentLoader(0);
- setState(WebFrameStateCommittedPage);
+ setState(FrameStateCommittedPage);
}
id FrameLoader::identifierForInitialRequest(NSURLRequest *clientRequest)
// Can't call _bridge because we might not have commited yet
m_frame->stop();
if (m_client->shouldFallBack(error))
- [bridge() handleFallbackContent];
+ m_frame->handleFallbackContent();
}
- if (m_state == WebFrameStateProvisional) {
+ if (m_state == FrameStateProvisional) {
NSURL *failedURL = [m_provisionalDocumentLoader->originalRequestCopy() URL];
m_frame->didNotOpenURL(failedURL);
m_client->invalidateCurrentItemPageCache();
void FrameLoader::handleFallbackContent()
{
- [bridge() handleFallbackContent];
+ m_frame->handleFallbackContent();
}
bool FrameLoader::isStopping() const
bool FrameLoader::isLoadingMainFrame() const
{
- return [bridge() isMainFrame];
+ Page* page = m_frame->page();
+ return page && m_frame == page->mainFrame();
}
bool FrameLoader::canShowMIMEType(NSString *MIMEType) const
[decider release];
}
-void FrameLoader::continueAfterNewWindowPolicy(WebPolicyAction policy)
+void FrameLoader::continueAfterNewWindowPolicy(PolicyAction policy)
{
RetainPtr<NSURLRequest> request = m_policyRequest;
RetainPtr<NSString> frameName = m_policyFrameName;
invalidatePendingPolicyDecision(false);
switch (policy) {
- case WebPolicyIgnore:
+ case PolicyIgnore:
request = nil;
break;
- case WebPolicyDownload:
+ case PolicyDownload:
m_client->startDownload(request.get());
request = nil;
break;
- case WebPolicyUse:
+ case PolicyUse:
break;
}
[decider release];
}
-void FrameLoader::continueAfterNavigationPolicy(WebPolicyAction policy)
+void FrameLoader::continueAfterNavigationPolicy(PolicyAction policy)
{
RetainPtr<NSURLRequest> request = m_policyRequest;
RetainPtr<id> target = m_policyTarget;
invalidatePendingPolicyDecision(false);
switch (policy) {
- case WebPolicyIgnore:
+ case PolicyIgnore:
request = nil;
break;
- case WebPolicyDownload:
+ case PolicyDownload:
m_client->startDownload(request.get());
request = nil;
break;
- case WebPolicyUse:
+ case PolicyUse:
if (!m_client->canHandleRequest(request.get())) {
handleUnimplementablePolicy(m_client->cannotShowURLError(request.get()));
request = nil;
objc_msgSend(target.get(), selector, request.get(), formState.get());
}
-void FrameLoader::continueAfterWillSubmitForm(WebPolicyAction policy)
+void FrameLoader::continueAfterWillSubmitForm(PolicyAction policy)
{
if (m_policyDecider) {
[m_policyDecider.get() invalidate];
// is the user responding Cancel to the form repost nag sheet.
// 2) User responded Cancel to an alert popped up by the before unload event handler.
// The "before unload" event handler runs only for the main frame.
- bool canContinue = request && (!isLoadingMainFrame() || [bridge() shouldClose]);
+ bool canContinue = request && (!isLoadingMainFrame() || Mac(m_frame)->shouldClose());
if (!canContinue) {
// If we were waiting for a quick redirect, but the policy delegate decided to ignore it, then we
stopLoading();
setProvisionalDocumentLoader(m_policyDocumentLoader.get());
m_loadType = type;
- setState(WebFrameStateProvisional);
+ setState(FrameStateProvisional);
setPolicyDocumentLoader(0);
return;
if (formState) {
- // It's a bit of a hack to reuse the WebPolicyDecisionListener for the continuation
+ // It's a bit of a hack to reuse the WebPolicyDecider for the continuation
// mechanism across the willSubmitForm callout.
WebPolicyDecider *decider = m_client->createPolicyDecider(asDelegate(), @selector(continueAfterWillSubmitForm:));
m_policyDecider = decider;
m_client->dispatchWillSubmitForm(decider, formState->sourceFrame(), formState->form(), formState->valuesAsNSDictionary());
[decider release];
} else
- continueAfterWillSubmitForm(WebPolicyUse);
+ continueAfterWillSubmitForm(PolicyUse);
}
void FrameLoader::didFirstLayout()
void FrameLoader::transitionToCommitted(NSDictionary *pageCache)
{
ASSERT(m_client->hasWebView());
- ASSERT(m_state == WebFrameStateProvisional);
+ ASSERT(m_state == FrameStateProvisional);
- if (m_state != WebFrameStateProvisional)
+ if (m_state != FrameStateProvisional)
return;
m_client->setCopiesOnScroll();
ASSERT(m_client->hasWebView());
switch (m_state) {
- case WebFrameStateProvisional: {
+ case FrameStateProvisional: {
if (m_delegateIsHandlingProvisionalLoadError)
return;
return;
}
- case WebFrameStateCommittedPage: {
+ case FrameStateCommittedPage: {
DocumentLoader* dl = m_documentLoader.get();
if (dl->isLoadingInAPISense())
return;
return;
}
- case WebFrameStateComplete:
+ case FrameStateComplete:
// Even if already complete, we might have set a previous item on a frame that
// didn't do any data loading on the past transaction. Make sure to clear these out.
m_client->frameLoadCompleted();
return;
RefPtr<Frame> frame = m_frame;
-
RefPtr<Frame> mainFrame = m_client->dispatchCreatePage(nil);
if (!mainFrame)
return;
- [Mac(mainFrame.get())->bridge() setName:frameName];
+ mainFrame->tree()->setName(frameName);
mainFrame->loader()->client()->dispatchShow();
mainFrame->setOpener(frame.get());
mainFrame->loader()->load(request, nil, FrameLoadTypeStandard, formState);
}
void FrameLoader::post(NSURL *URL, NSString *referrer, NSString *target, NSArray *postData,
- NSString *contentType, NSEvent *event, DOMElement *form, NSDictionary *formValues)
+ NSString *contentType, NSEvent *event, Element* form, NSDictionary *formValues)
{
// When posting, use the NSURLRequestReloadIgnoringCacheData load flag.
// This prevents a potential bug which may cause a page with a form that uses itself
m_loader->continueFragmentScrollAfterNavigationPolicy(request);
}
-- (void)continueAfterNewWindowPolicy:(WebPolicyAction)policy
+- (void)continueAfterNewWindowPolicy:(PolicyAction)policy
{
if (m_loader)
m_loader->continueAfterNewWindowPolicy(policy);
}
-- (void)continueAfterNavigationPolicy:(WebPolicyAction)policy
+- (void)continueAfterNavigationPolicy:(PolicyAction)policy
{
if (m_loader)
m_loader->continueAfterNavigationPolicy(policy);
}
-- (void)continueAfterWillSubmitForm:(WebPolicyAction)policy
+- (void)continueAfterWillSubmitForm:(PolicyAction)policy
{
if (m_loader)
m_loader->continueAfterWillSubmitForm(policy);
#include "CachedImage.h"
#include "Document.h"
+#include "FrameLoader.h"
#include "FrameMac.h"
#include "WebCoreFrameBridge.h"
+#include "WebDocumentLoader.h"
namespace WebCore {
image->setAllData(nsData);
[nsData release];
- WebCoreFrameBridge* bridge = Mac(document->frame())->bridge();
- NSURLResponse* response = [bridge mainResourceURLResponse];
+ Frame* frame = document->frame();
+ NSURLResponse *response = frame->loader()->documentLoader()->response();
image->setResponse(response);
IntSize size = image->imageSize();
if (size.width())
- document->setTitle([bridge imageTitleForFilename:[response suggestedFilename] size:size]);
+ document->setTitle([Mac(frame)->bridge() imageTitleForFilename:[response suggestedFilename] size:size]);
}
}
{
// Once a frame has loaded, we no longer need to consider subresources,
// but we still need to consider subframes.
- if (frameLoader()->state() != WebFrameStateComplete) {
+ if (frameLoader()->state() != FrameStateComplete) {
if (!m_primaryLoadComplete && isLoading())
return true;
if (frameLoader()->isLoadingSubresources())
#include "StringHash.h"
#include <wtf/HashMap.h>
-@class DOMElement;
@class NSDictionary;
@class WebCoreFrameBridge;
const HashMap<String, String>& values() const { return m_values; }
Frame* sourceFrame() const { return m_sourceFrame.get(); }
- static PassRefPtr<FormState> create(DOMElement *form, NSDictionary *values, WebCoreFrameBridge *sourceFrame);
+ static PassRefPtr<FormState> create(PassRefPtr<Element> form, NSDictionary *values, WebCoreFrameBridge *sourceFrame);
NSDictionary *valuesAsNSDictionary() const;
private:
FormState(PassRefPtr<Element> form, const HashMap<String, String>& values, PassRefPtr<Frame> sourceFrame);
- FormState(DOMElement *form, NSDictionary *values, WebCoreFrameBridge *sourceFrame);
+ FormState(PassRefPtr<Element> form, NSDictionary *values, WebCoreFrameBridge *sourceFrame);
RefPtr<Element> m_form;
HashMap<String, String> m_values;
return new FormState(form, values, sourceFrame);
}
-PassRefPtr<FormState> FormState::create(DOMElement *form, NSDictionary *values, WebCoreFrameBridge *sourceFrame)
+PassRefPtr<FormState> FormState::create(PassRefPtr<Element> form, NSDictionary *values, WebCoreFrameBridge *sourceFrame)
{
return new FormState(form, values, sourceFrame);
}
{
}
-FormState::FormState(DOMElement *form, NSDictionary *values, WebCoreFrameBridge *sourceFrame)
- : m_form([form _element])
+FormState::FormState(PassRefPtr<Element> form, NSDictionary *values, WebCoreFrameBridge *sourceFrame)
+ : m_form(form)
, m_sourceFrame([sourceFrame _frame])
{
NSEnumerator *keyEnumerator = [values keyEnumerator];
virtual void didFail(NSError *);
void continueAfterNavigationPolicy(NSURLRequest *);
- void continueAfterContentPolicy(WebPolicyAction);
+ void continueAfterContentPolicy(PolicyAction);
private:
virtual void didCancel(NSError *);
void stopLoadingForPolicyChange();
bool isPostOrRedirectAfterPost(NSURLRequest *newRequest, NSURLResponse *redirectResponse);
- void continueAfterContentPolicy(WebPolicyAction, NSURLResponse *);
+ void continueAfterContentPolicy(PolicyAction, NSURLResponse *);
int m_contentLength; // for logging only
int m_bytesReceived; // for logging only
return (bytesFilled == 0) || (bytesFilled > 5 && strncmp((char *)buffer.data(), "about:", 6) == 0);
}
-void MainResourceLoader::continueAfterContentPolicy(WebPolicyAction contentPolicy, NSURLResponse *r)
+void MainResourceLoader::continueAfterContentPolicy(PolicyAction contentPolicy, NSURLResponse *r)
{
NSURL *URL = [request() URL];
NSString *MIMEType = [r MIMEType];
switch (contentPolicy) {
- case WebPolicyUse: {
+ case PolicyUse: {
// Prevent remote web archives from loading because they can claim to be from any domain and thus avoid cross-domain security checks (4120255).
bool isRemote = ![URL isFileURL] && ![WebDataProtocol _webIsDataProtocolURL:URL];
bool isRemoteWebArchive = isRemote && isCaseInsensitiveEqual(@"application/x-webarchive", MIMEType);
break;
}
- case WebPolicyDownload:
+ case PolicyDownload:
[m_proxy.get() setDelegate:nil];
frameLoader()->download(connection(), request(), r, m_proxy.get());
m_proxy = nil;
receivedError(interruptionForPolicyChangeError());
return;
- case WebPolicyIgnore:
+ case PolicyIgnore:
stopLoadingForPolicyChange();
return;
didFinishLoading();
}
-void MainResourceLoader::continueAfterContentPolicy(WebPolicyAction policy)
+void MainResourceLoader::continueAfterContentPolicy(PolicyAction policy)
{
bool isStopping = frameLoader()->isStopping();
frameLoader()->cancelContentPolicyCheck();
m_loader->continueAfterNavigationPolicy(request);
}
-- (void)continueAfterContentPolicy:(WebPolicyAction)policy
+- (void)continueAfterContentPolicy:(PolicyAction)policy
{
if (!m_loader)
return;
NSMutableURLRequest *newRequest, NSDictionary *customHeaders, NSString *referrer)
{
FrameLoader* fl = frame->loader();
- if (fl->state() == WebFrameStateProvisional)
+ if (fl->state() == FrameStateProvisional)
return nil;
wkSupportsMultipartXMixedReplace(newRequest);
- (void)keyDown:(NSEvent *)event
{
- if (!_box) {
+ if (!_box)
return;
- }
- WebCoreFrameBridge *bridge = FrameMac::bridgeForWidget(_box);
- if (![bridge interceptKeyEvent:event toView:self]) {
- [super keyDown:event];
- }
+ if (!Mac(Frame::frameForWidget(_box))->keyEvent(event))
+ [super keyDown:event];
}
- (void)keyUp:(NSEvent *)event
{
- if (!_box) {
+ if (!_box)
return;
- }
- WebCoreFrameBridge *bridge = FrameMac::bridgeForWidget(_box);
- if (![bridge interceptKeyEvent:event toView:self]) {
+ if (!Mac(Frame::frameForWidget(_box))->keyEvent(event)) {
[super keyUp:event];
NSString *string = [event characters];
[self selectRowIndexes:[NSIndexSet indexSetWithIndex:closestItem] byExtendingSelection:NO];
[self scrollRowToVisible:closestItem];
-
}
}
if (DOMHTMLInputElement* input = inputElement(widget))
intercepted = [bridge textField:input shouldHandleEvent:event];
if (!intercepted)
- intercepted = [bridge interceptKeyEvent:event toView:view];
+ intercepted = [bridge _frame]->keyEvent(event);
// Always intercept key up events because we don't want them
// passed along the responder chain. This is arguably a bug in
+2006-10-25 Darin Adler <darin@apple.com>
+
+ Reviewed by Anders.
+
+ - removed 55 methods from WebCoreFrameBridge
+ - changed callers to use Frame directly instead
+ - put FrameLoaderTypes.h types into the WebCore namespace
+ - first steps to get FrameLoader.h ready for cross-platform duty
+
+ * DefaultDelegates/WebDefaultContextMenuDelegate.m:
+ (-[WebDefaultUIDelegate openNewWindowWithURL:element:]):
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView requestWithURLCString:]):
+ (-[WebBaseNetscapePluginView loadPluginRequest:]):
+ (-[WebBaseNetscapePluginView getVariable:value:]):
+ * Plugins/WebNetscapePluginEmbeddedView.m:
+ (-[WebNetscapePluginEmbeddedView didStart]):
+ * Plugins/WebNetscapePluginStream.mm:
+ * Plugins/WebPluginContainerCheck.m:
+ (-[WebPluginContainerCheck _continueWithPolicy:]):
+ (-[WebPluginContainerCheck _isForbiddenFileLoad]):
+ * WebCoreSupport/WebEditorClient.mm:
+ (WebEditorClient::shouldDeleteRange):
+ (WebEditorClient::shouldShowDeleteInterface):
+ * WebCoreSupport/WebFrameBridge.mm:
+ (-[WebFrameBridge webView]):
+ (-[WebFrameBridge finishInitializingWithFrameName:view:]):
+ (-[WebFrameBridge createWindowWithURL:]):
+ (-[WebFrameBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:DOMElement:loadManually:]):
+ (-[WebFrameBridge windowObjectCleared]):
+ (-[WebFrameBridge createModalDialogWithURL:]):
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::dispatchCreatePage):
+ (WebFrameLoaderClient::dispatchWillSubmitForm):
+ * WebKit.xcodeproj/project.pbxproj:
+ * WebView/WebArchiver.m:
+ (+[WebArchiver archiveSelectionInFrame:]):
+ * WebView/WebDataSource.mm:
+ (-[WebDataSource _documentFragmentWithImageResource:]):
+ (-[WebDataSource _imageElementWithImageResource:]):
+ * WebView/WebEditingDelegatePrivate.h:
+ * WebView/WebFrame.mm:
+ (core):
+ (kit):
+ (-[WebFrame _createItemTreeWithTargetFrame:clippedAtTarget:]):
+ (-[WebFrame _canCachePage]):
+ (-[WebFrame _childFramesMatchItem:]):
+ (-[WebFrame _URLsMatchItem:]):
+ (-[WebFrame _loadItem:withLoadType:]):
+ (-[WebFrame _recursiveGoToItem:fromItem:withLoadType:]):
+ (-[WebFrame _viewWillMoveToHostWindow:]):
+ (-[WebFrame _viewDidMoveToHostWindow]):
+ (-[WebFrame _addChild:]):
+ (-[WebFrame _saveDocumentAndScrollState]):
+ (-[WebFrame _numPendingOrLoadingRequests:]):
+ (-[WebFrame _reloadForPluginChanges]):
+ (-[WebFrame _recursive_pauseNullEventsForAllNetscapePlugins]):
+ (-[WebFrame _recursive_resumeNullEventsForAllNetscapePlugins]):
+ (-[WebFrame _initWithWebFrameView:webView:coreFrame:]):
+ (-[WebFrame _documentViews]):
+ (-[WebFrame _updateBackground]):
+ (-[WebFrame _unmarkAllMisspellings]):
+ (-[WebFrame _hasSelection]):
+ (-[WebFrame _atMostOneFrameHasSelection]):
+ (-[WebFrame _findFrameWithSelection]):
+ (-[WebFrame _frameLoader]):
+ (-[WebFrame _isDescendantOfFrame:]):
+ (-[WebFrame _setShouldCreateRenderers:]):
+ (-[WebFrame _bodyBackgroundColor]):
+ (-[WebFrame init]):
+ (-[WebFrame initWithName:webFrameView:webView:]):
+ (-[WebFrame dealloc]):
+ (-[WebFrame finalize]):
+ (-[WebFrame name]):
+ (-[WebFrame webView]):
+ (-[WebFrame DOMDocument]):
+ (-[WebFrame frameElement]):
+ (-[WebFrame findFrameNamed:]):
+ (-[WebFrame parentFrame]):
+ (-[WebFrame childFrames]):
+ (-[WebFrame _invalidateCurrentItemPageCache]):
+ (-[WebFrame _dispatchCreateWebViewWithRequest:]):
+ (-[WebFrame _dispatchSourceFrame:willSubmitForm:withValues:submissionDecider:]):
+ (-[WebFrame _prepareForDataSourceReplacement]):
+ (-[WebFrame _provisionalLoadStarted]):
+ * WebView/WebFrameInternal.h:
+ * WebView/WebHTMLRepresentation.m:
+ (-[WebHTMLRepresentation DOMDocument]):
+ (-[WebHTMLRepresentation attributedText]):
+ * WebView/WebHTMLView.m:
+ (-[WebHTMLView _documentRange]):
+ (-[WebHTMLView _documentFragmentWithPaths:]):
+ (-[WebHTMLView _documentFragmentFromPasteboard:inContext:allowPlainText:chosePlainText:]):
+ (-[WebHTMLView _selectedRange]):
+ (-[WebHTMLView _updateMouseoverWithEvent:]):
+ (-[WebHTMLView _canEditRichly]):
+ (-[WebHTMLView _hasSelection]):
+ (-[WebHTMLView _hasSelectionOrInsertionPoint]):
+ (-[WebHTMLView _hasInsertionPoint]):
+ (-[WebHTMLView _isEditable]):
+ (-[WebHTMLView _isSelectionInPasswordField]):
+ (-[WebHTMLView _lookUpInDictionaryFromMenu:]):
+ (-[WebHTMLView _selectionDraggingImage]):
+ (-[WebHTMLView _canIncreaseSelectionListLevel]):
+ (-[WebHTMLView _canDecreaseSelectionListLevel]):
+ (-[WebHTMLView _updateActiveState]):
+ (-[NSArray readSelectionFromPasteboard:]):
+ (-[NSArray validateUserInterfaceItem:]):
+ (-[NSArray maintainsInactiveSelection]):
+ (-[NSArray menuForEvent:]):
+ (-[NSArray scrollWheel:]):
+ (-[NSArray acceptsFirstMouse:]):
+ (-[NSArray shouldDelayWindowOrderingForEvent:]):
+ (-[NSArray mouseDown:]):
+ (-[NSArray mouseDragged:]):
+ (-[NSArray mouseUp:]):
+ (-[NSArray keyDown:]):
+ (-[NSArray keyUp:]):
+ (-[NSArray centerSelectionInVisibleArea:]):
+ (-[NSArray _selectionStartFontAttributesAsRTF]):
+ (-[NSArray _emptyStyle]):
+ (-[NSArray performKeyEquivalent:]):
+ (-[NSArray indent:]):
+ (-[NSArray outdent:]):
+ (-[WebHTMLView cut:]):
+ (-[WebHTMLView paste:]):
+ (-[WebHTMLView _selectRangeInMarkedText:]):
+ (-[WebTextCompleteController doCompletion]):
+ (-[WebHTMLView selectionRect]):
+ (-[WebHTMLView selectionImageForcingWhiteText:]):
+ (-[WebHTMLView selectionImageRect]):
+ (-[WebHTMLView attributedString]):
+ (-[WebHTMLView _isMoveDrag]):
+ (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]):
+ * WebView/WebPolicyDelegate.mm:
+ (-[WebPolicyDecisionListener _usePolicy:]):
+ (-[WebPolicyDecisionListener use]):
+ (-[WebPolicyDecisionListener ignore]):
+ (-[WebPolicyDecisionListener download]):
+ (-[WebPolicyDecisionListener continue]):
+ * WebView/WebScriptDebugDelegate.m:
+ (-[WebScriptCallFrame _initWithFrame:initWithWebFrame:]):
+ (-[WebScriptCallFrame globalObject]):
+ * WebView/WebView.mm:
+ (-[WebView _attachScriptDebuggerToAllFrames]):
+ (-[WebView _detachScriptDebuggerFromAllFrames]):
+ (-[WebView windowScriptObject]):
+ (incrementFrame):
+ (-[WebView searchFor:direction:caseSensitive:wrap:]):
+ (-[WebView writeSelectionWithPasteboardTypes:toPasteboard:]):
+ (-[WebView removeDragCaret]):
+ (-[WebView setScriptDebugDelegate:]):
+ (-[WebView scriptDebugDelegate]):
+ (-[WebView shouldClose]):
+ (-[WebView selectedDOMRange]):
+ (-[WebView styleDeclarationWithText:]):
+
2006-10-25 Geoffrey Garen <ggaren@apple.com>
Reviewed by Adam.
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <WebKit/WebDefaultContextMenuDelegate.h>
+#import "WebDefaultContextMenuDelegate.h"
+#import "WebDOMOperations.h"
+#import "WebDataSourcePrivate.h"
+#import "WebDefaultUIDelegate.h"
+#import "WebFrameBridge.h"
+#import "WebFrameInternal.h"
+#import "WebFrameView.h"
+#import "WebHTMLViewPrivate.h"
+#import "WebLocalizableStrings.h"
+#import "WebNSPasteboardExtras.h"
+#import "WebNSURLRequestExtras.h"
+#import "WebPolicyDelegate.h"
+#import "WebUIDelegate.h"
+#import "WebUIDelegatePrivate.h"
+#import "WebViewInternal.h"
+#import <Foundation/NSURLConnection.h>
+#import <Foundation/NSURLRequest.h>
#import <JavaScriptCore/Assertions.h>
+#import <WebCore/FrameMac.h>
+#import <WebCore/WebCoreFrameBridge.h>
#import <WebKit/DOM.h>
#import <WebKit/DOMPrivate.h>
-#import <WebKit/WebFrameBridge.h>
-#import <WebKit/WebDataSourcePrivate.h>
-#import <WebKit/WebDefaultUIDelegate.h>
-#import <WebKit/WebDOMOperations.h>
-#import <WebKit/WebFrameInternal.h>
-#import <WebKit/WebHTMLViewPrivate.h>
-#import <WebKit/WebLocalizableStrings.h>
-#import <WebKit/WebNSPasteboardExtras.h>
-#import <WebKit/WebNSURLRequestExtras.h>
-#import <WebKit/WebFrameView.h>
-#import <WebKit/WebPolicyDelegate.h>
-#import <WebKit/WebViewInternal.h>
-#import <WebKit/WebUIDelegate.h>
-#import <WebKit/WebUIDelegatePrivate.h>
-
-#import <WebCore/WebCoreFrameBridge.h>
-
-#import <Foundation/NSURLConnection.h>
-#import <Foundation/NSURLRequest.h>
@implementation WebDefaultUIDelegate (WebContextMenu)
WebView *webView = [webFrame webView];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL];
- NSString *referrer = [[webFrame _bridge] referrer];
- if (referrer) {
+ NSString *referrer = core(webFrame)->referrer();
+ if (referrer)
[request _web_setHTTPReferrer:referrer];
- }
[webView _openNewWindowWithRequest:request];
}
#import <JavaScriptCore/Assertions.h>
#import <JavaScriptCore/npruntime_impl.h>
#import <WebCore/FrameLoader.h>
+#import <WebCore/FrameMac.h>
+#import <WebCore/FrameTree.h>
#import <WebKit/DOMPrivate.h>
#import <WebKit/WebUIDelegate.h>
#import <WebKitSystemInterface.h>
return nil;
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL];
- [request _web_setHTTPReferrer:[[[self webFrame] _bridge] referrer]];
+ [request _web_setHTTPReferrer:core([self webFrame])->referrer()];
return request;
}
newWebView = [[WebDefaultUIDelegate sharedUIDelegate] webView:currentWebView createWebViewWithRequest:nil];
}
frame = [newWebView mainFrame];
- [[frame _bridge] setName:frameName];
+ core(frame)->tree()->setName(frameName);
[[newWebView _UIDelegateForwarder] webViewShow:newWebView];
}
}
switch (variable) {
case NPNVWindowNPObject:
{
- NPObject *windowScriptObject = [[[self webFrame] _bridge] windowScriptNPObject];
+ NPObject *windowScriptObject = core([self webFrame])->windowScriptNPObject();
// Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugins/npruntime.html#browseraccess>
if (windowScriptObject)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <WebKit/WebNetscapePluginEmbeddedView.h>
-
+#import "WebNetscapePluginEmbeddedView.h"
+
+#import "WebBaseNetscapePluginViewPrivate.h"
+#import "WebDataSource.h"
+#import "WebFrame.h"
+#import "WebFrameBridge.h"
+#import "WebFrameInternal.h"
+#import "WebFrameView.h"
+#import "WebNSURLExtras.h"
+#import "WebNSURLRequestExtras.h"
+#import "WebNSViewExtras.h"
+#import "WebNetscapePluginPackage.h"
+#import "WebNetscapePluginStream.h"
+#import "WebView.h"
#import <JavaScriptCore/Assertions.h>
-
-#import <WebKit/WebBaseNetscapePluginViewPrivate.h>
-#import <WebKit/WebFrameBridge.h>
-#import <WebKit/WebDataSource.h>
-#import <WebKit/WebFrame.h>
-#import <WebKit/WebFrameInternal.h>
-#import <WebKit/WebFrameView.h>
-#import <WebKit/WebNetscapePluginPackage.h>
-#import <WebKit/WebNetscapePluginStream.h>
-#import <WebKit/WebNSViewExtras.h>
-#import <WebKit/WebNSURLExtras.h>
-#import <WebKit/WebNSURLRequestExtras.h>
-#import <WebKit/WebView.h>
+#import <WebCore/FrameMac.h>
@implementation WebNetscapePluginEmbeddedView
// Check for this and don't start a load in this case.
if (URL != nil && ![URL _web_isEmpty]) {
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL];
- [request _web_setHTTPReferrer:[[[self webFrame] _bridge] referrer]];
+ [request _web_setHTTPReferrer:core([self webFrame])->referrer()];
[self loadRequest:request inTarget:nil withNotifyData:nil sendNotification:NO];
}
}
WebFrameBridge *bridge = [[view webFrame] _bridge];
BOOL hideReferrer;
- if (![bridge canLoadURL:[theRequest URL] fromReferrer:[bridge referrer] hideReferrer:&hideReferrer])
+ if (![bridge canLoadURL:[theRequest URL] fromReferrer:core([view webFrame])->referrer() hideReferrer:&hideReferrer])
return nil;
if ([self initWithRequestURL:[theRequest URL]
if (hideReferrer)
[(NSMutableURLRequest *)request _web_setHTTPReferrer:nil];
- _loader = NetscapePlugInStreamLoader::create([bridge _frame], self).release();
+ _loader = NetscapePlugInStreamLoader::create(core([view webFrame]), self).release();
isTerminated = NO;
#import <WebCore/FrameLoaderTypes.h>
#import <objc/objc-runtime.h>
+using namespace WebCore;
+
@implementation WebPluginContainerCheck
+ (id)checkWithRequest:(NSURLRequest *)request target:(NSString *)target resultObject:(id)obj selector:(SEL)selector controller:(WebPluginController *)controller
[super dealloc];
}
-- (void)_continueWithPolicy:(WebPolicyAction)policy
+- (void)_continueWithPolicy:(PolicyAction)policy
{
- ((void (*)(id, SEL, BOOL))objc_msgSend)(_resultObject, _resultSelector, (policy == WebPolicyUse));
+ ((void (*)(id, SEL, BOOL))objc_msgSend)(_resultObject, _resultSelector, (policy == PolicyUse));
// this will call indirectly call cancel
[_controller _webPluginContainerCancelCheckIfAllowedToLoadRequest:self];
WebFrameBridge *bridge = [_controller bridge];
ASSERT(bridge);
if (![bridge canLoadURL:[_request URL] fromReferrer:[_controller URLPolicyCheckReferrer] hideReferrer:&ignore]) {
- [self _continueWithPolicy:WebPolicyIgnore];
+ [self _continueWithPolicy:PolicyIgnore];
return YES;
}
#import "WebEditorClient.h"
-#import <WebKit/DOMHTMLElement.h>
-#import <WebKit/DOMRange.h>
-#import "WebView.h"
+#import "WebFrameInternal.h"
#import "WebViewInternal.h"
-#import "WebEditingDelegate.h"
#import "WebEditingDelegatePrivate.h"
-// FIXME: we should have a way to get the following DOM interfaces from the WebCore internal headers,
-// we can't make the internal DOM headers private since they are not generated at the time installhdrs is called
-
-@interface DOMHTMLElement (WebCoreInternal)
-+ (DOMHTMLElement *)_HTMLElementWith:(WebCore::HTMLElement*)impl;
-@end
-
-@interface DOMRange (WebCoreInternal)
-+ (DOMRange *)_rangeWith:(WebCore::Range*)impl;
-@end
-
WebEditorClient::WebEditorClient()
: m_webView(nil)
{
bool WebEditorClient::shouldDeleteRange(WebCore::Range* range)
{
- return [[m_webView _editingDelegateForwarder] webView:m_webView shouldDeleteDOMRange:[DOMRange _rangeWith:range]];
+ return [[m_webView _editingDelegateForwarder] webView:m_webView
+ shouldDeleteDOMRange:kit(range)];
}
bool WebEditorClient::shouldShowDeleteInterface(WebCore::HTMLElement* element)
{
- return [[m_webView _editingDelegateForwarder] webView:m_webView shouldShowDeleteInterfaceForElement:[DOMHTMLElement _HTMLElementWith:element]];
+ return [[m_webView _editingDelegateForwarder] webView:m_webView
+ shouldShowDeleteInterfaceForElement:kit(element)];
}
/*
#import <JavaScriptCore/Assertions.h>
#import <JavaVM/jni.h>
#import <WebCore/FrameLoader.h>
+#import <WebCore/FrameMac.h>
+#import <WebCore/FrameTree.h>
+#import <WebCore/Page.h>
#import <WebCore/WebCoreFrameNamespaces.h>
+#import <WebCore/WebCoreSettings.h>
#import <WebCore/WebDocumentLoader.h>
#import <WebCore/WebFormDataStream.h>
#import <WebCore/WebFrameLoaderClient.h>
- (WebView *)webView
{
- ASSERT([[self page] isKindOfClass:[WebPageBridge class]]);
- return [(WebPageBridge *)[self page] webView];
+ ASSERT([[self _frame]->page()->bridge() isKindOfClass:[WebPageBridge class]]);
+ return [(WebPageBridge *)[self _frame]->page()->bridge() webView];
}
- (void)finishInitializingWithFrameName:(NSString *)name view:(WebFrameView *)view
{
WebView *webView = [self webView];
- _frame = [[WebFrame alloc] _initWithWebFrameView:view webView:webView bridge:self];
+ _frame = [[WebFrame alloc] _initWithWebFrameView:view webView:webView coreFrame:m_frame];
++WebBridgeCount;
- [self setName:name];
- [self initializeSettings:[webView _settings]];
+ [self _frame]->tree()->setName(name);
+ [self _frame]->setSettings([[webView _settings] settings]);
[self setTextSizeMultiplier:[webView textSizeMultiplier]];
}
NSMutableURLRequest *request = nil;
if (URL != nil && ![URL _web_isEmpty]) {
request = [NSMutableURLRequest requestWithURL:URL];
- [request _web_setHTTPReferrer:[self referrer]];
+ [request _web_setHTTPReferrer:m_frame->referrer()];
}
WebView *currentWebView = [self webView];
loadManually:(BOOL)loadManually
{
BOOL hideReferrer;
- if (![self canLoadURL:URL fromReferrer:[self referrer] hideReferrer:&hideReferrer])
+ if (![self canLoadURL:URL fromReferrer:m_frame->referrer() hideReferrer:&hideReferrer])
return nil;
ASSERT([attributeNames count] == [attributeValues count]);
- (void)windowObjectCleared
{
WebView *wv = [self webView];
- [[wv _frameLoadDelegateForwarder] webView:wv windowScriptObjectAvailable:[self windowScriptObject]];
+ [[wv _frameLoadDelegateForwarder] webView:wv windowScriptObjectAvailable:m_frame->windowScriptObject()];
if ([wv scriptDebugDelegate] || [WebScriptDebugServer listenerCount]) {
[_frame _detachScriptDebugger]; // FIXME: remove this once <rdar://problem/4608404> is fixed
[_frame _attachScriptDebugger];
if (URL != nil && ![URL _web_isEmpty]) {
request = [NSMutableURLRequest requestWithURL:URL];
- [request _web_setHTTPReferrer:[self referrer]];
+ [request _web_setHTTPReferrer:m_frame->referrer()];
}
WebView *currentWebView = [self webView];
using namespace WebCore;
-// FIXME: We should have a way to get the following DOM interface from the WebCore internal headers, but we
-// can't make the internal DOM headers private since they are not generated at the time installhdrs is called.
-
-@interface DOMElement (WebCoreInternal)
-+ (DOMElement *)_elementWith:(WebCore::Element*)impl;
-@end
-
WebFrameLoaderClient::WebFrameLoaderClient(WebFrame *webFrame)
: m_webFrame(webFrame)
{
Frame* WebFrameLoaderClient::dispatchCreatePage(NSURLRequest *request)
{
- return [[m_webFrame.get() _dispatchCreateWebViewWithRequest:request] _frame];
+ return [m_webFrame.get() _dispatchCreateWebViewWithRequest:request];
}
void WebFrameLoaderClient::dispatchShow()
void WebFrameLoaderClient::dispatchWillSubmitForm(WebPolicyDecider *decider, Frame* sourceFrame,
Element* form, NSDictionary *values)
{
- [m_webFrame.get() _dispatchSourceFrame:Mac(sourceFrame)->bridge()
- willSubmitForm:[DOMElement _elementWith:form] withValues:values submissionDecider:decider];
+ [m_webFrame.get() _dispatchSourceFrame:sourceFrame
+ willSubmitForm:form withValues:values submissionDecider:decider];
}
void WebFrameLoaderClient::dispatchDidLoadMainResource(DocumentLoader* loader)
51443F9B0429392B00CA2D3A /* WebPolicyDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPolicyDelegate.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
51443F9C0429392B00CA2D3A /* WebPolicyDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPolicyDelegatePrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
5152FADD033FC50400CA2ACD /* WebDefaultContextMenuDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDefaultContextMenuDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- 5152FADE033FC50400CA2ACD /* WebDefaultContextMenuDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebDefaultContextMenuDelegate.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ 5152FADE033FC50400CA2ACD /* WebDefaultContextMenuDelegate.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebDefaultContextMenuDelegate.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
5152FADF033FC50400CA2ACD /* WebDefaultPolicyDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDefaultPolicyDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
5152FAE0033FC50400CA2ACD /* WebDefaultPolicyDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebDefaultPolicyDelegate.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
5152FAE5033FC52200CA2ACD /* WebFrameLoadDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameLoadDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
65488D9F084FBCCB00831AD0 /* WebNSDictionaryExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSDictionaryExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
65488DA0084FBCCB00831AD0 /* WebNSDictionaryExtras.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSDictionaryExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
6550B7C5099EFAE90090D781 /* WebArchiver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebArchiver.h; sourceTree = "<group>"; };
- 6550B7C6099EFAE90090D781 /* WebArchiver.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = WebArchiver.m; sourceTree = "<group>"; };
+ 6550B7C6099EFAE90090D781 /* WebArchiver.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = WebArchiver.m; sourceTree = "<group>"; };
6578F5DE045F817400000128 /* WebDownload.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDownload.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
6578F5DF045F817400000128 /* WebDownload.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebDownload.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
65836F5E07EE425900682F95 /* WebPluginContainerPrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginContainerPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
65E0F9E408500F23007E5CB9 /* WebNSUserDefaultsExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSUserDefaultsExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
65E0F9E508500F23007E5CB9 /* WebNSUserDefaultsExtras.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSUserDefaultsExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
65E1150307EFFEBF009B8BF7 /* WebPluginContainerCheck.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginContainerCheck.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- 65E1150407EFFEBF009B8BF7 /* WebPluginContainerCheck.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebPluginContainerCheck.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ 65E1150407EFFEBF009B8BF7 /* WebPluginContainerCheck.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; indentWidth = 4; path = WebPluginContainerCheck.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
65EEDE51084FFB920002DB25 /* WebNSCalendarDateExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSCalendarDateExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
65EEDE52084FFB920002DB25 /* WebNSCalendarDateExtras.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSCalendarDateExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
65EEDE55084FFC9E0002DB25 /* WebNSFileManagerExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSFileManagerExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
7E6FEEFF08985A3E00C44C3F /* WebDefaultScriptDebugDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDefaultScriptDebugDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
7E6FEF0008985A3E00C44C3F /* WebDefaultScriptDebugDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebDefaultScriptDebugDelegate.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
7E6FEF0508985A7200C44C3F /* WebScriptDebugDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebScriptDebugDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- 7E6FEF0608985A7200C44C3F /* WebScriptDebugDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebScriptDebugDelegate.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ 7E6FEF0608985A7200C44C3F /* WebScriptDebugDelegate.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebScriptDebugDelegate.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
7E6FEF0708985A7200C44C3F /* WebScriptDebugDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebScriptDebugDelegatePrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
830E81E005853AC000AD0891 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; };
833987810543012D00EE146E /* WebDocumentPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDocumentPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
84AE905F062DE6A80075BBF9 /* WebDOMOperationsPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDOMOperationsPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
84CA5F7E042685E800CA2ACA /* WebKitErrorsPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKitErrorsPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
84D4BFF70348EF7600CA2ACA /* WebNetscapePluginEmbeddedView.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapePluginEmbeddedView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- 84D4BFF80348EF7600CA2ACA /* WebNetscapePluginEmbeddedView.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNetscapePluginEmbeddedView.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ 84D4BFF80348EF7600CA2ACA /* WebNetscapePluginEmbeddedView.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebNetscapePluginEmbeddedView.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
9305892A070868B300E79D96 /* WebDashboardRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDashboardRegion.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
930D02BB06275F640076701E /* WebViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebViewInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
930D02BD06275F710076701E /* WebFrameInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
#import "WebArchiver.h"
-#import <WebKit/DOM.h>
#import "WebArchive.h"
-#import <JavaScriptCore/Assertions.h>
-#import "WebDocument.h"
-#import "WebDataSource.h"
#import "WebDOMOperationsPrivate.h"
+#import "WebDataSource.h"
+#import "WebDocument.h"
#import "WebFrame.h"
#import "WebFrameBridge.h"
#import "WebFrameInternal.h"
#import "WebResource.h"
+#import <JavaScriptCore/Assertions.h>
+#import <WebCore/FrameMac.h>
+#import <WebCore/SelectionController.h>
+#import <WebKit/DOM.h>
+
+using namespace WebCore;
@implementation WebArchiver
+ (WebArchive *)archiveSelectionInFrame:(WebFrame *)frame
{
+ Frame* coreFrame = core(frame);
+ if (!coreFrame)
+ return nil;
+
WebFrameBridge *bridge = [frame _bridge];
NSArray *nodes;
- NSString *markupString = [bridge markupStringFromRange:[bridge selectedDOMRange] nodes:&nodes];
+ NSString *markupString = [bridge markupStringFromRange:kit(coreFrame->selectionController()->toRange().get()) nodes:&nodes];
WebArchive *archive = [self _archiveWithMarkupString:markupString fromFrame:frame nodes:nodes];
if ([bridge isFrameSet]) {
DOMElement *imageElement = [self _imageElementWithImageResource:resource];
if (!imageElement)
return 0;
- DOMDocumentFragment *fragment = [[[self _bridge] DOMDocument] createDocumentFragment];
+ DOMDocumentFragment *fragment = [[[self webFrame] DOMDocument] createDocumentFragment];
[fragment appendChild:imageElement];
return fragment;
}
[self addSubresource:resource];
- DOMElement *imageElement = [[[self _bridge] DOMDocument] createElement:@"img"];
+ DOMElement *imageElement = [[[self webFrame] DOMDocument] createElement:@"img"];
// FIXME: calling _web_originalDataAsString on a file URL returns an absolute path. Workaround this.
NSURL *URL = [resource URL];
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <Cocoa/Cocoa.h>
-
-@class WebView;
-@class DOMHTMLElement;
+#import "WebEditingDelegate.h"
@interface NSObject (WebViewEditingDelegatePrivate)
- (BOOL)webView:(WebView *)webView shouldShowDeleteInterfaceForElement:(DOMHTMLElement *)element;
#import "WebScriptDebugServerPrivate.h"
#import "WebUIDelegate.h"
#import "WebViewInternal.h"
-#import <WebCore/Element.h>
#import <WebCore/FrameLoader.h>
#import <WebCore/FrameMac.h>
#import <WebCore/FrameTree.h>
+#import <WebCore/HTMLElement.h>
+#import <WebCore/Page.h>
+#import <WebCore/SelectionController.h>
#import <WebCore/WebDataProtocol.h>
#import <WebCore/WebFormDataStream.h>
#import <WebCore/WebFormState.h>
#import <objc/objc-runtime.h>
#import <wtf/HashMap.h>
+// FIXME: We should have a way to get the following DOM interface from the WebCore internal headers, but we
+// can't make the internal DOM headers private since they are not generated at the time installhdrs is called.
+
+@interface DOMDocument (WebCoreInternal)
+- (WebCore::Document *)_document;
++ (DOMDocument *)_documentWith:(WebCore::Document *)impl;
+@end
+
+@interface DOMElement (WebCoreInternal)
+- (WebCore::Element *)_element;
++ (DOMElement *)_elementWith:(WebCore::Element *)impl;
+@end
+
+@interface DOMHTMLElement (WebCoreInternal)
+- (WebCore::HTMLElement *)_HTMLElement;
++ (DOMHTMLElement *)_HTMLElementWith:(WebCore::HTMLElement *)impl;
+@end
+
+@interface DOMRange (WebCoreInternal)
+- (WebCore::Range *)_range;
++ (DOMRange *)_rangeWith:(WebCore::Range *)impl;
+@end
+
/*
Here is the current behavior matrix for four types of navigations:
Restore form state: YES
Restore scroll and focus state: YES
- WF Cache policy: NSURLRequestUseProtocolCachePolicy
+ Cache policy: NSURLRequestUseProtocolCachePolicy
Add to back/forward list: YES
Back/Forward:
Restore form state: YES
Restore scroll and focus state: YES
- WF Cache policy: NSURLRequestReturnCacheDataElseLoad
+ Cache policy: NSURLRequestReturnCacheDataElseLoad
Add to back/forward list: NO
Reload (meaning only the reload button):
Restore form state: NO
Restore scroll and focus state: YES
- WF Cache policy: NSURLRequestReloadIgnoringCacheData
+ Cache policy: NSURLRequestReloadIgnoringCacheData
Add to back/forward list: NO
Repeat load of the same URL (by any other means of navigation other than the reload button, including hitting return in the location field):
Restore form state: NO
Restore scroll and focus state: NO, reset to initial conditions
- WF Cache policy: NSURLRequestReloadIgnoringCacheData
+ Cache policy: NSURLRequestReloadIgnoringCacheData
Add to back/forward list: NO
*/
return [(WebFrameBridge *)bridge webFrame];
}
-static inline WebFrame *frame(Frame* f)
+FrameMac* core(WebFrame *frame)
{
- return f ? [(WebFrameBridge *)Mac(f)->bridge() webFrame] : nil;
+ return [[frame _bridge] _frame];
}
-@implementation WebFrame (FrameTraversal)
+WebFrame *kit(Frame* frame)
+{
+ return frame ? [(WebFrameBridge *)Mac(frame)->bridge() webFrame] : nil;
+}
-- (WebFrame *)_firstChildFrame
+Element* core(DOMElement *element)
{
- return frame([[self _bridge] firstChild]);
+ return [element _element];
}
-- (WebFrame *)_lastChildFrame
+DOMElement *kit(Element* element)
{
- return frame([[self _bridge] lastChild]);
+ return [DOMElement _elementWith:element];
}
-- (unsigned)_childFrameCount
+Document* core(DOMDocument *document)
{
- return [[self _bridge] childCount];
+ return [document _document];
}
-- (WebFrame *)_previousSiblingFrame;
+DOMDocument *kit(Document* document)
{
- return frame([[self _bridge] previousSibling]);
+ return [DOMDocument _documentWith:document];
}
-- (WebFrame *)_nextSiblingFrame;
+HTMLElement* core(DOMHTMLElement *element)
{
- return frame([[self _bridge] nextSibling]);
+ return [element _HTMLElement];
}
-- (WebFrame *)_traverseNextFrameStayWithin:(WebFrame *)stayWithin
+DOMHTMLElement *kit(HTMLElement *element)
{
- return frame([[self _bridge] traverseNextFrameStayWithin:[stayWithin _bridge]]);
+ return [DOMHTMLElement _HTMLElementWith:element];
}
-@end
+Range* core(DOMRange *range)
+{
+ return [range _range];
+}
+
+DOMRange *kit(Range* range)
+{
+ return [DOMRange _rangeWith:range];
+}
@implementation WebFrame (WebInternal)
// save frame state for items that aren't loading (khtml doesn't save those)
[_private->bridge saveDocumentState];
- for (WebFrame *child = [self _firstChildFrame]; child; child = [child _nextSiblingFrame])
- [bfItem addChildItem:[child _createItemTreeWithTargetFrame:targetFrame clippedAtTarget:doClip]];
+ for (Frame* child = core(self)->tree()->firstChild(); child; child = child->tree()->nextSibling())
+ [bfItem addChildItem:[kit(child) _createItemTreeWithTargetFrame:targetFrame clippedAtTarget:doClip]];
}
if (self == targetFrame)
[bfItem setIsTargetItem:YES];
return bfItem;
}
-- (WebFrame *)_immediateChildFrameNamed:(NSString *)name
-{
- return frame([[self _bridge] childFrameNamed:name]);
-}
-
- (BOOL)_canCachePage
{
- return [[[self webView] backForwardList] _usesPageCache];
+ return [[[self webView] backForwardList] _usesPageCache] && core(self)->canCachePage();
}
- (void)_purgePageCache
{
NSArray *childItems = [item children];
int numChildItems = [childItems count];
- int numChildFrames = [self _childFrameCount];
+ int numChildFrames = core(self)->tree()->childCount();
if (numChildFrames != numChildItems)
return NO;
for (i = 0; i < numChildItems; i++) {
NSString *itemTargetName = [[childItems objectAtIndex:i] target];
//Search recursive here?
- if (![self _immediateChildFrameNamed:itemTargetName])
+ if (!core(self)->tree()->child(itemTargetName))
return NO; // couldn't match the i'th itemTarget
}
int i, count = [childItems count];
for (i = 0; i < count; i++){
childItem = [childItems objectAtIndex:i];
- childFrame = [self _immediateChildFrameNamed:[childItem target]];
- if (![childFrame _URLsMatchItem: childItem])
+ childFrame = kit(core(self)->tree()->child([childItem target]));
+ if (![childFrame _URLsMatchItem:childItem])
return NO;
}
// We always call scrollToAnchor here, even if the URL doesn't have an
// anchor fragment. This is so we'll keep the WebCore Frame's URL up-to-date.
- [_private->bridge _frame]->scrollToAnchor([item URL]);
+ core(self)->scrollToAnchor([item URL]);
// must do this maintenance here, since we don't go through a real page reload
[_private setCurrentItem:item];
NSString *childName = [childItem target];
WebHistoryItem *fromChildItem = [fromItem childItemWithName:childName];
ASSERT(fromChildItem || [fromItem isTargetItem]);
- WebFrame *childFrame = [self _immediateChildFrameNamed:childName];
+ WebFrame *childFrame = kit(core(self)->tree()->child(childName));
ASSERT(childFrame);
[childFrame _recursiveGoToItem:childItem fromItem:fromChildItem withLoadType:type];
}
- (void)_viewWillMoveToHostWindow:(NSWindow *)hostWindow
{
- for (WebFrame *frame = self; frame; frame = [frame _traverseNextFrameStayWithin:self])
- [[[frame frameView] documentView] viewWillMoveToHostWindow:hostWindow];
+ Frame* coreFrame = core(self);
+ for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame))
+ [[[kit(frame) frameView] documentView] viewWillMoveToHostWindow:hostWindow];
}
- (void)_viewDidMoveToHostWindow
{
- for (WebFrame *frame = self; frame; frame = [frame _traverseNextFrameStayWithin:self])
- [[[frame frameView] documentView] viewDidMoveToHostWindow];
+ Frame* coreFrame = core(self);
+ for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame))
+ [[[kit(frame) frameView] documentView] viewDidMoveToHostWindow];
}
- (void)_addChild:(WebFrame *)child
{
- [[self _bridge] appendChild:[child _bridge]];
+ core(self)->tree()->appendChild(adoptRef(core(child)));
if ([child dataSource])
[[child dataSource] _documentLoader]->setOverrideEncoding([[self dataSource] _documentLoader]->overrideEncoding());
}
// history item.
- (void)_saveDocumentAndScrollState
{
- for (WebFrame *frame = self; frame; frame = [frame _traverseNextFrameStayWithin:self]) {
- [[frame _bridge] saveDocumentState];
- [frame _saveScrollPositionAndViewStateToItem:frame->_private->currentItem];
+ Frame* coreFrame = core(self);
+ for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
+ [Mac(frame)->bridge() saveDocumentState];
+ [kit(frame) _saveScrollPositionAndViewStateToItem:kit(frame)->_private->currentItem];
}
}
-// Return next frame to be traversed, visiting children after parent
-- (WebFrame *)_nextFrameWithWrap:(BOOL)wrapFlag
-{
- return frame([[self _bridge] nextFrameWithWrap:wrapFlag]);
-}
-
-// Return previous frame to be traversed, exact reverse order of _nextFrame
-- (WebFrame *)_previousFrameWithWrap:(BOOL)wrapFlag
-{
- return frame([[self _bridge] previousFrameWithWrap:wrapFlag]);
-}
-
- (int)_numPendingOrLoadingRequests:(BOOL)recurse
{
if (!recurse)
- return [[self _bridge] numPendingOrLoadingRequests];
+ return [_private->bridge numPendingOrLoadingRequests];
int num = 0;
- for (WebFrame *frame = self; frame; frame = [frame _traverseNextFrameStayWithin:self])
- num += [[frame _bridge] numPendingOrLoadingRequests];
+ Frame* coreFrame = core(self);
+ for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame))
+ num += [Mac(frame)->bridge() numPendingOrLoadingRequests];
return num;
}
- (void)_reloadForPluginChanges
{
- for (WebFrame *frame = self; frame; frame = [frame _traverseNextFrameStayWithin:self]) {
- NSView <WebDocumentView> *documentView = [[frame frameView] documentView];
- if (([documentView isKindOfClass:[WebHTMLView class]] && [_private->bridge _frame]->containsPlugins()))
- [frame reload];
+ Frame* coreFrame = core(self);
+ for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
+ NSView <WebDocumentView> *documentView = [[kit(frame) frameView] documentView];
+ if (([documentView isKindOfClass:[WebHTMLView class]] && coreFrame->containsPlugins()))
+ [kit(frame) reload];
}
}
- (void)_recursive_pauseNullEventsForAllNetscapePlugins
{
- for (WebFrame *frame = self; frame; frame = [frame _traverseNextFrameStayWithin:self]) {
- NSView <WebDocumentView> *documentView = [[frame frameView] documentView];
+ Frame* coreFrame = core(self);
+ for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
+ NSView <WebDocumentView> *documentView = [[kit(frame) frameView] documentView];
if ([documentView isKindOfClass:[WebHTMLView class]])
[(WebHTMLView *)documentView _pauseNullEventsForAllNetscapePlugins];
}
- (void)_recursive_resumeNullEventsForAllNetscapePlugins
{
- for (WebFrame *frame = self; frame; frame = [frame _traverseNextFrameStayWithin:self]) {
- NSView <WebDocumentView> *documentView = [[frame frameView] documentView];
+ Frame* coreFrame = core(self);
+ for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
+ NSView <WebDocumentView> *documentView = [[kit(frame) frameView] documentView];
if ([documentView isKindOfClass:[WebHTMLView class]])
[(WebHTMLView *)documentView _resumeNullEventsForAllNetscapePlugins];
}
}
-- (id)_initWithWebFrameView:(WebFrameView *)fv webView:(WebView *)v bridge:(WebFrameBridge *)bridge
+- (id)_initWithWebFrameView:(WebFrameView *)fv webView:(WebView *)v coreFrame:(Frame*)coreFrame
{
self = [super init];
if (!self)
_private = [[WebFramePrivate alloc] init];
- _private->bridge = bridge;
+ _private->bridge = (WebFrameBridge *)Mac(coreFrame)->bridge();
if (fv) {
[_private setWebFrameView:fv];
- (NSArray *)_documentViews
{
NSMutableArray *result = [NSMutableArray array];
- for (WebFrame *frame = self; frame; frame = [frame _traverseNextFrameStayWithin:self]) {
- id docView = [[frame frameView] documentView];
+ Frame* coreFrame = core(self);
+ for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
+ id docView = [[kit(frame) frameView] documentView];
if (docView)
[result addObject:docView];
}
-
return result;
}
BOOL drawsBackground = [[self webView] drawsBackground];
NSColor *backgroundColor = [[self webView] backgroundColor];
- for (WebFrame *frame = self; frame; frame = [frame _traverseNextFrameStayWithin:self]) {
+ Frame* coreFrame = core(self);
+ for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
+ WebFrameBridge *bridge = (WebFrameBridge *)Mac(frame)->bridge();
+ WebFrame *webFrame = [bridge webFrame];
// Never call setDrawsBackground:YES here on the scroll view or the background color will
// flash between pages loads. setDrawsBackground:YES will be called in _frameLoadCompleted.
if (!drawsBackground)
- [[[frame frameView] _scrollView] setDrawsBackground:NO];
- [[[frame frameView] _scrollView] setBackgroundColor:backgroundColor];
- id documentView = [[frame frameView] documentView];
+ [[[webFrame frameView] _scrollView] setDrawsBackground:NO];
+ [[[webFrame frameView] _scrollView] setBackgroundColor:backgroundColor];
+ id documentView = [[webFrame frameView] documentView];
if ([documentView respondsToSelector:@selector(setDrawsBackground:)])
[documentView setDrawsBackground:drawsBackground];
if ([documentView respondsToSelector:@selector(setBackgroundColor:)])
[documentView setBackgroundColor:backgroundColor];
- [[frame _bridge] setDrawsBackground:drawsBackground];
- [[frame _bridge] setBaseBackgroundColor:backgroundColor];
+ [bridge setDrawsBackground:drawsBackground];
+ [bridge setBaseBackgroundColor:backgroundColor];
}
}
- (void)_unmarkAllMisspellings
{
- for (WebFrame *frame = self; frame; frame = [frame _traverseNextFrameStayWithin:self])
- [[frame _bridge] unmarkAllMisspellings];
+ Frame* coreFrame = core(self);
+ for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame))
+ [Mac(frame)->bridge() unmarkAllMisspellings];
}
- (BOOL)_hasSelection
{
id documentView = [[self frameView] documentView];
-
+
// optimization for common case to avoid creating potentially large selection string
- if ([documentView isKindOfClass:[WebHTMLView class]]) {
- DOMRange *selectedDOMRange = [[self _bridge] selectedDOMRange];
- return selectedDOMRange && ![selectedDOMRange collapsed];
- }
-
+ if ([documentView isKindOfClass:[WebHTMLView class]])
+ if (Frame* coreFrame = core(self))
+ return coreFrame->selectionController()->isRange();
+
if ([documentView conformsToProtocol:@protocol(WebDocumentText)])
return [[documentView selectedString] length] > 0;
{
// FIXME: 4186050 is one known case that makes this debug check fail.
BOOL found = NO;
- for (WebFrame *frame = self; frame; frame = [frame _traverseNextFrameStayWithin:self]) {
- if ([frame _hasSelection]) {
+ Frame* coreFrame = core(self);
+ for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame))
+ if ([kit(frame) _hasSelection]) {
if (found)
return NO;
found = YES;
}
- }
return YES;
}
#endif
- (WebFrame *)_findFrameWithSelection
{
- for (WebFrame *frame = self; frame; frame = [frame _traverseNextFrameStayWithin:self])
- if ([frame _hasSelection])
- return frame;
-
+ Frame* coreFrame = core(self);
+ for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame))
+ if ([kit(frame) _hasSelection])
+ return kit(frame);
return nil;
}
- (FrameLoader*)_frameLoader
{
- Frame* frame = [_private->bridge _frame];
+ Frame* frame = core(self);
return frame ? frame->loader() : 0;
}
// FIXME: Yhis exists only as a convenience for Safari, consider moving there.
- (BOOL)_isDescendantOfFrame:(WebFrame *)ancestor
{
- return [[self _bridge] isDescendantOfFrame:[ancestor _bridge]];
+ Frame* coreFrame = core(self);
+ return coreFrame && coreFrame->tree()->isDescendantOf(core(ancestor));
}
-- (void)_setShouldCreateRenderers:(BOOL)f
+- (void)_setShouldCreateRenderers:(BOOL)frame
{
- [_private->bridge setShouldCreateRenderers:f];
+ [_private->bridge setShouldCreateRenderers:frame];
}
- (NSColor *)_bodyBackgroundColor
{
- return [_private->bridge bodyBackgroundColor];
+ return core(self)->bodyBackgroundColor();
}
- (BOOL)_isFrameSet
- (id)init
{
- return [self initWithName:nil webFrameView:nil webView:nil];
+ return nil;
}
-// FIXME: this method can't work any more and should be marked deprecated
-- (id)initWithName:(NSString *)n webFrameView:(WebFrameView *)fv webView:(WebView *)v
+// Should be deprecated.
+- (id)initWithName:(NSString *)name webFrameView:(WebFrameView *)view webView:(WebView *)webView
{
- return [self _initWithWebFrameView:fv webView:v bridge:nil];
+ return nil;
}
- (void)dealloc
{
ASSERT(_private->bridge == nil);
[_private release];
-
--WebFrameCount;
-
[super dealloc];
}
- (void)finalize
{
ASSERT(_private->bridge == nil);
-
--WebFrameCount;
-
[super finalize];
}
- (NSString *)name
{
- return [[self _bridge] name];
+ Frame* coreFrame = core(self);
+ if (!coreFrame)
+ return nil;
+ return coreFrame->tree()->name();
}
- (WebFrameView *)frameView
- (WebView *)webView
{
- return [[[self _bridge] page] webView];
+ Frame* coreFrame = core(self);
+ return coreFrame ? [coreFrame->page()->bridge() webView] : nil;
}
- (DOMDocument *)DOMDocument
{
- return [[self dataSource] _isDocumentHTML] ? [_private->bridge DOMDocument] : nil;
+ Frame* coreFrame = core(self);
+ if (!coreFrame)
+ return nil;
+ // FIXME: Why do we need this check?
+ if (![[self dataSource] _isDocumentHTML])
+ return nil;
+ return kit(coreFrame->document());
}
- (DOMHTMLElement *)frameElement
{
- return [[self webView] mainFrame] != self ? [_private->bridge frameElement] : nil;
+ Frame* coreFrame = core(self);
+ if (!coreFrame)
+ return nil;
+ Element* element = coreFrame->ownerElement();
+ if (!element->isHTMLElement())
+ return nil;
+ return kit(static_cast<HTMLElement*>(element));
}
- (WebDataSource *)provisionalDataSource
- (WebFrame *)findFrameNamed:(NSString *)name
{
- return frame([[self _bridge] findFrameNamed:name]);
+ Frame* coreFrame = core(self);
+ if (!coreFrame)
+ return nil;
+ return kit(coreFrame->tree()->find(name));
}
- (WebFrame *)parentFrame
{
- return [[frame([_private->bridge _frame]->tree()->parent()) retain] autorelease];
+ Frame* coreFrame = core(self);
+ if (!coreFrame)
+ return nil;
+ return [[kit(coreFrame->tree()->parent()) retain] autorelease];
}
- (NSArray *)childFrames
{
- NSMutableArray *children = [NSMutableArray arrayWithCapacity:[self _childFrameCount]];
- for (WebFrame *child = [self _firstChildFrame]; child; child = [child _nextSiblingFrame])
- [children addObject:child];
-
+ Frame* coreFrame = core(self);
+ if (!coreFrame)
+ return [NSArray array];
+ NSMutableArray *children = [NSMutableArray arrayWithCapacity:coreFrame->tree()->childCount()];
+ for (Frame* child = coreFrame->tree()->firstChild(); child; child = child->tree()->nextSibling())
+ [children addObject:kit(child)];
return children;
}
// When we are pre-commit, the currentItem is where the pageCache data resides
NSDictionary *pageCache = [_private->currentItem pageCache];
- [[self _bridge] invalidatePageCache:pageCache];
+ [_private->bridge invalidatePageCache:pageCache];
// We're assuming that WebCore invalidates its pageCache state in didNotOpen:pageCache:
[_private->currentItem setHasPageCache:NO];
[[webView _frameLoadDelegateForwarder] webView:webView didFirstLayoutInFrame:self];
}
-- (WebCoreFrameBridge *)_dispatchCreateWebViewWithRequest:(NSURLRequest *)request
+- (Frame*)_dispatchCreateWebViewWithRequest:(NSURLRequest *)request
{
WebView *currentWebView = [self webView];
id wd = [currentWebView UIDelegate];
if ([wd respondsToSelector:@selector(webView:createWebViewWithRequest:)])
- return [[[wd webView:currentWebView createWebViewWithRequest:request] mainFrame] _bridge];
-
- return [[[[WebDefaultUIDelegate sharedUIDelegate] webView:currentWebView createWebViewWithRequest:request] mainFrame] _bridge];
+ return core([[wd webView:currentWebView createWebViewWithRequest:request] mainFrame]);
+ return core([[[WebDefaultUIDelegate sharedUIDelegate] webView:currentWebView createWebViewWithRequest:request] mainFrame]);
}
- (void)_dispatchShow
[[webView _policyDelegateForwarder] webView:webView unableToImplementPolicyWithError:error frame:self];
}
-- (void)_dispatchSourceFrame:(WebCoreFrameBridge *)sourceFrame willSubmitForm:(DOMElement *)form withValues:(NSDictionary *)values submissionDecider:(WebPolicyDecider *)decider
+- (void)_dispatchSourceFrame:(Frame*)sourceFrame willSubmitForm:(Element*)form withValues:(NSDictionary *)values submissionDecider:(WebPolicyDecider *)decider
{
- [[self _formDelegate] frame:self sourceFrame:frame(sourceFrame) willSubmitForm:form withValues:values submissionListener:decisionListener(decider)];
+ [[self _formDelegate] frame:self sourceFrame:kit(sourceFrame) willSubmitForm:kit(form) withValues:values submissionListener:decisionListener(decider)];
}
- (void)_detachedFromParent1
- (void)_prepareForDataSourceReplacement
{
if (![self dataSource]) {
- ASSERT(![self _childFrameCount]);
+ ASSERT(!core(self)->tree()->childCount());
return;
}
// over it again when we leave that page.
WebHistoryItem *item = _private->currentItem;
if ([self _canCachePage]
- && [_private->bridge canCachePage]
&& item
&& ![self _frameLoader]->isQuickRedirectComing()
&& loadType != FrameLoadTypeReload
}
} else
// Put the document into a null state, so it can be restored correctly.
- [_private->bridge _frame]->clear();
+ core(self)->clear();
} else
LOG(PageCache, "NOT saving page to back/forward cache, %@\n", [[self dataSource] _URL]);
}
#import "WebFramePrivate.h"
#import "WebPolicyDelegatePrivate.h"
-#import <WebCore/FrameLoaderTypes.h>
#ifdef __cplusplus
+#import <WebCore/FrameLoaderTypes.h>
#import <wtf/Forward.h>
#endif
-@class WebCoreFrameBridge;
-@class WebDocumentLoader;
+@class DOMRange;
@class WebInspector;
@class WebFrameView;
@class WebFrameBridge;
#ifdef __cplusplus
namespace WebCore {
+ class Document;
class DocumentLoader;
+ class Element;
+ class Frame;
+ class FrameMac;
class FrameLoader;
+ class HTMLElement;
+ class Range;
class WebResourceLoader;
struct LoadErrorResetToken;
}
+WebCore::FrameMac* core(WebFrame *);
+WebFrame *kit(WebCore::Frame *);
+
+WebCore::Element* core(DOMElement *);
+DOMElement *kit(WebCore::Element*);
+
+WebCore::Document* core(DOMDocument *);
+DOMDocument *kit(WebCore::Document*);
+
+WebCore::HTMLElement* core(DOMHTMLElement *);
+DOMHTMLElement *kit(WebCore::HTMLElement*);
+
+WebCore::Range* core(DOMRange *);
+DOMRange *kit(WebCore::Range*);
+
#endif
@interface WebFrame (WebInternal)
- (void)_clearSelection;
- (WebFrame *)_findFrameWithSelection;
- (void)_clearSelectionInOtherFrames;
-- (id)_initWithWebFrameView:(WebFrameView *)fv webView:(WebView *)v bridge:(WebFrameBridge *)bridge;
+#ifdef __cplusplus
+- (id)_initWithWebFrameView:(WebFrameView *)fv webView:(WebView *)v coreFrame:(WebCore::Frame*)coreFrame;
+#endif
- (void)_addPlugInView:(NSView *)plugInView;
- (void)_removeAllPlugInViews;
- (WebFrameBridge *)_bridge;
-- (void)_goToItem:(WebHistoryItem *)item withLoadType:(FrameLoadType)type;
+#ifdef __cplusplus
+- (void)_goToItem:(WebHistoryItem *)item withLoadType:(WebCore::FrameLoadType)type;
+#endif
- (void)_loadURL:(NSURL *)URL referrer:(NSString *)referrer intoChild:(WebFrame *)childFrame;
- (void)_viewWillMoveToHostWindow:(NSWindow *)hostWindow;
- (BOOL)_canCachePage;
- (void)_purgePageCache;
-
-- (WebFrame *)_nextFrameWithWrap:(BOOL)wrapFlag;
-- (WebFrame *)_previousFrameWithWrap:(BOOL)wrapFlag;
-
- (int)_numPendingOrLoadingRequests:(BOOL)recurse;
- (void)_reloadForPluginChanges;
- (void)_dispatchDidFailLoadWithError:(NSError *)error;
- (void)_dispatchDidFinishLoadForFrame;
- (void)_dispatchDidFirstLayoutInFrame;
-- (WebCoreFrameBridge *)_dispatchCreateWebViewWithRequest:(NSURLRequest *)request;
+- (WebCore::Frame*)_dispatchCreateWebViewWithRequest:(NSURLRequest *)request;
- (void)_dispatchShow;
- (WebPolicyDecider *)_createPolicyDeciderWithTarget:(id)target action:(SEL)action;
- (void)_dispatchDecidePolicyForMIMEType:(NSString *)MIMEType request:(NSURLRequest *)request decider:(WebPolicyDecider *)decider;
- (void)_dispatchDecidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)frameName decider:(WebPolicyDecider *)decider;
- (void)_dispatchDecidePolicyForNavigationAction:(NSDictionary *)action request:(NSURLRequest *)request decider:(WebPolicyDecider *)decider;
- (void)_dispatchUnableToImplementPolicyWithError:(NSError *)error;
-- (void)_dispatchSourceFrame:(WebCoreFrameBridge *)sourceFrame willSubmitForm:(DOMElement *)form withValues:(NSDictionary *)values submissionDecider:(WebPolicyDecider *)decider;
+- (void)_dispatchSourceFrame:(WebCore::Frame*)sourceFrame willSubmitForm:(WebCore::Element*)form withValues:(NSDictionary *)values submissionDecider:(WebPolicyDecider *)decider;
- (void)_detachedFromParent1;
- (void)_detachedFromParent2;
- (void)_detachedFromParent3;
@interface NSObject (WebInternalFrameLoadDelegate)
- (void)webFrame:(WebFrame *)webFrame didFinishLoadWithError:(NSError *)error;
@end
-
-@interface WebFrame (FrameTraversal)
-- (WebFrame *)_firstChildFrame;
-- (WebFrame *)_lastChildFrame;
-- (unsigned)_childFrameCount;
-- (WebFrame *)_previousSiblingFrame;
-- (WebFrame *)_nextSiblingFrame;
-- (WebFrame *)_traverseNextFrameStayWithin:(WebFrame *)stayWithin;
-@end
}
if (frame) {
- if ([self _isDisplayingWebArchive]) {
+ if ([self _isDisplayingWebArchive])
[self loadArchive];
- } else {
+ else
// Telling the bridge we received some data and passing nil as the data is our
// way to get work done that is normally done when the first bit of data is
// received, even for the case of a document with no data (like about:blank).
[_private->bridge receivedData:nil textEncodingName:[[_private->dataSource response] textEncodingName]];
- }
WebView *webView = [frame webView];
if ([webView isEditable])
- [_private->bridge _frame]->applyEditingStyleToBodyElement();
+ core(frame)->applyEditingStyleToBodyElement();
}
}
- (DOMDocument *)DOMDocument
{
- return [_private->bridge DOMDocument];
+ return [[_private->bridge webFrame] DOMDocument];
}
- (NSAttributedString *)attributedText
{
- // FIXME: Implement
+ // FIXME: Implement
return nil;
}
#import "WebViewInternal.h"
#import <AppKit/NSAccessibility.h>
#import <ApplicationServices/ApplicationServices.h>
+#import <WebCore/FloatRect.h>
#import <WebCore/FrameMac.h>
+#import <WebCore/SelectionController.h>
#import <WebCore/WebCoreTextRenderer.h>
#import <WebCore/WebDataProtocol.h>
#import <WebKit/DOM.h>
- (DOMRange *)_documentRange
{
- return [[[self _bridge] DOMDocument] _documentRange];
+ return [[[self _frame] DOMDocument] _documentRange];
}
- (BOOL)_imageExistsAtPaths:(NSArray *)paths
} else {
// Non-image file types
NSString *url = [[[NSURL fileURLWithPath:path] _webkit_canonicalize] _web_userVisibleString];
- [domNodes addObject:[[[self _bridge] DOMDocument] createTextNode: url]];
+ [domNodes addObject:[[[self _frame] DOMDocument] createTextNode: url]];
}
}
self, @"WebResourceHandler", nil];
NSArray *subresources;
DOMDocumentFragment *fragment = [string _documentFromRange:NSMakeRange(0, [string length])
- document:[[self _bridge] DOMDocument]
+ document:[[self _frame] DOMDocument]
documentAttributes:documentAttributes
subresources:&subresources];
[documentAttributes release];
}
if ((URL = [NSURL URLFromPasteboard:pasteboard])) {
- DOMDocument* document = [[self _bridge] DOMDocument];
+ DOMDocument* document = [[self _frame] DOMDocument];
ASSERT(document);
if (document) {
DOMHTMLAnchorElement* anchor = (DOMHTMLAnchorElement*)[document createElement:@"a"];
- (DOMRange *)_selectedRange
{
- return [[self _bridge] selectedDOMRange];
+ Frame* coreFrame = core([self _frame]);
+ if (!coreFrame)
+ return nil;
+ return kit(coreFrame->selectionController()->toRange().get());
}
- (BOOL)_shouldDeleteRange:(DOMRange *)range
windowNumber:[[view window] windowNumber]
context:[[NSApp currentEvent] context]
eventNumber:0 clickCount:0 pressure:0];
- [[lastHitView _bridge] mouseMoved:event];
+ if (FrameMac* lastHitCoreFrame = core([lastHitView _frame]))
+ lastHitCoreFrame->mouseMoved(event);
}
lastHitView = view;
if (view) {
- [[view _bridge] mouseMoved:event];
+ if (FrameMac* coreFrame = core([view _frame]))
+ coreFrame->mouseMoved(event);
NSPoint point = [view convertPoint:[event locationInWindow] fromView:nil];
NSDictionary *element = [view elementAtPoint:point];
- (BOOL)_canEditRichly
{
- return [self _canEdit] && [[self _bridge] isSelectionRichlyEditable];
+ Frame* coreFrame = core([self _frame]);
+ if (!coreFrame)
+ return NO;
+ return [self _canEdit] && coreFrame->selectionController()->isContentRichlyEditable();
}
- (BOOL)_canAlterCurrentSelection
- (BOOL)_hasSelection
{
- return [[self _bridge] selectionState] == WebSelectionStateRange;
+ Frame* coreFrame = core([self _frame]);
+ if (!coreFrame)
+ return NO;
+ return coreFrame->selectionController()->isRange();
}
- (BOOL)_hasSelectionOrInsertionPoint
{
- return [[self _bridge] selectionState] != WebSelectionStateNone;
+ Frame* coreFrame = core([self _frame]);
+ if (!coreFrame)
+ return NO;
+ return coreFrame->selectionController()->isCaretOrRange();
}
- (BOOL)_hasInsertionPoint
{
- return [[self _bridge] selectionState] == WebSelectionStateCaret;
+ Frame* coreFrame = core([self _frame]);
+ if (!coreFrame)
+ return NO;
+ return coreFrame->selectionController()->isCaret();
}
- (BOOL)_isEditable
{
- return [[self _webView] isEditable] || [[self _bridge] isSelectionEditable];
+ Frame* coreFrame = core([self _frame]);
+ if (!coreFrame)
+ return NO;
+ return [[self _webView] isEditable] || coreFrame->selectionController()->isContentEditable();
}
- (BOOL)_isSelectionInPasswordField
{
- return [[self _bridge] isSelectionInPasswordField];
+ Frame* coreFrame = core([self _frame]);
+ if (!coreFrame)
+ return NO;
+ return coreFrame->isSelectionInPasswordField();
}
- (BOOL)_isSelectionMisspelled
- (void)_lookUpInDictionaryFromMenu:(id)sender
{
// This should only be called when there's a selection, but play it safe.
- if (![self _hasSelection]) {
+ if (![self _hasSelection])
return;
- }
// Soft link to dictionary-display function to avoid linking another framework (ApplicationServices/LangAnalysis)
static bool lookedForFunction = false;
// FIXME: the dictionary API expects the rect for the first line of selection. Passing
// the rect for the entire selection, as we do here, positions the pop-up window near
// the bottom of the selection rather than at the selected word.
- NSRect rect = [self convertRect:[[self _bridge] visibleSelectionRect] toView:nil];
+ NSRect rect = [self convertRect:core([self _frame])->visibleSelectionRect() toView:nil];
rect.origin = [[self window] convertBaseToScreen:rect.origin];
NSData *data = [attrString RTFFromRange:NSMakeRange(0, [attrString length]) documentAttributes:nil];
dictionaryServiceWindowShow(data, rect, (writingDirection == NSWritingDirectionRightToLeft) ? 1 : 0);
- (NSImage *)_selectionDraggingImage
{
if ([self _hasSelection]) {
- NSImage *dragImage = [[self _bridge] selectionImageForcingWhiteText:NO];
+ NSImage *dragImage = core([self _frame])->selectionImage();
[dragImage _web_dissolveToFraction:WebDragImageAlpha];
return dragImage;
}
- (BOOL)_canIncreaseSelectionListLevel
{
- return ([self _canEditRichly] && [[self _bridge] canIncreaseSelectionListLevel]);
+ return [self _canEditRichly] && [[self _bridge] canIncreaseSelectionListLevel];
}
- (BOOL)_canDecreaseSelectionListLevel
{
- return ([self _canEditRichly] && [[self _bridge] canDecreaseSelectionListLevel]);
+ return [self _canEditRichly] && [[self _bridge] canDecreaseSelectionListLevel];
}
- (DOMNode *)_increaseSelectionListLevel
{
// This method does the job of updating the view based on the view's firstResponder-ness and
// the window key-ness of the window containing this view. This involves four kinds of
- // drawing updates right now, all handled in WebCore in response to the call over the bridge.
+ // drawing updates right now.
//
// The four display attributes are as follows:
//
BOOL windowOrSheetIsKey = windowIsKey || [[window attachedSheet] isKeyWindow];
BOOL isActive = !_private->resigningFirstResponder && windowIsKey && (_private->descendantBecomingFirstResponder || [self _web_firstResponderCausesFocusDisplay]);
-
- [[self _bridge] setWindowHasFocus:windowOrSheetIsKey];
- [[self _bridge] setIsActive:isActive];
+
+ if (Frame* coreFrame = core([self _frame])) {
+ coreFrame->setWindowHasFocus(windowOrSheetIsKey);
+ coreFrame->setIsActive(isActive);
+ }
}
- (unsigned)markAllMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag limit:(unsigned)limit
- (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pasteboard
{
- if ([[self _bridge] isSelectionRichlyEditable])
+ Frame* coreFrame = core([self _frame]);
+ if (!coreFrame)
+ return NO;
+ if (coreFrame->selectionController()->isContentRichlyEditable())
[self _pasteWithPasteboard:pasteboard allowPlainText:YES];
else
[self _pasteAsPlainTextWithPasteboard:pasteboard];
- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item
{
SEL action = [item action];
- WebFrameBridge *bridge = [self _bridge];
- FrameMac* frame = [bridge _frame];
+ FrameMac* frame = core([self _frame]);
if (action == @selector(changeSpelling:)
|| action == @selector(_changeSpellingFromMenu:)
return (frame && frame->mayDHTMLPaste()) || [self _canPaste];
if (action == @selector(pasteAsRichText:))
- return (frame && frame->mayDHTMLPaste()) || ([self _canPaste] && [[self _bridge] isSelectionRichlyEditable]);
+ return frame && (frame->mayDHTMLPaste()
+ || ([self _canPaste] && frame->selectionController()->isContentRichlyEditable()));
if (action == @selector(performFindPanelAction:))
// FIXME: Not yet implemented.
// <rdar://problem/3672088>: "Editable WebViews should maintain a selection even
// when they're not firstResponder"
// it was decided to add a switch to act more like an NSTextView.
- id nextResponder = [[self window] _newFirstResponderAfterResigning];
+
+ if ([[self _webView] maintainsInactiveSelection])
+ return YES;
// Predict the case where we are losing first responder status only to
- // gain it back again. Want to keep the selection in that case.
+ // gain it back again. Want to keep the selection in that case.
+ id nextResponder = [[self window] _newFirstResponderAfterResigning];
if ([nextResponder isKindOfClass:[NSScrollView class]]) {
id contentView = [nextResponder contentView];
- if (contentView) {
+ if (contentView)
nextResponder = contentView;
- }
}
if ([nextResponder isKindOfClass:[NSClipView class]]) {
id documentView = [nextResponder documentView];
- if (documentView) {
+ if (documentView)
nextResponder = documentView;
- }
}
-
if (nextResponder == self)
return YES;
-
- BOOL nextResponderIsInWebView = [nextResponder isKindOfClass:[NSView class]] && [nextResponder isDescendantOf:[[[self _webView] mainFrame] frameView]];
- return [[self _webView] maintainsInactiveSelection] || ([[self _bridge] isSelectionEditable] && nextResponderIsInWebView);
+ FrameMac* coreFrame = core([self _frame]);
+ bool selectionIsEditable = coreFrame && coreFrame->selectionController()->isContentEditable();
+ bool nextResponderIsInWebView = [nextResponder isKindOfClass:[NSView class]]
+ && [nextResponder isDescendantOf:[[[self _webView] mainFrame] frameView]];
+
+ return selectionIsEditable && nextResponderIsInWebView;
}
- (void)addMouseMovedObserver
[_private->compController endRevertingChange:NO moveLeft:NO];
_private->handlingMouseDownEvent = YES;
- BOOL handledEvent = [[self _bridge] sendContextMenuEvent:event];
+ BOOL handledEvent = core([self _frame])->sendContextMenuEvent(event);
_private->handlingMouseDownEvent = NO;
if (handledEvent)
return nil;
- (void)scrollWheel:(NSEvent *)event
{
[self retain];
- FrameMac* frame = [[self _bridge] _frame];
+ FrameMac* frame = core([self _frame]);
if (!frame || !frame->wheelEvent(event))
[[self nextResponder] scrollWheel:event];
[self release];
if ([[self _webView] _dashboardBehavior:WebDashboardBehaviorAlwaysAcceptsFirstMouse])
return YES;
- if (hitHTMLView != nil) {
- [hitHTMLView _setMouseDownEvent:event];
- [[hitHTMLView _bridge] setActivationEventNumber:[event eventNumber]];
+ if (hitHTMLView) {
bool result = false;
- if ([hitHTMLView _isSelectionEvent:event])
- if (FrameMac* frame = [[hitHTMLView _bridge] _frame])
- result = frame->eventMayStartDrag(event);
- [hitHTMLView _setMouseDownEvent:nil];
+ if (FrameMac* coreFrame = core([hitHTMLView _frame])) {
+ coreFrame->setActivationEventNumber([event eventNumber]);
+ [hitHTMLView _setMouseDownEvent:event];
+ if ([hitHTMLView _isSelectionEvent:event])
+ result = coreFrame->eventMayStartDrag(event);
+ [hitHTMLView _setMouseDownEvent:nil];
+ }
return result;
}
return [hitView acceptsFirstMouse:event];
{
NSView *hitView = [self _hitViewForEvent:event];
WebHTMLView *hitHTMLView = [hitView isKindOfClass:[self class]] ? (WebHTMLView *)hitView : nil;
- if (hitHTMLView != nil) {
+ if (hitHTMLView) {
bool result = false;
if ([hitHTMLView _isSelectionEvent:event])
- if (FrameMac* frame = [[hitHTMLView _bridge] _frame])
- result = frame->eventMayStartDrag(event);
- [hitHTMLView _setMouseDownEvent:nil];
+ if (FrameMac* coreFrame = core([hitHTMLView _frame])) {
+ [hitHTMLView _setMouseDownEvent:event];
+ result = coreFrame->eventMayStartDrag(event);
+ [hitHTMLView _setMouseDownEvent:nil];
+ }
return result;
}
return [hitView shouldDelayWindowOrderingForEvent:event];
// Don't do any mouseover while the mouse is down.
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(_updateMouseoverWithFakeEvent) object:nil];
- // Let KHTML get a chance to deal with the event. This will call back to us
+ // Let WebCore get a chance to deal with the event. This will call back to us
// to start the autoscroll timer if appropriate.
- [[self _bridge] mouseDown:event];
+ core([self _frame])->mouseDown(event);
}
done:
[self retain];
if (!_private->ignoringMouseDraggedEvents)
- [[self _bridge] mouseDragged:event];
+ core([self _frame])->mouseDragged(event);
[self release];
}
[self retain];
[self _stopAutoscrollTimer];
- [[self _bridge] mouseUp:event];
+ core([self _frame])->mouseUp(event);
[self _updateMouseoverWithFakeEvent];
[self release];
_private->keyDownEvent = event;
- WebFrameBridge *bridge = [self _bridge];
- if ([bridge interceptKeyEvent:event toView:self]) {
+ if (core([self _frame])->keyEvent(event)) {
// WebCore processed a key event, bail on any outstanding complete: UI
[_private->compController endRevertingChange:YES moveLeft:NO];
} else if (_private->compController && [_private->compController filterKeyDown:event]) {
- (void)keyUp:(NSEvent *)event
{
[self retain];
- if (![[self _bridge] interceptKeyEvent:event toView:self])
+ if (!core([self _frame])->keyEvent(event))
[super keyUp:event];
[self release];
}
- (void)centerSelectionInVisibleArea:(id)sender
{
- [[self _bridge] centerSelectionInVisibleArea];
+ if (FrameMac* coreFrame = core([self _frame]))
+ coreFrame->revealSelection(RenderLayer::gAlignCenterAlways);
}
- (void)moveBackward:(id)sender
- (NSData *)_selectionStartFontAttributesAsRTF
{
NSAttributedString *string = [[NSAttributedString alloc] initWithString:@"x"
- attributes:[[self _bridge] _frame]->fontAttributesForSelectionStart()];
+ attributes:core([self _frame])->fontAttributesForSelectionStart()];
NSData *data = [string RTFFromRange:NSMakeRange(0, [string length]) documentAttributes:nil];
[string release];
return data;
- (DOMCSSStyleDeclaration *)_emptyStyle
{
- return [[[self _bridge] DOMDocument] createCSSStyleDeclaration];
+ return [[[self _frame] DOMDocument] createCSSStyleDeclaration];
}
- (NSString *)_colorAsString:(NSColor *)color
// But don't do it if we have already handled the event.
if (event != _private->keyDownEvent
&& [self _web_firstResponderIsSelfOrDescendantView]
- && [[self _bridge] interceptKeyEvent:event toView:self])
+ && core([self _frame])->keyEvent(event))
ret = YES;
else
ret = [super performKeyEquivalent:event];
- (void)indent:(id)sender
{
- [[self _bridge] _frame]->indent();
+ core([self _frame])->indent();
}
- (void)outdent:(id)sender
{
- [[self _bridge] _frame]->outdent();
+ core([self _frame])->outdent();
}
#if 0
- (void)cut:(id)sender
{
WebFrameBridge *bridge = [self _bridge];
- FrameMac* frame = [bridge _frame];
+ FrameMac* frame = core([self _frame]);
if (frame && frame->tryDHTMLCut())
return; // DHTML did the whole operation
if (![self _canCut]) {
- (void)paste:(id)sender
{
- WebFrameBridge *bridge = [self _bridge];
- FrameMac* frame = [bridge _frame];
- if (frame && frame->tryDHTMLPaste())
+ FrameMac* coreFrame = core([self _frame]);
+ if (coreFrame && coreFrame->tryDHTMLPaste())
return; // DHTML did the whole operation
if (![self _canPaste])
return;
- if ([bridge isSelectionRichlyEditable])
+ if (coreFrame->selectionController()->isContentRichlyEditable())
[self _pasteWithPasteboard:[NSPasteboard generalPasteboard] allowPlainText:YES];
else
[self _pasteAsPlainTextWithPasteboard:[NSPasteboard generalPasteboard]];
ASSERT([self hasMarkedText]);
WebFrameBridge *bridge = [self _bridge];
- DOMRange *selectedRange = [[bridge DOMDocument] createRange];
+ DOMRange *selectedRange = [[[self _frame] DOMDocument] createRange];
DOMRange *markedTextRange = [bridge markedTextDOMRange];
ASSERT([markedTextRange startContainer] == [markedTextRange endContainer]);
// Get preceeding word stem
WebFrameBridge *bridge = [_view _bridge];
- DOMRange *selection = [bridge selectedDOMRange];
- DOMRange *wholeWord = [bridge rangeByAlteringCurrentSelection:WebSelectByExtending direction:WebBridgeSelectBackward granularity:WebBridgeSelectByWord];
+ DOMRange *selection = kit(core([_view _frame])->selectionController()->toRange().get());
+ DOMRange *wholeWord = [bridge rangeByAlteringCurrentSelection:WebSelectByExtending
+ direction:WebBridgeSelectBackward granularity:WebBridgeSelectByWord];
DOMRange *prefix = [wholeWord cloneRange];
[prefix setEnd:[selection startContainer] offset:[selection startOffset]];
- (NSRect)selectionRect
{
- return [[self _bridge] selectionRect];
+ if ([self _hasSelection])
+ return core([self _frame])->selectionRect();
+ return NSZeroRect;
}
- (NSView *)selectionView
- (NSImage *)selectionImageForcingWhiteText:(BOOL)forceWhiteText
{
if ([self _hasSelection])
- return [[self _bridge] selectionImageForcingWhiteText:forceWhiteText];
-
+ return core([self _frame])->selectionImage(forceWhiteText);
return nil;
}
- (NSRect)selectionImageRect
{
if ([self _hasSelection])
- return [[self _bridge] visibleSelectionRect];
+ return core([self _frame])->visibleSelectionRect();
return NSZeroRect;
}
- (NSAttributedString *)attributedString
{
WebFrameBridge *bridge = [self _bridge];
- DOMDocument *document = [bridge DOMDocument];
+ DOMDocument *document = [[self _frame] DOMDocument];
NSAttributedString *attributedString = [self _attributeStringFromDOMRange:[document _documentRange]];
if (attributedString == nil) {
attributedString = [bridge attributedStringFrom:document startOffset:0 to:nil endOffset:0];
- (BOOL)_isMoveDrag
{
+ FrameMac* coreFrame = core([self _frame]);
return _private->initiatedDrag
- && [[self _bridge] isSelectionEditable]
+ && coreFrame
+ && coreFrame->selectionController()->isContentEditable()
&& !([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask);
}
NSColor *color = [NSColor colorFromPasteboard:[draggingInfo draggingPasteboard]];
if (!color)
return NO;
+ Frame* coreFrame = core(innerFrame);
+ if (!coreFrame)
+ return NO;
+ DOMRange *innerRange = kit(coreFrame->selectionController()->toRange().get());
DOMCSSStyleDeclaration *style = [self _emptyStyle];
[style setProperty:@"color" value:[self _colorAsString:color] priority:@""];
- if ([[webView _editingDelegateForwarder] webView:webView shouldApplyStyle:style toElementsInDOMRange:[innerBridge selectedDOMRange]]) {
- [[webView _UIDelegateForwarder] webView:webView willPerformDragDestinationAction:WebDragDestinationActionEdit forDraggingInfo:draggingInfo];
- [innerBridge applyStyle:style withUndoAction:WebUndoActionSetColor];
- return YES;
- }
- return NO;
+ if (![[webView _editingDelegateForwarder] webView:webView
+ shouldApplyStyle:style toElementsInDOMRange:innerRange])
+ return NO;
+ [[webView _UIDelegateForwarder] webView:webView
+ willPerformDragDestinationAction:WebDragDestinationActionEdit
+ forDraggingInfo:draggingInfo];
+ [innerBridge applyStyle:style withUndoAction:WebUndoActionSetColor];
+ return YES;
}
BOOL didInsert = NO;
#import <WebCore/FrameLoader.h>
#import <objc/objc-runtime.h>
+using namespace WebCore;
+
NSString *WebActionNavigationTypeKey = @"WebActionNavigationTypeKey";
NSString *WebActionElementKey = @"WebActionElementKey";
NSString *WebActionButtonKey = @"WebActionButtonKey";
}
--(void)_usePolicy:(WebPolicyAction)policy
+-(void)_usePolicy:(PolicyAction)policy
{
if (_private->target != nil)
- ((void (*)(id, SEL, WebPolicyAction))objc_msgSend)(_private->target, _private->action, policy);
+ ((void (*)(id, SEL, PolicyAction))objc_msgSend)(_private->target, _private->action, policy);
}
-(void)_invalidate
-(void)use
{
- [self _usePolicy:WebPolicyUse];
+ [self _usePolicy:PolicyUse];
}
-(void)ignore
{
- [self _usePolicy:WebPolicyIgnore];
+ [self _usePolicy:PolicyIgnore];
}
-(void)download
{
- [self _usePolicy:WebPolicyDownload];
+ [self _usePolicy:PolicyDownload];
}
// WebFormSubmissionListener implementation
-(void)continue
{
- [self _usePolicy:WebPolicyUse];
+ [self _usePolicy:PolicyUse];
}
@end
*/
#import "WebScriptDebugDelegatePrivate.h"
-#import "WebScriptDebugServerPrivate.h"
+
#import "WebDataSource.h"
#import "WebDataSourceInternal.h"
-
-#import <WebKit/WebFrameBridge.h>
-#import <WebKit/WebFrameInternal.h>
-#import <WebKit/WebViewInternal.h>
+#import "WebFrameBridge.h"
+#import "WebFrameInternal.h"
+#import "WebScriptDebugServerPrivate.h"
+#import "WebViewInternal.h"
+#import <WebCore/FrameMac.h>
#import <WebCore/WebCoreScriptDebugger.h>
+using namespace WebCore;
+
// FIXME: these error strings should be public for future use by WebScriptObject and in WebScriptObject.h
NSString * const WebScriptErrorDomain = @"WebScriptErrorDomain";
NSString * const WebScriptErrorDescriptionKey = @"WebScriptErrorDescription";
@end
-
-
@implementation WebScriptDebugger
- (WebScriptDebugger *)initWithWebFrame:(WebFrame *)webFrame
- (WebScriptObject *)globalObject
{
- return [[_webFrame _bridge] windowScriptObject];
+ return core(_webFrame)->windowScriptObject();
}
- (id)newWrapperForFrame:(WebCoreScriptCallFrame *)frame
#import <JavaScriptCore/Assertions.h>
#import <WebCore/FrameLoader.h>
#import <WebCore/FrameMac.h>
+#import <WebCore/FrameTree.h>
+#import <WebCore/Page.h>
#import <WebCore/WebCoreEncodings.h>
#import <WebCore/WebCoreFrameBridge.h>
#import <WebCore/WebCoreSettings.h>
- (void)_attachScriptDebuggerToAllFrames
{
- WebFrame *frame = [self mainFrame];
- do {
- [frame _attachScriptDebugger];
- frame = [frame _nextFrameWithWrap:NO];
- } while (frame);
+ for (Frame* frame = core([self mainFrame]); frame; frame = frame->tree()->traverseNext())
+ [kit(frame) _attachScriptDebugger];
}
- (void)_detachScriptDebuggerFromAllFrames
{
- WebFrame *frame = [self mainFrame];
- do {
- [frame _detachScriptDebugger];
- frame = [frame _nextFrameWithWrap:NO];
- } while (frame);
+ for (Frame* frame = core([self mainFrame]); frame; frame = frame->tree()->traverseNext())
+ [kit(frame) _detachScriptDebugger];
}
- (void)setBackgroundColor:(NSColor *)backgroundColor
@end
-
@implementation _WebSafeForwarder
- initWithTarget: t defaultTarget: dt templateClass: (Class)aClass
return self;
}
-
// Used to send messages to delegates that implement informal protocols.
+ safeForwarderWithTarget: t defaultTarget: dt templateClass: (Class)aClass;
{
- (WebScriptObject *)windowScriptObject
{
- return [[[self mainFrame] _bridge] windowScriptObject];
+ return core([self mainFrame])->windowScriptObject();
}
// Get the appropriate user-agent string for a particular URL.
static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
{
- return forward ? [curr _nextFrameWithWrap:wrapFlag]
- : [curr _previousFrameWithWrap:wrapFlag];
+ Frame* coreFrame = core(curr);
+ return kit(forward
+ ? coreFrame->tree()->traverseNextWithWrap(wrapFlag)
+ : coreFrame->tree()->traversePreviousWithWrap(wrapFlag));
}
- (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag
// first time through
if (frame == startFrame) {
// Remember if start even has a selection, to know if we need to search more later
- if ([searchView isKindOfClass:[WebHTMLView class]]) {
+ if ([searchView isKindOfClass:[WebHTMLView class]])
// optimization for the common case, to avoid making giant string for selection
- startHasSelection = [[startFrame _bridge] selectedDOMRange] != nil;
- } else if ([searchView conformsToProtocol:@protocol(WebDocumentText)]) {
+ startHasSelection = [startFrame _hasSelection];
+ else if ([searchView conformsToProtocol:@protocol(WebDocumentText)])
startHasSelection = [(id <WebDocumentText>)searchView selectedString] != nil;
- }
startSearchView = searchView;
}
- (void)writeSelectionWithPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard
{
- WebFrameBridge *bridge = [self _bridgeForSelectedOrMainFrame];
- if (bridge && [bridge selectionState] != WebSelectionStateRange) {
- NSView <WebDocumentView> *documentView = [[[bridge webFrame] frameView] documentView];
- if ([documentView conformsToProtocol:@protocol(WebDocumentSelection)]) {
+ WebFrame *frame = [self _selectedOrMainFrame];
+ if (frame && [frame _hasSelection]) {
+ NSView <WebDocumentView> *documentView = [[frame frameView] documentView];
+ if ([documentView conformsToProtocol:@protocol(WebDocumentSelection)])
[(NSView <WebDocumentSelection> *)documentView writeSelectionWithPasteboardTypes:types toPasteboard:pasteboard];
- }
}
}
- (void)removeDragCaret
{
- [[[self mainFrame] _bridge] removeDragCaret];
+ [_private->_pageBridge impl]->dragCaretController()->clear();
}
- (void)setMainFrameURL:(NSString *)URLString
return _private->tabKeyCyclesThroughElements;
}
-- (void)setScriptDebugDelegate:delegate
+- (void)setScriptDebugDelegate:(id)delegate
{
_private->scriptDebugDelegate = delegate;
[_private->scriptDebugDelegateForwarder release];
[self _detachScriptDebuggerFromAllFrames];
}
-- scriptDebugDelegate
+- (id)scriptDebugDelegate
{
return _private->scriptDebugDelegate;
}
- (BOOL)shouldClose
{
- WebFrameBridge *bridge = [[self mainFrame] _bridge];
- if (!bridge)
+ FrameMac* coreFrame = core([self mainFrame]);
+ if (!coreFrame)
return YES;
- return [bridge shouldClose];
+ return coreFrame->shouldClose();
}
- (NSAppleEventDescriptor *)aeDescByEvaluatingJavaScriptFromString:(NSString *)script
- (DOMRange *)selectedDOMRange
{
- return [[self _bridgeForSelectedOrMainFrame] selectedDOMRange];
+ Frame* coreFrame = core([self _selectedOrMainFrame]);
+ if (!coreFrame)
+ return nil;
+ return kit(coreFrame->selectionController()->toRange().get());
}
- (NSSelectionAffinity)selectionAffinity
- (DOMCSSStyleDeclaration *)styleDeclarationWithText:(NSString *)text
{
// FIXME: Should this really be attached to the document with the current selection?
- DOMCSSStyleDeclaration *decl = [[[self _bridgeForSelectedOrMainFrame] DOMDocument] createCSSStyleDeclaration];
+ DOMCSSStyleDeclaration *decl = [[[self _selectedOrMainFrame] DOMDocument] createCSSStyleDeclaration];
[decl setCssText:text];
return decl;
}