Changeset 18997 in webkit


Ignore:
Timestamp:
Jan 19, 2007 7:21:32 PM (17 years ago)
Author:
kdecker
Message:

Reviewed by Adam.


Merged r10259 and r15845 from TOT to Safari-2-0-branch.

2006-08-11 Tim Omernick <timo@apple.com>

Reviewed by Darin.

<http://bugzilla.opendarwin.org/show_bug.cgi?id=10111> - Menu flickers over Flash content
<rdar://problem/3052546> Plugins don't work with z-index (overlapping elements, etc.)

  • Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): Don't just clip to the dirty region for "transparent" plug-ins -- do it for all plug-ins. This is a generally useful thing to do, as it prevents the plug-in from drawing over parts of the window that have already been drawn and are not expected to be redrawn in the same update.

2005-09-13 Tim Omernick <tomernick@apple.com>

Reviewed by Justin Garcia, Darin Adler.

  • <rdar://problem/3163393> Safari does not support Windowless mode in Flash
  • Plugins.subproj/WebBaseNetscapePluginView.h:

Added 'isTransparent' instance variable.

  • Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView saveAndSetPortStateForUpdate:]):

When updating a plugin in "windowless" (transparent) mode, clip drawing to the dirty
region of the opaque ancestor. This means that a partially-transparent plugin, which
by definition does not clear its port on redraw, will not overdraw the valid parts
of its port.

(-[WebBaseNetscapePluginView sendEvent:]):

Disabled the "green debug background" for transparent plugins -- since they are not
expected to cover their entire port every redraw, this debug code makes no sense.

(-[WebBaseNetscapePluginView setVariable:value:]):

Implemented -setVariable:value:, which is called from NPN_SetValue() (previously
unimplemented).
Right now we only handle NPPVpluginTransparentBool; if we choose to handle the other
plugin variables, then we may do so here.

  • Plugins.subproj/WebBaseNetscapePluginViewPrivate.h:

Added SPI for -[WebBaseNetscapePluginView setVariable:value].

  • Plugins.subproj/npapi.m: (NPN_SetValue):

Implemented this function so that plugins may set state (such as window mode).


