WebCore:
authorrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Sep 2004 20:57:48 +0000 (20:57 +0000)
committerrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Sep 2004 20:57:48 +0000 (20:57 +0000)
More dashboard region changes for John.

        <rdar://problem/3817421> add getter for dashboard regions (debugging)

        <rdar://problem/3817417> NSScrollView need autoregions for dashboard

        <rdar://problem/3817388> should have short form form control regions

        <rdar://problem/3817477> visibility does not work with dashboard control regions

        Reviewed by Hyatt.

        * WebCore-combined.exp:
        * WebCore.exp:
        * khtml/css/cssparser.cpp:
        (skipCommaInDashboardRegion):
        (CSSParser::parseDashboardRegions):
        * khtml/khtmlview.cpp:
        (KHTMLView::updateDashboardRegions):
        * khtml/rendering/render_object.cpp:
        (RenderObject::setStyle):
        (RenderObject::addDashboardRegions):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::DocumentImpl):
        (DocumentImpl::setDashboardRegions):
        * khtml/xml/dom_docimpl.h:
        (DOM::DocumentImpl::setDashboardRegionsDirty):
        (DOM::DocumentImpl::dashboardRegionsDirty):
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::paint):
        (KWQKHTMLPart::dashboardRegionsDictionary):
        (KWQKHTMLPart::dashboardRegionsChanged):
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge dashboardRegions]):
        * kwq/WebDashboardRegion.h:
        * kwq/WebDashboardRegion.m:
        (-[WebDashboardRegion description]):

WebKit:
More dashboard region changes for John.

        <rdar://problem/3817421> add getter for dashboard regions (debugging)

        <rdar://problem/3817417> NSScrollView need autoregions for dashboard
Also KWQScrollBars

        Reviewed by Hyatt.

        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge dashboardRegionsChanged:]):
        * WebView.subproj/WebView.m:
        (-[WebView _setInitiatedDrag:]):
        (-[WebView _addScrollerDashboardRegions:from:]):
        (-[WebView _addScrollerDashboardRegions:]):
        (-[WebView _dashboardRegions]):
        * WebView.subproj/WebViewPrivate.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7712 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 files changed:
WebCore/ChangeLog-2005-08-23
WebCore/WebCore-combined.exp
WebCore/WebCore.exp
WebCore/khtml/css/cssparser.cpp
WebCore/khtml/khtmlview.cpp
WebCore/khtml/rendering/render_object.cpp
WebCore/khtml/xml/dom_docimpl.cpp
WebCore/khtml/xml/dom_docimpl.h
WebCore/kwq/KWQKHTMLPart.h
WebCore/kwq/KWQKHTMLPart.mm
WebCore/kwq/WebCoreBridge.h
WebCore/kwq/WebCoreBridge.mm
WebCore/kwq/WebDashboardRegion.h
WebCore/kwq/WebDashboardRegion.m
WebKit/ChangeLog
WebKit/WebCoreSupport.subproj/WebBridge.m
WebKit/WebView.subproj/WebView.m
WebKit/WebView.subproj/WebViewPrivate.h

index 0b5c1b5401d55d3a75752256aa31e8fd767c74dc..f13d96a8323917eeb2d79460420607bb3c88c53c 100644 (file)
@@ -1,3 +1,45 @@
+2004-09-28  Richard Williamson   <rjw@apple.com>
+
+       More dashboard region changes for John.
+
+        <rdar://problem/3817421> add getter for dashboard regions (debugging)
+        
+        <rdar://problem/3817417> NSScrollView need autoregions for dashboard
+        
+        <rdar://problem/3817388> should have short form form control regions
+        
+        <rdar://problem/3817477> visibility does not work with dashboard control regions
+
+        Reviewed by Hyatt.
+
+        * WebCore-combined.exp:
+        * WebCore.exp:
+        * khtml/css/cssparser.cpp:
+        (skipCommaInDashboardRegion):
+        (CSSParser::parseDashboardRegions):
+        * khtml/khtmlview.cpp:
+        (KHTMLView::updateDashboardRegions):
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::setStyle):
+        (RenderObject::addDashboardRegions):
+        * khtml/xml/dom_docimpl.cpp:
+        (DocumentImpl::DocumentImpl):
+        (DocumentImpl::setDashboardRegions):
+        * khtml/xml/dom_docimpl.h:
+        (DOM::DocumentImpl::setDashboardRegionsDirty):
+        (DOM::DocumentImpl::dashboardRegionsDirty):
+        * kwq/KWQKHTMLPart.h:
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::paint):
+        (KWQKHTMLPart::dashboardRegionsDictionary):
+        (KWQKHTMLPart::dashboardRegionsChanged):
+        * kwq/WebCoreBridge.h:
+        * kwq/WebCoreBridge.mm:
+        (-[WebCoreBridge dashboardRegions]):
+        * kwq/WebDashboardRegion.h:
+        * kwq/WebDashboardRegion.m:
+        (-[WebDashboardRegion description]):
+
 2004-09-28  John Sullivan  <sullivan@apple.com>
 
         Reviewed by Chris.
