WebKit_DisplayWebContent.pdf

(682 KB) Pobierz
WebKit Objective-C Programming Guide
WebKitObjective-CProgrammingGuide
Networking,Internet,&Web:WebClient
2009-07-28
695712238.001.png
AppleInc.
©2003,2009AppleInc.
Allrightsreserved.
Somestatesdonotallowtheexclusionorlimitation
ofimpliedwarrantiesorliabilityforincidentalor
consequentialdamages,sotheabovelimitationor
exclusionmaynotapplytoyou.Thiswarrantygives
youspecificlegalrights,andyoumayalsohave
otherrightswhichvaryfromstatetostate.
Nopartofthispublicationmaybereproduced,
storedinaretrievalsystem,ortransmitted,in
anyformorbyanymeans,mechanical,
electronic,photocopying,recording,or
otherwise,withoutpriorwrittenpermissionof
AppleInc.,withthefollowingexceptions:Any
personisherebyauthorizedtostore
documentationonasinglecomputerfor
personaluseonlyandtoprintcopiesof
documentationforpersonaluseprovidedthat
thedocumentationcontainsApple’scopyright
notice.
TheApplelogoisatrademarkofAppleInc.
Nolicenses,expressorimplied,aregranted
withrespecttoanyofthetechnologydescribed
inthisdocument.Appleretainsallintellectual
propertyrightsassociatedwiththetechnology
describedinthisdocument.Thisdocumentis
intendedtoassistapplicationdevelopersto
developapplicationsonlyforApple-labeled
computers.
AppleInc.
1InfiniteLoop
Cupertino,CA95014
408-996-1010
Apple,theApplelogo,Carbon,Cocoa,Mac,
MacOS,Objective-C,Pages,QuickTime,Safari,
andXcodearetrademarksofAppleInc.,
registeredintheUnitedStatesandother
countries.
WebScriptisatrademarkofAppleInc.
JavaisaregisteredtrademarkofOracleand/or
itsaffiliates.
EventhoughApplehasreviewedthisdocument,
APPLEMAKESNOWARRANTYORREPRESENTATION,
EITHEREXPRESSORIMPLIED,WITHRESPECTTO
THISDOCUMENT,ITSQUALITY,ACCURACY,
MERCHANTABILITY,ORFITNESSFORAPARTICULAR
PURPOSE.ASARESULT,THISDOCUMENTIS
PROVIDED“ASIS,”ANDYOU,THEREADER,ARE
ASSUMINGTHEENTIRERISKASTOITSQUALITY
ANDACCURACY.
INNOEVENTWILLAPPLEBELIABLEFORDIRECT,
INDIRECT,SPECIAL,INCIDENTAL,OR
CONSEQUENTIALDAMAGESRESULTINGFROMANY
DEFECTORINACCURACYINTHISDOCUMENT,even
ifadvisedofthepossibilityofsuchdamages.
THEWARRANTYANDREMEDIESSETFORTHABOVE
AREEXCLUSIVEANDINLIEUOFALLOTHERS,ORAL
ORWRITTEN,EXPRESSORIMPLIED.NoApple
dealer,agent,oremployeeisauthorizedtomake
anymodification,extension,oradditiontothis
warranty.
695712238.002.png
Contents
IntroductiontoWebKitObjective-CProgrammingGuide 9
WhatIstheWebKit? 9
WhoShouldReadThisDocument? 9
OrganizationofThisDocument 10
SeeAlso 11
WhyUsetheWebKit? 13
CoreWebKitClasses 15
FrameModelandViewClasses 15
DataModelandViewClasses 16
Provisionalvs.CommittedDataSources 17
WebViewDelegates 18
SimpleBrowsing 21
MultipleWindows 23
OpeningWindows 23
EnteringURLs 23
HandlingNewWindowRequests 24
LoadingPages 27
SequenceofFrameLoadDelegateMessages 27
TestingfortheMainFrame 28
DisplayingtheCurrentURL 28
DisplayingthePageTitle 28
DisplayingLoadStatus 29
LoadingResources 31
SequenceofResourceLoadDelegateMessages 31
IdentifyingResources 31
TrackingResourceLoadProgress 32
PagingBackandForward 35
EnablingandDisablingtheBack-ForwardList 35
AddingBackandForwardButtons 35
2009-07-28 | © 2003, 2009 Apple Inc. All Rights Reserved.
3
695712238.003.png
SettingthePageCache 35
SettingtheCapacity 36
TheCurrentItem 36
ManagingState 36
ManagingHistory 37
SharingHistoryObjects 37
AddingandRemovingHistoryItems 37
LoadingaHistoryItem 38
SavingandLoadingHistoryObjects 38
MakingPolicyDecisions 39
EnablingEditing 41
SavingandLoadingWebContent 43
ModifyingtheCurrentSelection 45
ChangingEditingBehavior 47
ShouldMethods 47
DidMethods 47
UsingUndoWhenEditing 49
UsingtheDocumentObjectModelfromObjective-C 51
InterpretingtheDOMSpecification 51
HandlingExceptions 53
UsingtheDocumentObjectModelExtensions 55
UsingJavaScriptFromObjective-C 57
Spoofing 59
AccessingtheWebKitFromCarbonApplications 61
DeterminingWebKitAvailability 63
TestingforURLLoadingSystemAvailability 63
4
2009-07-28 | © 2003, 2009 Apple Inc. All Rights Reserved.
695712238.004.png
TestingforWebKitAvailability 63
IsolatingYourWebKitandURLLoadingSystemSymbols 64
ConditionallyLoadingCode 64
WeakLinkingSymbols 64
DocumentRevisionHistory 67
2009-07-28 | © 2003, 2009 Apple Inc. All Rights Reserved.
5
Zgłoś jeśli naruszono regulamin