<rdar://problem/
5410937> HIWebView in SimpleCarbonWeb doesn't seem to be getting adequate invalidation when window is resized
This is a more localized fix for yesterday's change. Now explicitly call _web_layoutIfNeededRecursive inside the
HIWebView Draw() function. Adds a FIXME to explain that we need to do layout before Carbon has decided what regions to draw.
Doing layout in Draw() will potentially cause drawing to happen in two passes, but this has always been a problem in Carbon.
* Carbon/HIWebView.m:
(Draw): Call _web_layoutIfNeededRecursive on the main WebHTMLView.
(SetFocusPart): Fix to work in ObjC++ (now that HIWebView.m is treated as a ObjC++ file.)
* WebView/WebView.mm: Removes the 4 displayIfNeeded methods from yesterday's change.
* WebKit.xcodeproj/project.pbxproj: Force the file type of HIWebView.m to ObjC++ so WebHTMLViewInternal.h can be included.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25217
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
#ifndef __LP64__
-#include "HIWebView.h"
+#import "HIWebView.h"
-#include "CarbonWindowAdapter.h"
-
-#include <WebKit/WebKit.h>
-#include "HIViewAdapter.h"
-#include <WebKitSystemInterface.h>
+#import "CarbonWindowAdapter.h"
+#import "HIViewAdapter.h"
+#import "WebHTMLViewInternal.h"
+#import "WebKit.h"
#import <objc/objc-runtime.h>
+#import <WebKitSystemInterface.h>
@interface NSWindow (AppKitSecretsHIWebViewKnows)
- (void)_removeWindowRef;
- (void)_clearDirtyRectsForTree;
@end
+extern "C" void HIWebViewRegisterClass();
+
@interface MenuItemProxy : NSObject <NSValidatedUserInterfaceItem>
{
int _tag;
static HIWebView* HIWebViewConstructor( HIViewRef inView );
static void HIWebViewDestructor( HIWebView* view );
-void HIWebViewRegisterClass( void );
static OSStatus HIWebViewEventHandler(
EventHandlerCallRef inCallRef,
// printf( "Drawing: drawRect is (%g %g) (%g %g)\n", hiRect.origin.x, hiRect.origin.y,
// hiRect.size.width, hiRect.size.height );
+ // FIXME: We need to do layout before Carbon has decided what region needs drawn.
+ // In Cocoa we make sure to do layout and invalidate any new regions before draw, so everything
+ // can be drawn in one pass. Doing a layout here will cause new regions to be invalidated, but they
+ // will not all be drawn in this pass since we already have a fixed rect we are going to display.
+
+ NSView <WebDocumentView> *documentView = [[[inView->fWebView mainFrame] frameView] documentView];
+ if ([documentView isKindOfClass:[WebHTMLView class]])
+ [(WebHTMLView *)documentView _web_layoutIfNeededRecursive];
+
if ( inView->fIsComposited )
[inView->fWebView displayIfNeededInRect: *(NSRect*)&hiRect];
else
// Advance the keyboard focus, maybe right off of this view. Maybe a subview of this one already has the keyboard focus, maybe not.
freshlyMadeFirstResponderView = AdvanceFocus( view, goForward );
- partCodeToReturn = freshlyMadeFirstResponderView ? desiredFocus : kControlFocusNoPart;
+ if (freshlyMadeFirstResponderView)
+ partCodeToReturn = desiredFocus;
+ else
+ partCodeToReturn = kControlFocusNoPart;
//NSLog(freshlyMadeFirstResponderView ? @"Advanced the key focus." : @"Relinquished the key focus.");
}
else
+2007-08-24 Timothy Hatcher <timothy@apple.com>
+
+ Reviewed by John Sullivan.
+
+ <rdar://problem/5410937> HIWebView in SimpleCarbonWeb doesn't seem to be getting adequate invalidation when window is resized
+
+ This is a more localized fix for yesterday's change. Now explicitly call _web_layoutIfNeededRecursive inside the
+ HIWebView Draw() function. Adds a FIXME to explain that we need to do layout before Carbon has decided what regions to draw.
+ Doing layout in Draw() will potentially cause drawing to happen in two passes, but this has always been a problem in Carbon.
+
+ * Carbon/HIWebView.m:
+ (Draw): Call _web_layoutIfNeededRecursive on the main WebHTMLView.
+ (SetFocusPart): Fix to work in ObjC++ (now that HIWebView.m is treated as a ObjC++ file.)
+ * WebView/WebView.mm: Removes the 4 displayIfNeeded methods from yesterday's change.
+ * WebKit.xcodeproj/project.pbxproj: Force the file type of HIWebView.m to ObjC++ so WebHTMLViewInternal.h can be included.
+
2007-08-23 Timothy Hatcher <timothy@apple.com>
Reviewed by Dave Hyatt.
F7EBEE9A03F9DBA103CA0DE6 /* HIViewAdapter.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HIViewAdapter.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F7EBEE9B03F9DBA103CA0DE6 /* HIViewAdapter.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = HIViewAdapter.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F7EBEEAA03F9DBA103CA0DE6 /* HIWebView.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HIWebView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- F7EBEEAB03F9DBA103CA0DE6 /* HIWebView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = HIWebView.m; sourceTree = "<group>"; usesTabs = 0; };
+ F7EBEEAB03F9DBA103CA0DE6 /* HIWebView.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = HIWebView.m; sourceTree = "<group>"; usesTabs = 0; };
F8CA15B5029A39D901000122 /* WebAuthenticationPanel.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebAuthenticationPanel.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F8CA15B6029A39D901000122 /* WebAuthenticationPanel.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebAuthenticationPanel.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
/* End PBXFileReference section */
[self _close];
}
-- (void)displayIfNeeded
-{
- NSView <WebDocumentView> *documentView = [[[self mainFrame] frameView] documentView];
- if ([documentView isKindOfClass:[WebHTMLView class]])
- [(WebHTMLView *)documentView _web_layoutIfNeededRecursive];
- [super displayIfNeeded];
-}
-
-- (void)displayIfNeededIgnoringOpacity
-{
- NSView <WebDocumentView> *documentView = [[[self mainFrame] frameView] documentView];
- if ([documentView isKindOfClass:[WebHTMLView class]])
- [(WebHTMLView *)documentView _web_layoutIfNeededRecursive];
- [super displayIfNeededIgnoringOpacity];
-}
-
-- (void)displayIfNeededInRect:(NSRect) rect
-{
- NSView <WebDocumentView> *documentView = [[[self mainFrame] frameView] documentView];
- if ([documentView isKindOfClass:[WebHTMLView class]])
- [(WebHTMLView *)documentView _web_layoutIfNeededRecursive];
- [super displayIfNeededInRect:rect];
-}
-
-- (void)displayIfNeededInRectIgnoringOpacity:(NSRect) rect
-{
- NSView <WebDocumentView> *documentView = [[[self mainFrame] frameView] documentView];
- if ([documentView isKindOfClass:[WebHTMLView class]])
- [(WebHTMLView *)documentView _web_layoutIfNeededRecursive];
- [super displayIfNeededInRectIgnoringOpacity:rect];
-}
-
- (void)setShouldCloseWithWindow:(BOOL)close
{
_private->shouldCloseWithWindow = close;