index 57bd3510b6b7c65b5497c6ec74f527a5a3e4abe5..4fbe20ad20663059cac13e633f07aa3531b16d2d 100644 (file)
@@ -87,6 +87,7 @@
 .objc_class_name_WebCoreSettings
 .objc_class_name_WebCoreTextRendererFactory
 .objc_class_name_WebCoreViewFactory
+.objc_class_name_WebDashboardRegion
 _WebCoreElementDOMNodeKey
 _WebCoreElementFrameKey
 _WebCoreElementImageAltStringKey
index 0a0e4c657566138751cece4c1e409b1902f53c12..ae03f57e0c6112399774cdfcdb955a4aa17bbdf1 100644 (file)
@@ -87,6 +87,7 @@
 .objc_class_name_WebCoreSettings
 .objc_class_name_WebCoreTextRendererFactory
 .objc_class_name_WebCoreViewFactory
+.objc_class_name_WebDashboardRegion
 _WebCoreElementDOMNodeKey
 _WebCoreElementFrameKey
 _WebCoreElementImageAltStringKey
index b9aad714f2e1b6e654cfd12eb169699ec2b85ebe..a4b3122ab1b0c8eb4235e57bc2a4c3e37437fa2b 100644 (file)
@@ -1505,10 +1505,12 @@ bool CSSParser::parseContent( int propId, bool important )
 }
 
 #define DASHBOARD_REGION_NUM_PARAMETERS  6
