[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:07:09 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 2d73aab8224173280c09ef7fcf6a33003f2a9aa6
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 29 20:08:15 2003 +0000

            Reviewed by Darin.
    
    	- fixed 3163842 - Citibank cardmember central DHTML menus not working right in Safari
    
            * khtml/ecma/kjs_html.cpp:
            (KJS::HTMLElement::getValueProperty): update layout before fetching image properties
    	that need it.
            * khtml/xml/dom_docimpl.cpp:
            (DocumentImpl::DocumentImpl): Initialize m_ignorePendingStylesheets to false.
            (DocumentImpl::updateLayout): Ignore pending stylesheets - when JS demands a
    	layout, it wants a real one now.
            (DocumentImpl::updateStyleSelector): Go ahead with the update if we're ignoring
    	pending stylesheets.
            * khtml/xml/dom_docimpl.h:
            (DOM::DocumentImpl::haveStylesheetsLoaded): Pretend stylesheets have loaded if
    	we're temporarily ignoring pending stylesheets.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5304 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 1bbeac1..fd927c9 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,22 @@
+2003-10-28  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Darin.
+
+	- fixed 3163842 - Citibank cardmember central DHTML menus not working right in Safari
+	
+        * khtml/ecma/kjs_html.cpp:
+        (KJS::HTMLElement::getValueProperty): update layout before fetching image properties
+	that need it.
+        * khtml/xml/dom_docimpl.cpp:
+        (DocumentImpl::DocumentImpl): Initialize m_ignorePendingStylesheets to false.
+        (DocumentImpl::updateLayout): Ignore pending stylesheets - when JS demands a
+	layout, it wants a real one now.
+        (DocumentImpl::updateStyleSelector): Go ahead with the update if we're ignoring
+	pending stylesheets.
+        * khtml/xml/dom_docimpl.h:
+        (DOM::DocumentImpl::haveStylesheetsLoaded): Pretend stylesheets have loaded if
+	we're temporarily ignoring pending stylesheets.
+
 2003-10-29  David Hyatt  <hyatt at apple.com>
 
 	Implement support for <marquee>.  This includes support for the CSS3 specification (although modified a fair
diff --git a/WebCore/khtml/ecma/kjs_html.cpp b/WebCore/khtml/ecma/kjs_html.cpp
index 604d1d6..682abca 100644
--- a/WebCore/khtml/ecma/kjs_html.cpp
+++ b/WebCore/khtml/ecma/kjs_html.cpp
@@ -1529,16 +1529,24 @@ Value KJS::HTMLElement::getValueProperty(ExecState *exec, int token) const
     case ImageAlign:           return String(image.align());
     case ImageAlt:             return String(image.alt());
     case ImageBorder:          return Number(image.border());
-    case ImageHeight:          return Number(image.height());
     case ImageHspace:          return Number(image.hspace());
     case ImageIsMap:           return Boolean(image.isMap());
     case ImageLongDesc:        return String(image.longDesc());
     case ImageSrc:             return String(image.src());
     case ImageUseMap:          return String(image.useMap());
     case ImageVspace:          return Number(image.vspace());
-    case ImageWidth:           return Number(image.width());
-    case ImageX:               return Number(image.x());
-    case ImageY:               return Number(image.y());
+    default:
+      // these attributes need layout
+      DOM::DocumentImpl* docimpl = node.handle()->getDocument();
+      if (docimpl) {
+        docimpl->updateLayout();
+      }
+      switch (token) {
+      case ImageHeight:          return Number(image.height());
+      case ImageWidth:           return Number(image.width());
+      case ImageX:               return Number(image.x());
+      case ImageY:               return Number(image.y());
+      }
     }
   }
   break;
diff --git a/WebCore/khtml/xml/dom_docimpl.cpp b/WebCore/khtml/xml/dom_docimpl.cpp
index b8d26b6..d0fe0e5 100644
--- a/WebCore/khtml/xml/dom_docimpl.cpp
+++ b/WebCore/khtml/xml/dom_docimpl.cpp
@@ -307,6 +307,7 @@ DocumentImpl::DocumentImpl(DOMImplementationImpl *_implementation, KHTMLView *v)
                                             !inCompatMode() );
     m_windowEventListeners.setAutoDelete(true);
     m_pendingStylesheets = 0;
+    m_ignorePendingStylesheets = false;
 
     m_cssTarget = 0;
 }
@@ -1038,11 +1039,21 @@ void DocumentImpl::updateDocumentsRendering()
 
 void DocumentImpl::updateLayout()
 {
+    bool oldIgnore = m_ignorePendingStylesheets;
+
+    m_ignorePendingStylesheets = true;
+    
+    if (!oldIgnore) {
+	updateStyleSelector();    
+    }
+
     updateRendering();
 
     // Only do a layout if changes have occurred that make it necessary.      
     if (m_view && renderer() && renderer()->needsLayout())
 	m_view->layout();
+
+    m_ignorePendingStylesheets = oldIgnore;
 }
 
 void DocumentImpl::attach()
@@ -1916,7 +1927,7 @@ void DocumentImpl::stylesheetLoaded()
 void DocumentImpl::updateStyleSelector()
 {
     // Don't bother updating, since we haven't loaded all our style info yet.
-    if (m_pendingStylesheets > 0)
+    if (!haveStylesheetsLoaded())
         return;
 
     recalcStyleSelector();
diff --git a/WebCore/khtml/xml/dom_docimpl.h b/WebCore/khtml/xml/dom_docimpl.h
index 111ca10..04f7e80 100644
--- a/WebCore/khtml/xml/dom_docimpl.h
+++ b/WebCore/khtml/xml/dom_docimpl.h
@@ -184,7 +184,7 @@ public:
      * This method returns true if all top-level stylesheets have loaded (including
      * any @imports that they may be loading).
      */
-    bool haveStylesheetsLoaded() { return m_pendingStylesheets <= 0; }
+    bool haveStylesheetsLoaded() { return m_pendingStylesheets <= 0 || m_ignorePendingStylesheets; }
 
     /**
      * Increments the number of pending sheets.  The <link> elements
@@ -488,6 +488,10 @@ protected:
     // elements.
     int m_pendingStylesheets;
 
+    // But sometimes you need to ignore pending stylesheet count to
+    // force an immediate layout when requested by JS.
+    bool m_ignorePendingStylesheets;
+
     CSSStyleSheetImpl *m_elemSheet;
 
     QPaintDevice *m_paintDevice;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list