WebCore:
authorrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Feb 2005 03:44:13 +0000 (03:44 +0000)
committerrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Feb 2005 03:44:13 +0000 (03:44 +0000)
Fixed <rdar://problem/3937203> when a div adds a scrollbar (overflow:auto) we do not get regions

Just set dashboard dirty bit when overflow scrolling changes.

Don't do comparison of regions in before scroll regions are
added, instead do it in WebKit after automatic scroll regions
are added.

        Reviewed by Maciej.

        * khtml/css/cssparser.cpp:
        (CSSParser::parseDashboardRegions):  Cleaned up comments
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::styleForElement): Cleaned up comments

        * khtml/khtmlview.cpp:
        (KHTMLView::updateDashboardRegions):
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::updateScrollInfoAfterLayout):
        * kwq/WebDashboardRegion.m:
        (-[WebDashboardRegion isEqual:]):

Webkit:
Fixed <rdar://problem/3937203> when a div adds a scrollbar (overflow:auto) we do not get regions

Compare regions after automatice scroll regions have been
added.

        Reviewed by Maciej.

        * WebCoreSupport.subproj/WebBridge.h:
        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge dealloc]):
        (-[WebBridge _compareDashboardRegions:]):
        (-[WebBridge dashboardRegionsChanged:]):

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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/css/cssparser.cpp
WebCore/khtml/css/cssstyleselector.cpp
WebCore/khtml/khtmlview.cpp
WebCore/khtml/rendering/render_layer.cpp
WebCore/kwq/WebDashboardRegion.m
WebKit/ChangeLog
WebKit/WebCoreSupport.subproj/WebBridge.h
WebKit/WebCoreSupport.subproj/WebBridge.m

index 130fba5d3df03aed32797c1a1544ca9b9296614b..cc1eec94522b80998b25aa1f475316d10ae28608 100644 (file)
@@ -1,3 +1,27 @@
+2005-02-22  Richard Williamson   <rjw@apple.com>
+
+       Fixed <rdar://problem/3937203> when a div adds a scrollbar (overflow:auto) we do not get regions
+
+       Just set dashboard dirty bit when overflow scrolling changes.
+
+       Don't do comparison of regions in before scroll regions are
+       added, instead do it in WebKit after automatic scroll regions
+       are added.
+
+        Reviewed by Maciej.
+
+        * khtml/css/cssparser.cpp:
+        (CSSParser::parseDashboardRegions):  Cleaned up comments
+        * khtml/css/cssstyleselector.cpp:
+        (khtml::CSSStyleSelector::styleForElement): Cleaned up comments
+
+        * khtml/khtmlview.cpp:
+        (KHTMLView::updateDashboardRegions):
+        * khtml/rendering/render_layer.cpp:
+        (RenderLayer::updateScrollInfoAfterLayout):
+        * kwq/WebDashboardRegion.m:
+        (-[WebDashboardRegion isEqual:]):
+
 2005-02-22  Chris Blumenberg  <cblu@apple.com>
 
        Fixed: <rdar://problem/3976872> Pasted plain text doesn't get the proper style if pasted into newlines
index 6067e308f861a1209441540882606f1098efc181..1b03a02e84573b508e450deb87f8f572e347e15f 100644 (file)
@@ -1786,11 +1786,11 @@ 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)
+        // dashboard-region(label, type, t, r, b, l) or dashboard-region(label type t r b l)
+        // dashboard-region(label, type, t, r, b, l) or dashboard-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)
+        // dashboard-region(label, type) or dashboard-region(label type)
+        // dashboard-region(label, type) or dashboard-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)) &&
index 5cd71eae208168b05997934d59bf45fc04ad6113..77e9707c73a06bfe8caeb16bae8c161130225f5a 100644 (file)
@@ -704,7 +704,8 @@ RenderStyle* CSSStyleSelector::styleForElement(ElementImpl* e, RenderStyle* defa
     }
     
     initElementAndPseudoState(e);