+#define DASHBOARD_REGION_SHORT_NUM_PARAMETERS  2
 
 static Value *skipCommaInDashboardRegion (ValueList *args)
 {
-    if ( args->numValues == (DASHBOARD_REGION_NUM_PARAMETERS*2-1) ) {
+    if ( args->numValues == (DASHBOARD_REGION_NUM_PARAMETERS*2-1) ||
+         args->numValues == (DASHBOARD_REGION_SHORT_NUM_PARAMETERS*2-1)) {
         Value *current = args->current();
         if (current->unit == Value::Operator && current->iValue == ',' )
             return args->next();
@@ -1540,11 +1542,15 @@ bool CSSParser::parseDashboardRegions( int propId, bool important )
         }
             
         // Commas count as values, so allow:
-        // dashbaord-region( label, type, t, r, b, l ) or dashbaord-region( label type t r b l )
-        // dashbaord-region( label, type, t, r, b, l ) or dashbaord-region( label type t r b l )
+        // dashbaord-region(label, type, t, r, b, l) or dashbaord-region(label type t r b l)
+        // dashbaord-region(label, type, t, r, b, l) or dashbaord-region(label type t r b l)
+        // also allow
+        // dashbaord-region(label, type) or dashbaord-region(label type)
+        // dashbaord-region(label, type) or dashbaord-region(label type)
         ValueList *args = value->function->args;
         int numArgs = value->function->args->numValues;
-        if (numArgs != DASHBOARD_REGION_NUM_PARAMETERS && numArgs != (DASHBOARD_REGION_NUM_PARAMETERS*2-1)) {
+        if ((numArgs != DASHBOARD_REGION_NUM_PARAMETERS && numArgs != (DASHBOARD_REGION_NUM_PARAMETERS*2-1)) &&
+            (numArgs != DASHBOARD_REGION_SHORT_NUM_PARAMETERS && numArgs != (DASHBOARD_REGION_SHORT_NUM_PARAMETERS*2-1))){
             valid = false;
             break;
         }
@@ -1584,28 +1590,40 @@ bool CSSParser::parseDashboardRegions( int propId, bool important )
             
         region->m_geometryType = qString(arg->string);
 
-        // Next four arguments must be offset numbers
-        int i;
-        for (i = 0; i < 4; i++) {
-            arg = args->next();
-            arg = skipCommaInDashboardRegion (args);
-
-            valid = arg->id == CSS_VAL_AUTO || validUnit( arg, FLength, strict );
-            if ( !valid )
-                break;
-                
+        if (numArgs == DASHBOARD_REGION_SHORT_NUM_PARAMETERS || numArgs == (DASHBOARD_REGION_SHORT_NUM_PARAMETERS*2-1)) {
             CSSPrimitiveValueImpl *amount = arg->id == CSS_VAL_AUTO ?
                 new CSSPrimitiveValueImpl(CSS_VAL_AUTO) :
-                new CSSPrimitiveValueImpl(arg->fValue, (CSSPrimitiveValue::UnitTypes) arg->unit );
+                new CSSPrimitiveValueImpl((double)0, (CSSPrimitiveValue::UnitTypes) arg->unit );
                 
-            if ( i == 0 )
-                region->setTop( amount );
-            else if ( i == 1 )
-                region->setRight( amount );
-            else if ( i == 2 )
-                region->setBottom( amount );
-            else
-                region->setLeft( amount );
+            region->setTop( amount );
+            region->setRight( amount );
+            region->setBottom( amount );
+            region->setLeft( amount );
+        }
+        else {
+            // Next four arguments must be offset numbers
+            int i;
+            for (i = 0; i < 4; i++) {
+                arg = args->next();
+                arg = skipCommaInDashboardRegion (args);
+
+                valid = arg->id == CSS_VAL_AUTO || validUnit( arg, FLength, strict );
+                if ( !valid )
+                    break;
+                    
+                CSSPrimitiveValueImpl *amount = arg->id == CSS_VAL_AUTO ?
+                    new CSSPrimitiveValueImpl(CSS_VAL_AUTO) :
+                    new CSSPrimitiveValueImpl(arg->fValue, (CSSPrimitiveValue::UnitTypes) arg->unit );
+                    
+                if ( i == 0 )
+                    region->setTop( amount );
+                else if ( i == 1 )
+                    region->setRight( amount );
+                else if ( i == 2 )
+                    region->setBottom( amount );
+                else
+                    region->setLeft( amount );
+            }
         }
 
         value = valueList->next();
index 0699ee3bd31575184e1044cd1a5b93b6a3e01a4b..b270b7555d571708e009472c95976c415e040bb2 100644 (file)
@@ -727,7 +727,7 @@ void KHTMLView::updateDashboardRegions()
         QValueList<DashboardRegionValue> currentRegions = document->dashboardRegions();
         if (!(newRegions == currentRegions)) {
             document->setDashboardRegions(newRegions);
-            KWQ(m_part)->dashboardRegionsChanged(newRegions);
+            KWQ(m_part)->dashboardRegionsChanged();
         }
     }
 }
index 487ed2636860d623be540da09723d68b4a58d9c9..23732dbc499821252cace7c579db6fce8bf48ffe 100644 (file)
@@ -1486,6 +1486,13 @@ void RenderObject::setStyle(RenderStyle *style)
         // If our z-index changes value or our visibility changes,
         // we need to dirty our stacking context's z-order list.
         if (style) {
+#if APPLE_CHANGES
+            if (m_style->visibility() != style->visibility() ||
+                m_style->zIndex() != style->zIndex() ||
+                m_style->hasAutoZIndex() != style->hasAutoZIndex())
+                document()->setDashboardRegionsDirty(true);
+#endif
+
             if ((m_style->hasAutoZIndex() != style->hasAutoZIndex() ||
                  m_style->zIndex() != style->zIndex() ||
                  m_style->visibility() != style->visibility()) && layer()) {
@@ -2178,6 +2185,9 @@ QValueList<DashboardRegionValue> RenderObject::computeDashboardRegions()
 void RenderObject::addDashboardRegions (QValueList<DashboardRegionValue>& regions)
 {
     // Convert the style regions to absolute coordinates.
+    if (style()->visibility() != VISIBLE) 
+        return;
+
     QValueList<StyleDashboardRegion> styleRegions = style()->dashboardRegions();
     if (styleRegions.count() > 0) {
         uint i, count = styleRegions.count();
index 7c17ae28d1b68cc1f99682a5e13123cef7b19192..2c3de6768f1daf57951ff02d02dde82c80e933d4 100644 (file)
@@ -271,6 +271,7 @@ DocumentImpl::DocumentImpl(DOMImplementationImpl *_implementation, KHTMLView *v)
     , m_passwordFields(0), m_secureForms(0)
     , m_decoder(0), m_createRenderers(true)
     , m_hasDashboardRegions(false)
+    , m_dashboardRegionsDirty(false)
 #endif
 {
     document->doc = this;
@@ -2374,6 +2375,7 @@ const QValueList<DashboardRegionValue> & DocumentImpl::dashboardRegions() const
 void DocumentImpl::setDashboardRegions (const QValueList<DashboardRegionValue>& regions)
 {
     m_dashboardRegions = regions;
+    setDashboardRegionsDirty (false);
 }
 
 #endif
index 4d831b67df686186815a5ad9eb9f53f39508205b..7103d96dd8f70630550b26c572b9870ce19dbc9b 100644 (file)
@@ -708,6 +708,8 @@ public:
     void setDecoder(khtml::Decoder *);
     khtml::Decoder *decoder() const { return m_decoder; }
 
+    void setDashboardRegionsDirty(bool f) { m_dashboardRegionsDirty = f; }
+    bool dashboardRegionsDirty() const { return m_dashboardRegionsDirty; }
     bool hasDashboardRegions () const { return m_hasDashboardRegions; }
     void setHasDashboardRegions (bool f) { m_hasDashboardRegions = f; }
     const QValueList<khtml::DashboardRegionValue> & dashboardRegions() const;
@@ -737,6 +739,7 @@ private:
     
     QValueList<khtml::DashboardRegionValue> m_dashboardRegions;
     bool m_hasDashboardRegions;
+    bool m_dashboardRegionsDirty;
 #endif
 };
 
index 16053faa50d890f4359b6c1e53c9145001fa60ff..109ffced039b52b4897f3c862b4f99b4e7e3fd72 100644 (file)
@@ -345,7 +345,8 @@ public:
 
     void didFirstLayout();
     
-    void dashboardRegionsChanged(const QValueList<khtml::DashboardRegionValue> &regions);
+    NSMutableDictionary *dashboardRegionsDictionary();
+    void dashboardRegionsChanged();
     
 private:
     virtual void khtmlMousePressEvent(khtml::MousePressEvent *);
index 1b6b0f7b4b77045be3e0b4e5597d50e2d431952e..c0d256f1e11aea29c49e400ec65a25e05a1e0cac 100644 (file)
@@ -1055,6 +1055,13 @@ void KWQKHTMLPart::paint(QPainter *p, const QRect &rect)
         // _elementToDraw is used to draw only one element
         RenderObject *eltRenderer = (_elementToDraw != 0) ? _elementToDraw.handle()->renderer() : 0;
         renderer()->layer()->paint(p, rect, _drawSelectionOnly, eltRenderer);
+
+#if APPLE_CHANGES
+        // Regions may have changed as a result of the visibility/z-index of element changing.
+        if (renderer()->document()->dashboardRegionsDirty()){
+            renderer()->canvas()->view()->updateDashboardRegions();
+        }
+#endif
     } else {
         ERROR("called KWQKHTMLPart::paint with nil renderer");
     }
@@ -3933,12 +3940,18 @@ void KWQKHTMLPart::didFirstLayout()
     [_bridge didFirstLayout];
 }
 
-void KWQKHTMLPart::dashboardRegionsChanged(const QValueList<DashboardRegionValue>& regions)
+NSMutableDictionary *KWQKHTMLPart::dashboardRegionsDictionary()
 {
+    DocumentImpl *doc = xmlDocImpl();
+    if (!doc) {
+        return nil;
+    }
+
+    const QValueList<DashboardRegionValue> regions = doc->dashboardRegions();
     uint i, count = regions.count();
 
     // Convert the QValueList<DashboardRegionValue> into a NSDictionary of WebDashboardRegions
-    NSMutableDictionary *webRegions = [[NSMutableDictionary alloc] initWithCapacity:count];
+    NSMutableDictionary *webRegions = [[[NSMutableDictionary alloc] initWithCapacity:count] autorelease];
     for (i = 0; i < count; i++) {
         DashboardRegionValue region = regions[i];
         NSRect clip;
@@ -3967,5 +3980,11 @@ void KWQKHTMLPart::dashboardRegionsChanged(const QValueList<DashboardRegionValue
         [regionValues addObject:webRegion];
     }
     
+    return webRegions;
+}
+
+void KWQKHTMLPart::dashboardRegionsChanged()
+{
+    NSMutableDictionary *webRegions = dashboardRegionsDictionary();
     [_bridge dashboardRegionsChanged:webRegions];
 }
index 05c10140b405b32d71fee4b6cf23ea0483080abd..15a776138b049b5c4d1a02b891077ae417170153 100644 (file)
@@ -349,6 +349,8 @@ typedef enum {
 - (BOOL)tryDHTMLCopy;
 - (BOOL)tryDHTMLPaste;
 
+- (NSMutableDictionary *)dashboardRegions;
+
 @end
 
 // The WebCoreBridge protocol contains methods for use by the WebCore side of the bridge.
@@ -515,7 +517,7 @@ typedef enum {
 
 - (void)didFirstLayout;
 
-- (void)dashboardRegionsChanged:(NSDictionary *)regions;
+- (void)dashboardRegionsChanged:(NSMutableDictionary *)regions;
 
 @end
 
index bf22e42f3c24b6cc7e36f9201d387df0c88e9245..3ea5001dd767c80548cf972a2a363c79e0b632bd 100644 (file)
@@ -1825,6 +1825,11 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
     return [DOMRange _rangeWithImpl:makeRange(previous, next).handle()];
 }
 
+- (NSMutableDictionary *)dashboardRegions
+{
+    return _part->dashboardRegionsDictionary();
+}
+
 @end
 
 @implementation WebCoreBridge (WebCoreBridgePrivate)
index ab9326fd55497f9a192f32479f1bc83859f5aea7..78f26ea9f008cb1f954897d486256a9ebadd1075 100644 (file)
@@ -27,7 +27,8 @@
 typedef enum {
     WebDashboardRegionTypeNone,
     WebDashboardRegionTypeCircle,
-    WebDashboardRegionTypeRectangle
+    WebDashboardRegionTypeRectangle,
+    WebDashboardRegionTypeScrollerRectangle
 } WebDashboardRegionType;
 
 @interface WebDashboardRegion : NSObject <NSCopying>
index eb4555a0279c3f3cafa6b8bda6d728994f03bbd5..e0481212d65318837b69c4fd053ed8ffed8d558d 100644 (file)
@@ -62,7 +62,8 @@
         type == WebDashboardRegionTypeNone ? "None" :
             (type == WebDashboardRegionTypeCircle ? "Circle" :
                 (type == WebDashboardRegionTypeRectangle ? "Rectangle" :
-                    "Unknown"))];
+                    (type == WebDashboardRegionTypeScrollerRectangle ? "ScrollerRectangle" :
+                        "Unknown")))];
 }
 
 @end
\ No newline at end of file
index a2a0e166bf7af027fdbfe4093dfc1e5c91595a3e..010f5040867676d3904eb151e378deedafb5692c 100644 (file)
@@ -1,3 +1,21 @@
+2004-09-28  Richard Williamson   <rjw@apple.com>
+
+        <rdar://problem/3817421> add getter for dashboard regions (debugging)
+        
+        <rdar://problem/3817417> NSScrollView need autoregions for dashboard
+       Also KWQScrollBars
+
+        Reviewed by Hyatt.
+
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge dashboardRegionsChanged:]):
+        * WebView.subproj/WebView.m:
+        (-[WebView _setInitiatedDrag:]):
+        (-[WebView _addScrollerDashboardRegions:from:]):
+        (-[WebView _addScrollerDashboardRegions:]):
+        (-[WebView _dashboardRegions]):
+        * WebView.subproj/WebViewPrivate.h:
+
 2004-09-27  John Sullivan  <sullivan@apple.com>
 
         - fixed <rdar://problem/3814705> 8A266: Safari authentication dialog "remember password" text should match Mail