Location:
branches/Safari-2-0-branch/WebKit
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/Safari-2-0-branch/WebKit/ChangeLog

    r18929 r18997  
     12007-01-09  Kevin Decker  <kdecker@apple.com>
     2
     3       Reviewed by Adam.
     4       
     5       Merged r10259 and r15845 from TOT to Safari-2-0-branch.
     6
     7    2006-08-11  Tim Omernick  <timo@apple.com>
     8
     9            Reviewed by Darin.
     10
     11            <http://bugzilla.opendarwin.org/show_bug.cgi?id=10111> - Menu flickers over Flash content
     12            <rdar://problem/3052546> Plugins don't work with z-index (overlapping elements, etc.)
     13
     14            * Plugins/WebBaseNetscapePluginView.m:
     15            (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]):
     16            Don't just clip to the dirty region for "transparent" plug-ins -- do it for all plug-ins.  This is a
     17            generally useful thing to do, as it prevents the plug-in from drawing over parts of the window that
     18            have already been drawn and are not expected to be redrawn in the same update.
     19
     20    2005-09-13  Tim Omernick  <tomernick@apple.com>
     21
     22            Reviewed by Justin Garcia, Darin Adler.
     23
     24        - <rdar://problem/3163393> Safari does not support Windowless mode in Flash
     25
     26            * Plugins.subproj/WebBaseNetscapePluginView.h:
     27        Added 'isTransparent' instance variable.
     28
     29            * Plugins.subproj/WebBaseNetscapePluginView.m:     
     30            (-[WebBaseNetscapePluginView saveAndSetPortStateForUpdate:]):
     31        When updating a plugin in "windowless" (transparent) mode, clip drawing to the dirty
     32        region of the opaque ancestor.  This means that a partially-transparent plugin, which
     33        by definition does not clear its port on redraw, will not overdraw the valid parts
     34        of its port.
     35            (-[WebBaseNetscapePluginView sendEvent:]):
     36        Disabled the "green debug background" for transparent plugins -- since they are not
     37        expected to cover their entire port every redraw, this debug code makes no sense.
     38            (-[WebBaseNetscapePluginView setVariable:value:]):
     39        Implemented -setVariable:value:, which is called from NPN_SetValue() (previously
     40        unimplemented).
     41        Right now we only handle NPPVpluginTransparentBool; if we choose to handle the other
     42        plugin variables, then we may do so here.
     43            * Plugins.subproj/WebBaseNetscapePluginViewPrivate.h:
     44        Added SPI for -[WebBaseNetscapePluginView setVariable:value].
     45            * Plugins.subproj/npapi.m:
     46            (NPN_SetValue):
     47        Implemented this function so that plugins may set state (such as window mode).
     48       
    1492007-01-18  Mark Rowe  <mrowe@apple.com>
    250
     
    99049952       
    99059953        Work on text-align API. Marked these bugs fixed:
    9906         <rdar://problem/3655380>: (Editing:Ê-alignCenter:ÊmethodÊunimplementedÊ(WebKitÊeditingÊAPI))
    9907         <rdar://problem/3655381>: (Editing:Ê-alignJustified:ÊmethodÊunimplementedÊ(WebKitÊeditingÊAPI))
    9908         <rdar://problem/3655383>: (Editing:Ê-alignLeft:ÊmethodÊunimplementedÊ(WebKitÊeditingÊAPI))
    9909         <rdar://problem/3655384>: (Editing:Ê-alignRight:ÊmethodÊunimplementedÊ(WebKitÊeditingÊAPI))       
     9954        <rdar://problem/3655380>: (Editing: -alignCenter: method unimplemented (WebKit editing API))
     9955        <rdar://problem/3655381>: (Editing: -alignJustified: method unimplemented (WebKit editing API))
     9956        <rdar://problem/3655383>: (Editing: -alignLeft: method unimplemented (WebKit editing API))
     9957        <rdar://problem/3655384>: (Editing: -alignRight: method unimplemented (WebKit editing API))       
    99109958       
    99119959        in favor of opening this bug:
     
    99349982        Reviewed by Ken.
    99359983       
    9936         - fixed <rdar://problem/3655378>: (Editing:Ê-changeDocumentBackgroundColor:Ê
    9937         methodÊunimplementedÊ(WebKitÊeditingÊAPI))
     9984        - fixed <rdar://problem/3655378>: (Editing: -changeDocumentBackgroundColor: 
     9985        method unimplemented (WebKit editing API))
    99389986        - made startSpeaking: actually work; previous implementation raised a DOMException
    99399987
  • branches/Safari-2-0-branch/WebKit/Plugins.subproj/WebBaseNetscapePluginView.h

    r8639 r18997  
    11/*
    22        WebBaseNetscapePluginView.h
    3         Copyright 2002, Apple, Inc. All rights reserved.
     3    Copyright 2002, Apple, Inc. All rights reserved.
    44*/
    55
     
    3737    BOOL hasFocus;
    3838    BOOL currentEventIsUserGesture;
    39 
     39    BOOL isTransparent;
     40   
    4041    int32 specifiedHeight;
    4142    int32 specifiedWidth;
  • branches/Safari-2-0-branch/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m

    r14154 r18997  
    297297        window.clipRect.right + nPort.portx, window.clipRect.bottom + nPort.porty);
    298298   
     299    // Clip to dirty region so plug-in does not draw over already-drawn regions of the window that are
     300    // not going to be redrawn this update.  This forces plug-ins to play nice with z-index ordering.
     301    if (forUpdate) {
     302        RgnHandle viewClipRegion = NewRgn();
     303       
     304        // Get list of dirty rects from the opaque ancestor -- WebKit does some tricks with invalidation and
     305        // display to enable z-ordering for NSViews; a side-effect of this is that only the WebHTMLView
     306        // knows about the true set of dirty rects.
     307        NSView *opaqueAncestor = [self opaqueAncestor];
     308        const NSRect *dirtyRects;
     309        int dirtyRectCount, dirtyRectIndex;
     310        [opaqueAncestor getRectsBeingDrawn:&dirtyRects count:&dirtyRectCount];
     311
     312        for (dirtyRectIndex = 0; dirtyRectIndex < dirtyRectCount; dirtyRectIndex++) {
     313            NSRect dirtyRect = [self convertRect:dirtyRects[dirtyRectIndex] fromView:opaqueAncestor];
     314            if (!NSEqualSizes(dirtyRect.size, NSZeroSize)) {
     315                // Create a region for this dirty rect
     316                RgnHandle dirtyRectRegion = NewRgn();
     317                SetRectRgn(dirtyRectRegion, NSMinX(dirtyRect), NSMinY(dirtyRect), NSMaxX(dirtyRect), NSMaxY(dirtyRect));
     318               
     319                // Union this dirty rect with the rest of the dirty rects
     320                UnionRgn(viewClipRegion, dirtyRectRegion, viewClipRegion);
     321                DisposeRgn(dirtyRectRegion);
     322            }
     323        }
     324   
     325        // Intersect the dirty region with the clip region, so that we only draw over dirty parts
     326        SectRgn(clipRegion, viewClipRegion, clipRegion);
     327        DisposeRgn(viewClipRegion);
     328    }
     329   
    299330    portState.forUpdate = forUpdate;
    300331   
     
    395426    // Draw green to help debug.
    396427    // If we see any green we know something's wrong.
    397     if (event->what == updateEvt) {
     428    if (!isTransparent && event->what == updateEvt) {
    398429        ForeColor(greenColor);
    399430        const Rect bigRect = { -10000, -10000, 10000, 10000 };
     
    17801811}
    17811812
     1813- (NPError)setVariable:(NPPVariable)variable value:(void *)value
     1814{
     1815    switch (variable) {
     1816        case NPPVpluginTransparentBool:
     1817        {
     1818            BOOL newTransparent = (value != 0);
     1819           
     1820            // Redisplay if transparency is changing
     1821            if (isTransparent != newTransparent)
     1822                [self setNeedsDisplay:YES];
     1823           
     1824            isTransparent = newTransparent;
     1825           
     1826            return NPERR_NO_ERROR;
     1827        }
     1828       
     1829        default:
     1830            return NPERR_GENERIC_ERROR;
     1831    }
     1832}
     1833
    17821834@end
    17831835
  • branches/Safari-2-0-branch/WebKit/Plugins.subproj/WebBaseNetscapePluginViewPrivate.h

    r7755 r18997  
    11/*
    22        WebBaseNetscapePluginView.h
    3         Copyright 2002, Apple, Inc. All rights reserved.
     3    Copyright 2002, Apple, Inc. All rights reserved.
    44*/
    55
     
    2424- (void)forceRedraw;
    2525- (NPError)getVariable:(NPNVariable)variable value:(void *)value;
     26- (NPError)setVariable:(NPPVariable)variable value:(void *)value;
    2627@end
  • branches/Safari-2-0-branch/WebKit/Plugins.subproj/npapi.m

    r8157 r18997  
    11/*
    22        npapi.m
    3         Copyright (c) 2002, Apple, Inc. All rights reserved.
     3    Copyright (c) 2002, Apple, Inc. All rights reserved.
    44*/
    55
     
    8181}
    8282
    83 SInt32  NPN_Write(NPP instance, NPStream* stream, SInt32 len, void* buffer)
     83SInt32    NPN_Write(NPP instance, NPStream* stream, SInt32 len, void* buffer)
    8484{
    8585    return [pluginViewForInstance(instance) write:stream len:len buffer:buffer];
     
    121121}
    122122
    123 // Unsupported functions
    124123NPError NPN_SetValue(NPP instance, NPPVariable variable, void *value)
    125124{
    126     LOG(Plugins, "NPN_SetValue");
    127     return NPERR_GENERIC_ERROR;
    128 }       
     125    return [pluginViewForInstance(instance) setVariable:variable value:value];
     126}
     127
     128// Unsupported functions
    129129
    130130void* NPN_GetJavaEnv(void)
  • branches/Safari-2-0-branch/WebKit/WebKit.xcodeproj/project.pbxproj

    r18929 r18997  
    302302                DD9CC6C609FECEC600F1FCA3 /* WebPluginPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = DD9CC6C509FECEC600F1FCA3 /* WebPluginPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
    303303/* End PBXBuildFile section */
     304
     305/* Begin PBXBuildStyle section */
     306                0A4EC8CC0B61B19D005921FA /* Development */ = {
     307                        isa = PBXBuildStyle;
     308                        buildSettings = {
     309                                COPY_PHASE_STRIP = NO;
     310                        };
     311                        name = Development;
     312                };
     313                0A4EC8CD0B61B19D005921FA /* Deployment */ = {
     314                        isa = PBXBuildStyle;
     315                        buildSettings = {
     316                                COPY_PHASE_STRIP = YES;
     317                        };
     318                        name = Deployment;
     319                };
     320/* End PBXBuildStyle section */
    304321
    305322/* Begin PBXFileReference section */
     
    13531370                        isa = PBXProject;
    13541371                        buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */;
     1372                        buildSettings = {
     1373                        };
     1374                        buildStyles = (
     1375                                0A4EC8CC0B61B19D005921FA /* Development */,
     1376                                0A4EC8CD0B61B19D005921FA /* Deployment */,
     1377                        );
    13551378                        hasScannedForEncodings = 1;
    13561379                        knownRegions = (
Note: See TracChangeset for help on using the changeset viewer.