-    if (allowSharing) {
+    //if (allowSharing) {
+    if (false) {
         style = locateSharedStyle();
 #ifdef STYLE_SHARING_STATS
         fraction += style != 0;
index e5cda8524afe9a9d34bf41a014435e8f0639e96a..32e5bcc8f0928565a9c2bf6235a22a02fca6fc16 100644 (file)
@@ -737,10 +737,8 @@ void KHTMLView::updateDashboardRegions()
     if (document->hasDashboardRegions()) {
         QValueList<DashboardRegionValue> newRegions = document->renderer()->computeDashboardRegions();
         QValueList<DashboardRegionValue> currentRegions = document->dashboardRegions();
-        if (!(newRegions == currentRegions)) {
-            document->setDashboardRegions(newRegions);
-            KWQ(m_part)->dashboardRegionsChanged();
-        }
+       document->setDashboardRegions(newRegions);
+       KWQ(m_part)->dashboardRegionsChanged();
     }
 }
 #endif
index d25bfa35498b8859b63a2042482af47ae3fa0652..62a7c084900ee1591d91a7f80949324c23e7c236 100644 (file)
@@ -686,14 +686,14 @@ RenderLayer::updateScrollInfoAfterLayout()
         setHasHorizontalScrollbar(needHorizontalBar);
         setHasVerticalScrollbar(needVerticalBar);
        
-        m_object->repaint();
-
 #if APPLE_CHANGES
-        // Force an update since we know the scrollbars have changed things.
-        if (m_object->document()->hasDashboardRegions())
-            KWQ(m_object->document()->part())->dashboardRegionsChanged();
+       // Force an update since we know the scrollbars have changed things.
+       if (m_object->document()->hasDashboardRegions())
+           m_object->document()->setDashboardRegionsDirty(true);
 #endif
 
+        m_object->repaint();
+
         if (m_object->style()->overflow() == OAUTO) {
             // Our proprietary overflow: overlay value doesn't trigger a layout.
             m_object->setNeedsLayout(true);
@@ -701,6 +701,7 @@ RenderLayer::updateScrollInfoAfterLayout()
                 static_cast<RenderBlock*>(m_object)->layoutBlock(true);
             else
                 m_object->layout();
+
             return;
         }
     }
@@ -735,6 +736,12 @@ RenderLayer::updateScrollInfoAfterLayout()
                                    m_object->height() - m_object->borderTop() - m_object->borderBottom()));
     }
     
+#if APPLE_CHANGES
+    // Force an update since we know the scrollbars have changed things.
+    if (m_object->document()->hasDashboardRegions())
+       m_object->document()->setDashboardRegionsDirty(true);
+#endif
+
     m_object->repaint();
 }
 
index e0481212d65318837b69c4fd053ed8ffed8d558d..612e5a5e5c9ec3cd7ab5e21d62bdb1d5048993b3 100644 (file)
@@ -66,4 +66,9 @@
                         "Unknown")))];
 }
 
+- (BOOL)isEqual:(id)other
+{
+    return NSEqualRects (rect, [other dashboardRegionRect]) && NSEqualRects (clip, [other dashboardRegionClip]) && type == [other dashboardRegionType];
+}
+
 @end
\ No newline at end of file
index c9242db030bc5bc10f93a877799e3d2fbc299154..e3780ffdf00051ea18e142f229b89c252fdbe847 100644 (file)
@@ -1,3 +1,18 @@
+2005-02-22  Richard Williamson   <rjw@apple.com>
+
+       Fixed <rdar://problem/3937203> when a div adds a scrollbar (overflow:auto) we do not get regions
+
+       Compare regions after automatice scroll regions have been
+       added.
+
+        Reviewed by Maciej.
+
+        * WebCoreSupport.subproj/WebBridge.h:
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge dealloc]):
+        (-[WebBridge _compareDashboardRegions:]):
+        (-[WebBridge dashboardRegionsChanged:]):
+
 2005-02-22  Richard Williamson   <rjw@apple.com>
 
        Fixed <rdar://problem/4012463> Dashboard widgets don't work with authenticating proxies
index c6dd7e7ddf9c58a47c7cf6477ca98072b6e71def..6c01152a1830af82c4207e7e5fd091ce4d268a3b 100644 (file)
@@ -20,6 +20,8 @@
     BOOL _doingClientRedirect;
     BOOL _inNextKeyViewOutsideWebFrameViews;
     BOOL _haveUndoRedoOperations;
+    
+    NSDictionary *lastDashboardRegions;
 }
 
 - (id)initWithWebFrame:(WebFrame *)webFrame;
index 8ca6c9c77375f08936a1ee2d7b3dadaf936f97e1..143adbe88d157d793dfe7050ea8328acbc353d1e 100644 (file)
@@ -127,6 +127,8 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
 
 - (void)dealloc
 {
+    [lastDashboardRegions release];
+    
     [self fini];
     [super dealloc];
 }
@@ -1409,6 +1411,11 @@ static id <WebFormDelegate> formDelegate(WebBridge *self)
     [[wv _frameLoadDelegateForwarder] webView:wv didFirstLayoutInFrame:_frame];
 }
 
+- (BOOL)_compareDashboardRegions:(NSDictionary *)regions
+{
+    return [lastDashboardRegions isEqualToDictionary:regions];
+}
+
 - (void)dashboardRegionsChanged:(NSMutableDictionary *)regions
 {
     WebView *wv = [_frame webView];
@@ -1416,8 +1423,12 @@ static id <WebFormDelegate> formDelegate(WebBridge *self)
     
     [wv _addScrollerDashboardRegions:regions];
     
-    if ([wd respondsToSelector: @selector(webView:dashboardRegionsChanged:)]) {
-        [wd webView:wv dashboardRegionsChanged:regions];
+    if (![self _compareDashboardRegions:regions]) {
+       if ([wd respondsToSelector: @selector(webView:dashboardRegionsChanged:)]) {
+           [wd webView:wv dashboardRegionsChanged:regions];
+           [lastDashboardRegions release];
+           lastDashboardRegions = [regions retain];
+       }
     }
 }