index 317f027d17acca058af6c5ef6eefa1d2b03571c6..c07ed965f1ce89062478defb58b879184ea28467 100644 (file)
@@ -1382,12 +1382,16 @@ static id <WebFormDelegate> formDelegate(WebBridge *self)
     [[wv _frameLoadDelegateForwarder] webView:wv didFirstLayoutInFrame:_frame];
 }
 
-- (void)dashboardRegionsChanged:(NSDictionary *)regions
+- (void)dashboardRegionsChanged:(NSMutableDictionary *)regions
 {
     WebView *wv = [_frame webView];
     id wd = [wv UIDelegate];
-    if ([wd respondsToSelector: @selector(webView:dashboardRegionsChanged:)])
+    
+    [wv _addScrollerDashboardRegions:regions];
+    
+    if ([wd respondsToSelector: @selector(webView:dashboardRegionsChanged:)]) {
         [wd webView:wv dashboardRegionsChanged:regions];
+    }
 }
 
 // This method exists to hold localizable strings for action names for the Undo menu item. It contains
index 5bb14ea302a2520075d529e59b6d8f18d57b1e61..5922143232724ee7d40d0acf62e396aff4ab91f2 100644 (file)
@@ -12,6 +12,7 @@
 #import <WebKit/WebBaseNetscapePluginView.h>
 #import <WebKit/WebBridge.h>
 #import <WebKit/WebControllerSets.h>
