API  1.0.0
CPWebView.j
Go to the documentation of this file.
1 /*
2  * CPWebView.j
3  * AppKit
4  *
5  * Created by Thomas Robinson.
6  * Copyright 2008, 280 North, Inc.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 
24 
25 @typedef Window
26 
27 // FIXME: implement these where possible:
28 /*
29 CPWebViewDidBeginEditingNotification = "CPWebViewDidBeginEditingNotification";
30 CPWebViewDidChangeNotification = "CPWebViewDidChangeNotification";
31 CPWebViewDidChangeSelectionNotification = "CPWebViewDidChangeSelectionNotification";
32 CPWebViewDidChangeTypingStyleNotification = "CPWebViewDidChangeTypingStyleNotification";
33 CPWebViewDidEndEditingNotification = "CPWebViewDidEndEditingNotification";
34 CPWebViewProgressEstimateChangedNotification = "CPWebViewProgressEstimateChangedNotification";
35 */
36 CPWebViewProgressStartedNotification = "CPWebViewProgressStartedNotification";
37 CPWebViewProgressFinishedNotification = "CPWebViewProgressFinishedNotification";
38 
60 
66 
76 
90 @implementation CPWebView : CPView
91 {
92  CPScrollView _scrollView;
93  CPView _frameView;
94 
95  DOMElement _iframe;
96  CPString _mainFrameURL;
97  CPArray _backwardStack;
98  CPArray _forwardStack;
99 
100  BOOL _ignoreLoadStart;
101  BOOL _ignoreLoadEnd;
102  BOOL _isLoading;
103 
104  id _downloadDelegate;
105  id _frameLoadDelegate;
106  id _policyDelegate;
107  id _resourceLoadDelegate;
108  id _UIDelegate;
109 
110  CPWebScriptObject _wso;
111 
112  CPString _url;
113  CPString _html;
114 
115  Function _loadCallback;
116 
117  int _scrollMode;
118  int _effectiveScrollMode;
119  BOOL _contentIsAccessible;
120  CPTimer _contentSizeCheckTimer;
121  int _contentSizePollCount;
122 
123  int _loadHTMLStringTimer;
124 
125  BOOL _drawsBackground;
126 }
127 
128 - (id)initWithFrame:(CGRect)frameRect frameName:(CPString)frameName groupName:(CPString)groupName
129 {
130  if (self = [self initWithFrame:frameRect])
131  {
132  _iframe.name = frameName;
133  }
134 
135  return self;
136 }
137 
138 - (id)initWithFrame:(CGRect)aFrame
139 {
140  if (self = [super initWithFrame:aFrame])
141  {
142  _mainFrameURL = nil;
143  _backwardStack = [];
144  _forwardStack = [];
145  _scrollMode = CPWebViewScrollAuto;
146  _contentIsAccessible = YES;
147  _isLoading = NO;
148 
149  _drawsBackground = YES;
150 
152 
153  [self _initDOMWithFrame:aFrame];
154  }
155 
156  return self;
157 }
158 
159 - (id)_initDOMWithFrame:(CGRect)aFrame
160 {
161  _ignoreLoadStart = YES;
162  _ignoreLoadEnd = YES;
163 
164  _iframe = document.createElement("iframe");
165  _iframe.name = "iframe_" + FLOOR(RAND() * 10000);
166  _iframe.style.width = "100%";
167  _iframe.style.height = "100%";
168  _iframe.style.borderWidth = "0px";
169  _iframe.frameBorder = "0";
170 
171  [self _applyBackgroundColor];
172 
173  _loadCallback = function()
174  {
175  // HACK: this block handles the case where we don't know about loads initiated by the user clicking a link
176  if (!_ignoreLoadStart)
177  {
178  // post the start load notification
179  [self _startedLoading];
180 
181  if (_mainFrameURL)
182  [_backwardStack addObject:_mainFrameURL];
183 
184  // FIXME: this doesn't actually get the right URL for different domains. Not possible due to browser security restrictions.
185  _mainFrameURL = _iframe.src;
186 
187  // clear the forward
188  [_forwardStack removeAllObjects];
189  }
190  else
191  _ignoreLoadStart = NO;
192 
193  if (!_ignoreLoadEnd)
194  {
195  [self _finishedLoading];
196  }
197  else
198  _ignoreLoadEnd = NO;
199 
200  [[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
201  };
202 
203  if (_iframe.addEventListener)
204  _iframe.addEventListener("load", _loadCallback, false);
205  else if (_iframe.attachEvent)
206  _iframe.attachEvent("onload", _loadCallback);
207 
208  _frameView = [[CPView alloc] initWithFrame:[self bounds]];
209  [_frameView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
210 
211  _scrollView = [[CPScrollView alloc] initWithFrame:[self bounds]];
212  [_scrollView setAutohidesScrollers:YES];
213  [_scrollView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
214  [_scrollView setDocumentView:_frameView];
215 
216  _frameView._DOMElement.appendChild(_iframe);
217 
218  [self _updateEffectiveScrollMode];
219 
220  [self addSubview:_scrollView];
221 }
222 
223 - (void)setFrameSize:(CGSize)aSize
224 {
225  [super setFrameSize:aSize];
226  [self _resizeWebFrame];
227 }
228 
229 - (void)viewDidUnhide
230 {
231  // Sizing cannot properly happen while we're hidden because the iframe is inaccessible.
232  // So now that it is accessible again, make sure to catch up.
233  [_frameView setFrameSize:[_scrollView contentSize]];
234  [self _resizeWebFrame];
235  [self _scheduleContentSizeCheck];
236 }
237 
238 - (void)_attachScrollEventIfNecessary
239 {
240  if (_effectiveScrollMode !== CPWebViewScrollAppKit)
241  return;
242 
243  var win = [self DOMWindow];
244 
245  if (win && win.addEventListener)
246  {
247  var scrollEventHandler = function(anEvent)
248  {
249  var frameBounds = [self bounds],
250  frameCenter = CGPointMake(CGRectGetMidX(frameBounds), CGRectGetMidY(frameBounds)),
251  windowOrigin = [self convertPoint:frameCenter toView:nil],
252  globalOrigin = [[self window] convertBaseToBridge:windowOrigin];
253 
254  anEvent._overrideLocation = globalOrigin;
255  [[[self window] platformWindow] scrollEvent:anEvent];
256  };
257 
258  win.addEventListener("DOMMouseScroll", scrollEventHandler, false);
259  win.addEventListener("wheel", scrollEventHandler, false);
260  }
261 }
262 
263 - (void)_resizeWebFrame
264 {
265  // When a webview is not in the DOM we can't inspect its contents for sizing information.
266  // If we try, we might end up setting the fallback frame size which will then become
267  // somewhat sticky.
268  if (![self _isVisible])
269  {
270  return;
271  }
272 
273  if (_effectiveScrollMode === CPWebViewScrollAppKit)
274  {
275  var visibleRect = [_frameView visibleRect];
276  [_frameView setFrameSize:CGSizeMake(CGRectGetMaxX(visibleRect), CGRectGetMaxY(visibleRect))];
277 
278  // try to get the document size so we can correctly set the frame
279  var win = [self DOMWindow];
280 
281  if (win && win.document && win.document.body)
282  {
283  var width = win.document.body.scrollWidth,
284  height = win.document.body.scrollHeight;
285 
286  _iframe.setAttribute("width", width);
287  _iframe.setAttribute("height", height);
288 
289  [_frameView setFrameSize:CGSizeMake(width, height)];
290  }
291  else
292  {
293  // If we do have access to the content, it might be that the 'body' element simply hasn't loaded yet.
294  // The size will be updated by the content size timer in this case.
295  if (!win || !win.document)
296  {
297  CPLog.warn("using default size 800*1600");
298  [_frameView setFrameSize:CGSizeMake(800, 1600)];
299  }
300  }
301 
302  [_frameView scrollRectToVisible:visibleRect];
303  }
304 }
305 
317 - (void)setScrollMode:(int)aScrollMode
318 {
319  if (_scrollMode == aScrollMode)
320  return;
321 
322  _scrollMode = aScrollMode;
323 
324  [self _updateEffectiveScrollMode];
325 }
326 
336 - (int)effectiveScrollMode
337 {
338  return _effectiveScrollMode;
339 }
340 
341 - (void)_updateEffectiveScrollMode
342 {
343  var _newScrollMode = CPWebViewScrollAppKit;
344 
345  if (_scrollMode == CPWebViewScrollNative
346  || (_scrollMode == CPWebViewScrollAuto && !_contentIsAccessible)
348  {
349  _newScrollMode = CPWebViewScrollNative;
350  }
351  else if (_scrollMode == CPWebViewScrollAppKit && !_contentIsAccessible)
352  {
353  // Same behaviour as the previous case except that a warning is logged when AppKit
354  // scrollers can't be used.
355  CPLog.warn(self + " unable to use CPWebViewScrollAppKit scroll mode due to same origin policy.");
356  _newScrollMode = CPWebViewScrollNative;
357  }
358 
359  if (_newScrollMode !== _effectiveScrollMode)
360  [self _setEffectiveScrollMode:_newScrollMode];
361 }
362 
363 - (void)_setEffectiveScrollMode:(int)aScrollMode
364 {
365  _effectiveScrollMode = aScrollMode;
366 
367  _ignoreLoadStart = YES;
368  _ignoreLoadEnd = YES;
369 
370  var parent = _iframe.parentNode;
371  // FIXME "scrolling" can't be changed without readding the iframe. Unfortunately this causes a reload.
372  parent.removeChild(_iframe);
373 
374  if (_effectiveScrollMode === CPWebViewScrollAppKit)
375  {
376  [_scrollView setHasHorizontalScroller:YES];
377  [_scrollView setHasVerticalScroller:YES];
378 
379  _iframe.setAttribute("scrolling", "no");
380  }
381  else if (_effectiveScrollMode === CPWebViewScrollNone)
382  {
383  [_scrollView setHasHorizontalScroller:NO];
384  [_scrollView setHasVerticalScroller:NO];
385 
386  _iframe.setAttribute("scrolling", "no");
387  }
388  else
389  {
390  [_scrollView setHasHorizontalScroller:NO];
391  [_scrollView setHasVerticalScroller:NO];
392 
393  _iframe.setAttribute("scrolling", "auto");
394 
395  [_frameView setFrameSize:[_scrollView bounds].size];
396  }
397 
398  parent.appendChild(_iframe);
399  [self _applyBackgroundColor];
400 
401  [self _resizeWebFrame];
402 }
403 
404 - (void)_maybePollWebFrameSize
405 {
406  if (CPWebViewAppKitScrollMaxPollCount == 0 || _contentSizePollCount++ < CPWebViewAppKitScrollMaxPollCount)
407  [self _resizeWebFrame];
408  else
409  [_contentSizeCheckTimer invalidate];
410 }
411 
417 - (void)loadHTMLString:(CPString)aString
418 {
419  [self loadHTMLString:aString baseURL:nil];
420 }
421 
428 - (void)loadHTMLString:(CPString)aString baseURL:(CPURL)URL
429 {
430  // FIXME: do something with baseURL?
431  [_frameView setFrameSize:[_scrollView contentSize]];
432 
433  [self _startedLoading];
434 
435  _ignoreLoadStart = YES;
436 
437  _url = nil;
438  _html = aString;
439 
440  [self _load];
441 }
442 
443 - (void)_loadMainFrameURL
444 {
445  [self _startedLoading];
446 
447  _ignoreLoadStart = YES;
448 
449  _url = _mainFrameURL;
450  _html = nil;
451 
452  [self _load];
453 }
454 
455 - (void)_load
456 {
457  if (_url)
458  {
459  // Try to figure out if this URL will pass the same origin policy and hence allow us to potentially
460  // use appkit scrollbars.
461  var cpurl = [CPURL URLWithString:_url];
462  _contentIsAccessible = [cpurl _passesSameOriginPolicy];
463  [self _updateEffectiveScrollMode];
464 
465  _ignoreLoadEnd = NO;
466 
467  _iframe.src = _url;
468  }
469  else if (_html !== nil)
470  {
471  // clear the iframe
472  _iframe.src = "";
473 
474  _contentIsAccessible = YES;
475  [self _updateEffectiveScrollMode];
476 
477  _ignoreLoadEnd = NO;
478 
479  if (_loadHTMLStringTimer !== nil)
480  {
481  window.clearTimeout(_loadHTMLStringTimer);
482  _loadHTMLStringTimer = nil;
483  }
484 
485  // need to give the browser a chance to reset iframe, otherwise we'll be document.write()-ing the previous document
486  _loadHTMLStringTimer = window.setTimeout(function()
487  {
488  var win = [self DOMWindow];
489 
490  /*
491  If _html is the empty string, subtitute in an empty HTML structure. Just leaving the contents entirely empty prompts the browser to subtitute in a white page which would interfere with any custom background colours in use by this web view.
492  */
493  if (win)
494  win.document.write(_html || "<html><body></body></html>");
495 
496  window.setTimeout(_loadCallback, 1);
497  }, 0);
498  }
499 }
500 
501 - (void)_startedLoading
502 {
503  _isLoading = YES;
504 
505  [[CPNotificationCenter defaultCenter] postNotificationName:CPWebViewProgressStartedNotification object:self];
506 
507  if ([_frameLoadDelegate respondsToSelector:@selector(webView:didStartProvisionalLoadForFrame:)])
508  [_frameLoadDelegate webView:self didStartProvisionalLoadForFrame:nil]; // FIXME: give this a frame somehow?
509 }
510 
511 - (void)_finishedLoading
512 {
513  _isLoading = NO;
514 
515  [self _resizeWebFrame];
516  [self _attachScrollEventIfNecessary];
517 
518  [self _scheduleContentSizeCheck];
519 
520  [[CPNotificationCenter defaultCenter] postNotificationName:CPWebViewProgressFinishedNotification object:self];
521 
522  if ([_frameLoadDelegate respondsToSelector:@selector(webView:didFinishLoadForFrame:)])
523  [_frameLoadDelegate webView:self didFinishLoadForFrame:nil]; // FIXME: give this a frame somehow?
524 }
525 
526 - (void)_scheduleContentSizeCheck
527 {
528  [_contentSizeCheckTimer invalidate];
529  if (_effectiveScrollMode == CPWebViewScrollAppKit)
530  {
531  /*
532  FIXME Need better method.
533  We don't know when the content of the iframe changes size (e.g. a
534  picture finishes loading, dynamic content is loaded). Often when a
535  page has initially 'loaded', it does not yet have its final size. In
536  lieu of any resize events we will simply check back in a few times
537  some time after loading.
538 
539  We run these checks only a limited number of times as to not deplete
540  battery life and slow down the software needlessly. This does mean
541  there are situations where the content changes size and the AppKit
542  scrollbars will be out of sync. Users who have dynamic content
543  in their web view will, for now, have to implement domain specific
544  fixes.
545  */
546 
547  _contentSizePollCount = 0;
548  _contentSizeCheckTimer = [CPTimer scheduledTimerWithTimeInterval:CPWebViewAppKitScrollPollInterval target:self selector:@selector(_maybePollWebFrameSize) userInfo:nil repeats:YES];
549  }
550 }
551 
556 - (BOOL)isLoading
557 {
558  return _isLoading;
559 }
560 
566 - (CPString)mainFrameURL
567 {
568  return _mainFrameURL;
569 }
570 
576 - (void)setMainFrameURL:(CPString)URLString
577 {
578  if (_mainFrameURL)
579  [_backwardStack addObject:_mainFrameURL];
580 
581  _mainFrameURL = URLString;
582  [_forwardStack removeAllObjects];
583 
584  [self _loadMainFrameURL];
585 }
586 
592 - (BOOL)goBack
593 {
594  if (_backwardStack.length > 0)
595  {
596  if (_mainFrameURL)
597  [_forwardStack addObject:_mainFrameURL];
598 
599  _mainFrameURL = [_backwardStack lastObject];
600  [_backwardStack removeLastObject];
601 
602  [self _loadMainFrameURL];
603 
604  return YES;
605  }
606 
607  return NO;
608 }
609 
615 - (BOOL)goForward
616 {
617  if (_forwardStack.length > 0)
618  {
619  if (_mainFrameURL)
620  [_backwardStack addObject:_mainFrameURL];
621 
622  _mainFrameURL = [_forwardStack lastObject];
623  [_forwardStack removeLastObject];
624 
625  [self _loadMainFrameURL];
626 
627  return YES;
628  }
629 
630  return NO;
631 }
632 
639 - (BOOL)canGoBack
640 {
641  return (_backwardStack.length > 0);
642 }
643 
650 - (BOOL)canGoForward
651 {
652  return (_forwardStack.length > 0);
653 }
654 
655 - (WebBackForwardList)backForwardList
656 {
657  // FIXME: return a real WebBackForwardList?
658  return { back: _backwardStack, forward: _forwardStack };
659 }
660 
665 - (void)close
666 {
667  _iframe.parentNode.removeChild(_iframe);
668 }
669 
675 - (DOMWindow)DOMWindow
676 {
677  try
678  {
679  return (_iframe.contentDocument && _iframe.contentDocument.defaultView) || _iframe.contentWindow;
680  }
681  catch (e)
682  {
683  return nil;
684  }
685 }
686 
692 - (CPWebScriptObject)windowScriptObject
693 {
694  var win = [self DOMWindow];
695 
696  if (!_wso || win != [_wso window])
697  {
698  if (win)
699  _wso = [[CPWebScriptObject alloc] initWithWindow:win];
700  else
701  _wso = nil;
702  }
703 
704  return _wso;
705 }
706 
714 - (CPString)stringByEvaluatingJavaScriptFromString:(CPString)script
715 {
716  var result = [self objectByEvaluatingJavaScriptFromString:script];
717  return result ? String(result) : nil;
718 }
719 
726 - (JSObject)objectByEvaluatingJavaScriptFromString:(CPString)script
727 {
728  return [[self windowScriptObject] evaluateWebScript:script];
729 }
730 
738 - (DOMCSSStyleDeclaration)computedStyleForElement:(DOMElement)element pseudoElement:(CPString)pseudoElement
739 {
740  var win = [[self windowScriptObject] window];
741 
742  if (win)
743  {
744  // FIXME: IE version?
745  return win.document.defaultView.getComputedStyle(element, pseudoElement);
746  }
747  return nil;
748 }
749 
750 
754 - (BOOL)drawsBackground
755 {
756  return _drawsBackground;
757 }
758 
770 - (void)setDrawsBackground:(BOOL)drawsBackground
771 {
772  if (drawsBackground == _drawsBackground)
773  return;
774 
775  _drawsBackground = drawsBackground;
776 
777  [self _applyBackgroundColor];
778 }
779 
780 - (void)setBackgroundColor:(CPColor)aColor
781 {
782  [super setBackgroundColor:aColor];
783  [self _applyBackgroundColor];
784 }
785 
786 - (void)_applyBackgroundColor
787 {
788  if (_iframe)
789  {
790  var bgColor = [self backgroundColor] || [CPColor whiteColor];
791  _iframe.allowtransparency = !_drawsBackground;
792  _iframe.style.backgroundColor = _drawsBackground ? [bgColor cssString] : "transparent";
793  }
794 }
795 
796 // IBActions
797 
804 - (@action)takeStringURLFrom:(id)sender
805 {
806  [self setMainFrameURL:[sender stringValue]];
807 }
808 
814 - (@action)goBack:(id)sender
815 {
816  [self goBack];
817 }
818 
824 - (@action)goForward:(id)sender
825 {
826  [self goForward];
827 }
828 
834 - (@action)stopLoading:(id)sender
835 {
836  // FIXME: what to do?
837 }
838 
844 - (@action)reload:(id)sender
845 {
846  // If we're displaying pure HTML, redisplay it.
847  if (!_url && (_html !== nil))
848  [self loadHTMLString:_html];
849  else
850  [self _loadMainFrameURL];
851 }
852 
859 - (@action)print:(id)sender
860 {
861  try
862  {
863  [self DOMWindow].print();
864  }
865  catch (e)
866  {
867  alert('Please click the webpage and select "Print" from the "File" menu');
868  }
869 }
870 
871 
872 // Delegates:
873 
874 // FIXME: implement more delegates, though most of these will likely never work with the iframe implementation
875 
876 - (id)downloadDelegate
877 {
878  return _downloadDelegate;
879 }
880 
881 - (void)setDownloadDelegate:(id)anObject
882 {
883  _downloadDelegate = anObject;
884 }
885 
886 - (id)frameLoadDelegate
887 {
888  return _frameLoadDelegate;
889 }
890 
891 - (void)setFrameLoadDelegate:(id)anObject
892 {
893  _frameLoadDelegate = anObject;
894 }
895 
896 - (id)policyDelegate
897 {
898  return _policyDelegate;
899 }
900 
901 - (void)setPolicyDelegate:(id)anObject
902 {
903  _policyDelegate = anObject;
904 }
905 
906 - (id)resourceLoadDelegate
907 {
908  return _resourceLoadDelegate;
909 }
910 
911 - (void)setResourceLoadDelegate:(id)anObject
912 {
913  _resourceLoadDelegate = anObject;
914 }
915 
916 - (id)UIDelegate
917 {
918  return _UIDelegate;
919 }
920 
921 - (void)setUIDelegate:(id)anObject
922 {
923  _UIDelegate = anObject;
924 }
925 
926 @end
927 
932 @implementation CPWebScriptObject : CPObject
933 {
934  Window _window;
935 }
936 
940 - (id)initWithWindow:(Window)aWindow
941 {
942  if (self = [super init])
943  {
944  _window = aWindow;
945  }
946 
947  return self;
948 }
949 
956 - (id)callWebScriptMethod:(CPString)methodName withArguments:(CPArray)args
957 {
958  // Would using "with" be better here?
959  if (typeof _window[methodName] == "function")
960  {
961  try
962  {
963  return _window[methodName].apply(_window, args);
964  }
965  catch (e)
966  {
967  }
968  }
969  return undefined;
970 }
971 
978 - (id)evaluateWebScript:(CPString)script
979 {
980  try
981  {
982  return _window.eval(script);
983  }
984  catch (e)
985  {
986  // FIX ME: if we fail inside here, shouldn't we return an exception?
987  }
988 
989  return undefined;
990 }
991 
995 - (Window)window
996 {
997  return _window;
998 }
999 
1000 @end
1001 
1002 
1003 @implementation CPWebView (CPCoding)
1004 
1011 - (id)initWithCoder:(CPCoder)aCoder
1012 {
1013  self = [super initWithCoder:aCoder];
1014 
1015  if (self)
1016  {
1017  // FIXME: encode/decode these?
1018  _mainFrameURL = nil;
1019  _backwardStack = [];
1020  _forwardStack = [];
1021  _scrollMode = CPWebViewScrollAuto;
1022 
1023 #if PLATFORM(DOM)
1024  [self _initDOMWithFrame:[self frame]];
1025 #endif
1026 
1027  if (![self backgroundColor])
1029 
1030  [self _updateEffectiveScrollMode];
1031  }
1032 
1033  return self;
1034 }
1035 
1041 - (void)encodeWithCoder:(CPCoder)aCoder
1042 {
1043  var actualSubviews = _subviews;
1044  _subviews = [];
1045  [super encodeWithCoder:aCoder];
1046  _subviews = actualSubviews;
1047 }
1048 
1049 @end
1050 
1051 @implementation CPURL(SOP)
1052 
1060 - (BOOL)_passesSameOriginPolicy
1061 {
1062  var documentURL = [CPURL URLWithString:window.location.href];
1063 
1064  if ([documentURL isFileURL] && CPFeatureIsCompatible(CPSOPDisabledFromFileURLs))
1065  return YES;
1066 
1067  // Relative URLs always pass the SOP.
1068  if (![self scheme] && ![self host] && ![self port])
1069  return YES;
1070 
1071  return ([documentURL scheme] == [self scheme] && [documentURL host] == [self host] && [documentURL port] == [self port]);
1072 }
1073 
1074 @end
CPWebViewAppKitScrollPollInterval
Definition: CPWebView.j:65
CPWebViewScrollNone
Definition: CPWebView.j:59
id init()
Definition: CALayer.j:126
id initWithCoder:(CPCoder aCoder)
Definition: CPView.j:3696
The main run loop for the application.
Definition: CPRunLoop.h:2
void loadHTMLString:(CPString aString)
Definition: CPWebView.j:417
CPColor whiteColor()
Definition: CPColor.j:361
int width
void postNotificationName:object:(CPString aNotificationName, [object] id anObject)
DOMWindow DOMWindow()
Definition: CPWebView.j:675
CPNotificationCenter defaultCenter()
CPWebViewScrollNative
Definition: CPWebView.j:55
void setMainFrameURL:(CPString URLString)
Definition: CPWebView.j:576
CPRunLoop currentRunLoop()
Definition: CPRunLoop.j:232
void loadHTMLString:baseURL:(CPString aString, [baseURL] CPURL URL)
Definition: CPWebView.j:428
An immutable string (collection of characters).
Definition: CPString.h:2
CPWebViewProgressFinishedNotification
Definition: CPWebView.j:37
CPInternetExplorerBrowserEngine
function CPFeatureIsCompatible(aFeature)
Window CPWebViewProgressStartedNotification
Definition: CPWebView.j:36
JSObject objectByEvaluatingJavaScriptFromString:(CPString script)
Definition: CPWebView.j:726
void encodeWithCoder:(CPCoder aCoder)
Definition: CPView.j:3806
CPColor backgroundColor()
Definition: CALayer.j:629
CPTimer scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:(CPTimeInterval seconds, [target] id aTarget, [selector] SEL aSelector, [userInfo] id userInfo, [repeats] BOOL shouldRepeat)
Definition: CPTimer.j:58
CPDate limitDateForMode:(CPString aMode)
Definition: CPRunLoop.j:342
id evaluateWebScript:(CPString script)
Definition: CPWebView.j:978
void setBackgroundColor:(CPColor aColor)
Definition: CPWebView.j:780
BOOL goBack()
Definition: CPWebView.j:592
A timer object that can send a message after the given time interval.
Definition: CPTimer.h:2
Defines methods for use when archiving & restoring (enc/decoding).
Definition: CPCoder.h:2
CPWebViewAppKitScrollMaxPollCount
Definition: CPWebView.j:75
Sends messages (CPNotification) between objects.
void setBackgroundColor:(CPColor aColor)
Definition: CPView.j:1947
void setFrameSize:(CGSize aSize)
Definition: CPView.j:1124
CPWebScriptObject windowScriptObject()
Definition: CPWebView.j:692
function CPBrowserIsEngine(anEngine)
CGRect frame()
Definition: CPView.j:1046
id URLWithString:(CPString URLString)
Definition: CPURL.j:78
CPSOPDisabledFromFileURLs
BOOL goForward()
Definition: CPWebView.j:615
Definition: CPURL.h:2
CPWebViewScrollAuto
Definition: CPWebView.j:45
CPWebViewScrollAppKit
Definition: CPWebView.j:51
id alloc()
Definition: CPObject.j:130
Definition: CPView.j:137