+#import <WebKit/WebDashboardRegion.h>
 #import <WebKit/WebDataProtocol.h>
 #import <WebKit/WebDataSourcePrivate.h>
 #import <WebKit/WebDefaultEditingDelegate.h>
@@ -1127,6 +1128,59 @@ NSString *_WebMainFrameURLKey =         @"mainFrameURL";
     _private->initiatedDrag = initiatedDrag;
 }
 
+
+- (void)_addScrollerDashboardRegions:(NSMutableDictionary *)regions from:(NSArray *)views
+{
+    // Add scroller regions for NSScroller and KWQScrollBar
+    int i, count = [views count];
+    
+    for (i = 0; i < count; i++) {
+        NSView *aView = [views objectAtIndex:i];
+        
+        if ([aView isKindOfClass:[NSScroller class]] ||
+            [aView isKindOfClass:NSClassFromString (@"KWQScrollBar")]) {
+            NSRect bounds = [aView bounds];
+            NSRect adjustedBounds;
+            adjustedBounds.origin = [self convertPoint:bounds.origin fromView:aView];
+            adjustedBounds.origin.y = [self bounds].size.height - adjustedBounds.origin.y;
+            
+            // AppKit has horrible hack of placing absent scrollers at -100,-100
+            if (adjustedBounds.origin.y == -100)
+                continue;
+            adjustedBounds.size = bounds.size;
+            NSRect clip = [aView visibleRect];
+            NSRect adjustedClip;
+            adjustedClip.origin = [self convertPoint:clip.origin fromView:aView];
+            adjustedClip.origin.y = [self bounds].size.height - adjustedClip.origin.y;
+            adjustedClip.size = clip.size;
+            WebDashboardRegion *aRegion = 
+                        [[[WebDashboardRegion alloc] initWithRect:adjustedBounds 
+                                    clip:adjustedClip type:WebDashboardRegionTypeScrollerRectangle] autorelease];
+            NSMutableArray *scrollerRegions;
+            scrollerRegions = [regions objectForKey:@"scroller"];
+            if (!scrollerRegions) {
+                scrollerRegions = [NSMutableArray array];
+                [regions setObject:scrollerRegions forKey:@"scroller"];
+            }
+            [scrollerRegions addObject:aRegion];
+        }
+        [self _addScrollerDashboardRegions:regions from:[aView subviews]];
+    }
+}
+
+- (void)_addScrollerDashboardRegions:(NSMutableDictionary *)regions
+{
+    [self _addScrollerDashboardRegions:regions from:[self subviews]];
+}
+
+- (NSDictionary *)_dashboardRegions
+{
+    // Only return regions from main frame.
+    NSMutableDictionary *regions = [[[self mainFrame] _bridge] dashboardRegions];
+    [self _addScrollerDashboardRegions:regions];
+    return regions;
+}
+
 @end
 
 
index d87a7e770a812fd9b9c774bb29a461593f5e104a..7099a9d4d02a2e9fd384a8c41454f0b6d5a8c079 100644 (file)
@@ -214,6 +214,9 @@ Could be worth adding to the API.
 - (void)_writeImageElement:(NSDictionary *)element withPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard;
 - (void)_writeLinkElement:(NSDictionary *)element withPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard;
 
+- (void)_addScrollerDashboardRegions:(NSMutableDictionary *)regions;
+- (NSDictionary *)_dashboardRegions;
+
 @end
 
 @interface WebView (WebViewPrintingPrivate)