[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.2.1-2-74-gcc212da

Gustavo Noronha Silva kov at debian.org
Mon Jul 12 22:59:41 UTC 2010


The following commit has been merged in the debian/unstable branch:
commit 80af867b20d1347a853457d28160727bafa2d824
Merge: 70f7b06cda4f689d9da6cf7fedf6c408c1458fca 2d0b389367d3cacab5fe4045861cacca296e596c
Author: Gustavo Noronha Silva <kov at debian.org>
Date:   Fri Jul 9 17:39:22 2010 -0300

    Merge branch 'webkit-1.2' into debian/unstable

diff --combined WebCore/dom/Document.cpp
index 3d305b6,59fefa3..060ef37
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@@ -451,7 -451,7 +451,7 @@@ Document::Document(Frame* frame, bool i
      static int docID = 0;
      m_docID = docID++;
  #if ENABLE(XHTMLMP)
-     m_shouldProcessNoScriptElement = m_frame->script()->canExecuteScripts(NotAboutToExecuteScript);
+     m_shouldProcessNoScriptElement = m_frame && m_frame->script()->canExecuteScripts(NotAboutToExecuteScript);
  #endif
  }
  
@@@ -2879,28 -2879,6 +2879,28 @@@ void Document::nodeChildrenChanged(Cont
      }
  }
  
 +void Document::nodeChildrenWillBeRemoved(ContainerNode* container)
 +{
 +    if (!disableRangeMutation(page())) {
 +        HashSet<Range*>::const_iterator end = m_ranges.end();
 +        for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != end; ++it)
 +            (*it)->nodeChildrenWillBeRemoved(container);
 +    }
 +
 +    HashSet<NodeIterator*>::const_iterator nodeIteratorsEnd = m_nodeIterators.end();
 +    for (HashSet<NodeIterator*>::const_iterator it = m_nodeIterators.begin(); it != nodeIteratorsEnd; ++it) {
 +        for (Node* n = container->firstChild(); n; n = n->nextSibling())
 +            (*it)->nodeWillBeRemoved(n);
 +    }
 +
 +    if (Frame* frame = this->frame()) {
 +        for (Node* n = container->firstChild(); n; n = n->nextSibling()) {
 +            frame->selection()->nodeWillBeRemoved(n);
 +            frame->dragCaretController()->nodeWillBeRemoved(n);
 +        }
 +    }
 +}
 +
  void Document::nodeWillBeRemoved(Node* n)
  {
      HashSet<NodeIterator*>::const_iterator nodeIteratorsEnd = m_nodeIterators.end();
diff --combined WebCore/page/EventHandler.cpp
index 025666a,7791695..fcb93cf
--- a/WebCore/page/EventHandler.cpp
+++ b/WebCore/page/EventHandler.cpp
@@@ -2151,9 -2151,7 +2151,9 @@@ bool EventHandler::keyEvent(const Platf
  
      if (initialKeyEvent.type() == PlatformKeyboardEvent::RawKeyDown) {
          node->dispatchEvent(keydown, ec);
 -        return keydown->defaultHandled() || keydown->defaultPrevented();
 +        // If frame changed as a result of keydown dispatch, then return true to avoid sending a subsequent keypress message to the new frame.
 +        bool changedFocusedFrame = m_frame->page() && m_frame != m_frame->page()->focusController()->focusedOrMainFrame();
 +        return keydown->defaultHandled() || keydown->defaultPrevented() || changedFocusedFrame;
      }
  
      // Run input method in advance of DOM event handling.  This may result in the IM
@@@ -2173,9 -2171,7 +2173,9 @@@
      }
  
      node->dispatchEvent(keydown, ec);
 -    bool keydownResult = keydown->defaultHandled() || keydown->defaultPrevented();
 +    // If frame changed as a result of keydown dispatch, then return early to avoid sending a subsequent keypress message to the new frame.
 +    bool changedFocusedFrame = m_frame->page() && m_frame != m_frame->page()->focusController()->focusedOrMainFrame();
 +    bool keydownResult = keydown->defaultHandled() || keydown->defaultPrevented() || changedFocusedFrame;
      if (handledByInputMethod || (keydownResult && !backwardCompatibilityMode))
          return keydownResult;
      
@@@ -2635,7 -2631,7 +2635,7 @@@ void EventHandler::sendResizeEvent(
  void EventHandler::sendScrollEvent()
  {
      setFrameWasScrolledByUser();
-     if (m_frame->view())
+     if (m_frame->view() && m_frame->document())
          m_frame->document()->dispatchEvent(Event::create(eventNames().scrollEvent, true, false));
  }
  
@@@ -2717,21 -2713,21 +2717,21 @@@ bool EventHandler::handleTouchEvent(con
  
          // Increment the platform touch id by 1 to avoid storing a key of 0 in the hashmap.
          unsigned touchPointTargetKey = point.id() + 1;
-         EventTarget* touchTarget = 0;
+         RefPtr<EventTarget> touchTarget;
          if (point.state() == PlatformTouchPoint::TouchPressed) {
              m_originatingTouchPointTargets.set(touchPointTargetKey, target);
              touchTarget = target;
          } else if (point.state() == PlatformTouchPoint::TouchReleased || point.state() == PlatformTouchPoint::TouchCancelled) {
              // The target should be the original target for this touch, so get it from the hashmap. As it's a release or cancel
              // we also remove it from the map.
-             touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKey).get();
+             touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKey);
          } else
-             touchTarget = m_originatingTouchPointTargets.get(touchPointTargetKey).get();
+             touchTarget = m_originatingTouchPointTargets.get(touchPointTargetKey);
  
-         if (!touchTarget)
+         if (!touchTarget.get())
              continue;
  
-         RefPtr<Touch> touch = Touch::create(doc->frame(), touchTarget, point.id(),
+         RefPtr<Touch> touch = Touch::create(doc->frame(), touchTarget.get(), point.id(),
                                              point.screenPos().x(), point.screenPos().y(),
                                              adjustedPageX, adjustedPageY);
  
diff --combined WebCore/page/FrameView.cpp
index 7158354,caa78bd..d38f655
--- a/WebCore/page/FrameView.cpp
+++ b/WebCore/page/FrameView.cpp
@@@ -1275,13 -1275,14 +1275,13 @@@ void FrameView::scheduleRelayoutOfSubtr
  {
      ASSERT(m_frame->view() == this);
  
 -    if (!m_layoutSchedulingEnabled || (m_frame->contentRenderer()
 -            && m_frame->contentRenderer()->needsLayout())) {
 +    if (m_frame->contentRenderer() && m_frame->contentRenderer()->needsLayout()) {
          if (relayoutRoot)
              relayoutRoot->markContainingBlocksForLayout(false);
          return;
      }
  
 -    if (layoutPending()) {
 +    if (layoutPending() || !m_layoutSchedulingEnabled) {
          if (m_layoutRoot != relayoutRoot) {
              if (isObjectAncestorContainerOf(m_layoutRoot, relayoutRoot)) {
                  // Keep the current root
@@@ -1298,7 -1299,7 +1298,7 @@@
                  relayoutRoot->markContainingBlocksForLayout(false);
              }
          }
 -    } else {
 +    } else if (m_layoutSchedulingEnabled) {
          int delay = m_frame->document()->minimumLayoutDelay();
          m_layoutRoot = relayoutRoot;
          m_delayedLayout = delay != 0;
@@@ -1567,7 -1568,7 +1567,7 @@@ IntRect FrameView::windowClipRect(bool 
  
      // Set our clip rect to be our contents.
      IntRect clipRect = contentsToWindow(visibleContentRect(!clipToContents));
-     if (!m_frame || !m_frame->document()->ownerElement())
+     if (!m_frame || !m_frame->document() || !m_frame->document()->ownerElement())
          return clipRect;
  
      // Take our owner element and get the clip rect from the enclosing layer.
diff --combined WebKit/gtk/webkit/webkitwebview.cpp
index a404e08,b8ebea2..1f3a445
--- a/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/WebKit/gtk/webkit/webkitwebview.cpp
@@@ -44,6 -44,7 +44,7 @@@
  #include "BackForwardList.h"
  #include "Cache.h"
  #include "ChromeClientGtk.h"
+ #include "ClipboardUtilitiesGtk.h"
  #include "ContextMenuClientGtk.h"
  #include "ContextMenuController.h"
  #include "ContextMenu.h"
@@@ -63,6 -64,7 +64,7 @@@
  #include "FrameView.h"
  #include <glib/gi18n-lib.h>
  #include <GOwnPtr.h>
+ #include <GOwnPtrGtk.h>
  #include "GraphicsContext.h"
  #include "GtkVersioning.h"
  #include "HitTestRequest.h"
@@@ -585,11 -587,52 +587,52 @@@ static gboolean webkit_web_view_key_rel
  
  static gboolean webkit_web_view_button_press_event(GtkWidget* widget, GdkEventButton* event)
  {
+     // Eventually it may make sense for these to be per-view and per-device,
+     // but at this time the implementation matches the Windows port.
+     static int currentClickCount = 1;
+     static IntPoint previousPoint;
+     static guint previousButton;
+     static guint32 previousTime;
+ 
      WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
  
      // FIXME: need to keep track of subframe focus for key events
      gtk_widget_grab_focus(widget);
  
+     // For double and triple clicks GDK sends both a normal button press event
+     // and a specific type (like GDK_2BUTTON_PRESS). If we detect a special press
+     // coming up, ignore this event as it certainly generated the double or triple
+     // click. The consequence of not eating this event is two DOM button press events
+     // are generated.
+     GOwnPtr<GdkEvent> nextEvent(gdk_event_peek());
+     if (nextEvent && (nextEvent->any.type == GDK_2BUTTON_PRESS || nextEvent->any.type == GDK_3BUTTON_PRESS))
+         return TRUE;
+ 
+     gint doubleClickDistance = 250;
+     gint doubleClickTime = 5;
+     GtkSettings* settings = gtk_settings_get_for_screen(gdk_drawable_get_screen(widget->window));
+     g_object_get(settings, 
+         "gtk-double-click-distance", &doubleClickDistance,
+         "gtk-double-click-time", &doubleClickTime, NULL);
+ 
+     // GTK+ only counts up to triple clicks, but WebCore wants to know about
+     // quadruple clicks, quintuple clicks, ad infinitum. Here, we replicate the
+     // GDK logic for counting clicks.
+     if ((event->type == GDK_2BUTTON_PRESS || event->type == GDK_3BUTTON_PRESS)
+         || ((abs(event->x - previousPoint.x()) < doubleClickDistance)
+             && (abs(event->y - previousPoint.y()) < doubleClickDistance)
+             && (event->time - previousTime < static_cast<guint>(doubleClickTime))
+             && (event->button == previousButton)))
+         currentClickCount++;
+     else
+         currentClickCount = 1;
+ 
+     PlatformMouseEvent platformEvent(event);
+     platformEvent.setClickCount(currentClickCount);
+     previousPoint = platformEvent.pos();
+     previousButton = event->button;
+     previousTime = event->time;
+ 
      if (event->button == 3)
          return webkit_web_view_forward_context_menu_event(webView, PlatformMouseEvent(event));
  
@@@ -597,7 -640,8 +640,8 @@@
      if (!frame->view())
          return FALSE;
  
-     gboolean result = frame->eventHandler()->handleMousePressEvent(PlatformMouseEvent(event));
+ 
+     gboolean result = frame->eventHandler()->handleMousePressEvent(platformEvent);
  
  #if PLATFORM(X11)
      /* Copy selection to the X11 selection clipboard */
@@@ -1122,6 -1166,8 +1166,8 @@@ static void webkit_web_view_dispose(GOb
          priv->subResources = NULL;
      }
  
+     priv->draggingDataObjects.clear();
+ 
      G_OBJECT_CLASS(webkit_web_view_parent_class)->dispose(object);
  }
  
@@@ -1232,126 -1278,49 +1278,49 @@@ static void webkit_web_view_screen_chan
  
  static void webkit_web_view_drag_end(GtkWidget* widget, GdkDragContext* context)
  {
-     g_object_unref(context);
- }
+     WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
+     WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
  
- struct DNDContentsRequest
- {
-     gint info;
-     GtkSelectionData* dnd_selection_data;
+     // This might happen if a drag is still in progress after a WebKitWebView
+     // is disposed and before it is finalized.
+     if (!priv->draggingDataObjects.contains(context))
+         return;
  
-     gboolean is_url_label_request;
-     gchar* url;
- };
+     priv->draggingDataObjects.remove(context);
  
- void clipboard_contents_received(GtkClipboard* clipboard, GtkSelectionData* selection_data, gpointer data)
- {
-     DNDContentsRequest* contents_request = reinterpret_cast<DNDContentsRequest*>(data);
- 
-     if (contents_request->is_url_label_request) {
-         // We have received contents of the label clipboard. Use them to form
-         // required structures. When formed, enhance the dnd's selection data
-         // with them and return.
- 
-         // If the label is empty, use the url itself.
-         gchar* url_label = reinterpret_cast<gchar*>(gtk_selection_data_get_text(selection_data));
-         if (!url_label)
-             url_label = g_strdup(contents_request->url);
- 
-         gchar* data = 0;
-         switch (contents_request->info) {
-         case WEBKIT_WEB_VIEW_TARGET_INFO_URI_LIST:
-             data = g_strdup_printf("%s\r\n%s\r\n", contents_request->url, url_label);
-             break;
-         case WEBKIT_WEB_VIEW_TARGET_INFO_NETSCAPE_URL:
-             data = g_strdup_printf("%s\n%s", contents_request->url, url_label);
-             break;
-         }
+     Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+     if (!frame)
+         return;
  
-         if (data) {
-             gtk_selection_data_set(contents_request->dnd_selection_data,
-                                    contents_request->dnd_selection_data->target, 8,
-                                    reinterpret_cast<const guchar*>(data), strlen(data));
-             g_free(data);
-         }
+     GdkEvent* event = gdk_event_new(GDK_BUTTON_RELEASE);
+     int x, y, xRoot, yRoot;
+     GdkModifierType modifiers;
+     GdkDisplay* display = gdk_display_get_default();
+     gdk_display_get_pointer(display, 0, &xRoot, &yRoot, &modifiers);
  
-         g_free(url_label);
-         g_free(contents_request->url);
-         g_free(contents_request);
+     event->button.window = static_cast<GdkWindow*>(g_object_ref(gdk_display_get_window_at_pointer(display, &x, &y)));
+     event->button.x = x;
+     event->button.y = y;
+     event->button.x_root = xRoot;
+     event->button.y_root = yRoot;
+     event->button.state = modifiers;
  
-         return;
-     }
+     PlatformMouseEvent platformEvent(&event->button);
+     frame->eventHandler()->dragSourceEndedAt(platformEvent, gdkDragActionToDragOperation(context->action));
  
-     switch (contents_request->info) {
-     case WEBKIT_WEB_VIEW_TARGET_INFO_HTML:
-     case WEBKIT_WEB_VIEW_TARGET_INFO_TEXT:
-         {
-         gchar* data = reinterpret_cast<gchar*>(gtk_selection_data_get_text(selection_data));
-         if (data) {
-             gtk_selection_data_set(contents_request->dnd_selection_data,
-                                    contents_request->dnd_selection_data->target, 8,
-                                    reinterpret_cast<const guchar*>(data),
-                                    strlen(data));
-             g_free(data);
-         }
-         break;
-         }
-     case WEBKIT_WEB_VIEW_TARGET_INFO_IMAGE:
-         {
-         GdkPixbuf* pixbuf = gtk_selection_data_get_pixbuf(selection_data);
-         if (pixbuf) {
-             gtk_selection_data_set_pixbuf(contents_request->dnd_selection_data, pixbuf);
-             g_object_unref(pixbuf);
-         }
-         break;
-         }
-     case WEBKIT_WEB_VIEW_TARGET_INFO_URI_LIST:
-     case WEBKIT_WEB_VIEW_TARGET_INFO_NETSCAPE_URL:
-         // URL's label is stored in another clipboard, so we store URL into
-         // contents request, mark the latter as an url label request
-         // and request for contents of the label clipboard.
-         contents_request->is_url_label_request = TRUE;
-         contents_request->url = reinterpret_cast<gchar*>(gtk_selection_data_get_text(selection_data));
- 
-         gtk_clipboard_request_contents(gtk_clipboard_get(gdk_atom_intern_static_string("WebKitClipboardUrlLabel")),
-                                        selection_data->target, clipboard_contents_received, contents_request);
-         break;
-     }
+     gdk_event_free(event);
  }
  
- static void webkit_web_view_drag_data_get(GtkWidget* widget, GdkDragContext* context, GtkSelectionData* selection_data, guint info, guint time_)
+ static void webkit_web_view_drag_data_get(GtkWidget* widget, GdkDragContext* context, GtkSelectionData* selectionData, guint info, guint)
  {
-     GdkAtom selection_atom = GDK_NONE;
-     GdkAtom target_atom = selection_data->target;
- 
-     switch (info) {
-         case WEBKIT_WEB_VIEW_TARGET_INFO_HTML:
-             selection_atom = gdk_atom_intern_static_string("WebKitClipboardHtml");
-             // HTML markup data is set as text, therefor, we need a text-like target atom
-             target_atom = gdk_atom_intern_static_string("UTF8_STRING");
-             break;
-         case WEBKIT_WEB_VIEW_TARGET_INFO_TEXT:
-             selection_atom = gdk_atom_intern_static_string("WebKitClipboardText");
-             break;
-         case WEBKIT_WEB_VIEW_TARGET_INFO_IMAGE:
-             selection_atom = gdk_atom_intern_static_string("WebKitClipboardImage");
-             break;
-         case WEBKIT_WEB_VIEW_TARGET_INFO_URI_LIST:
-         case WEBKIT_WEB_VIEW_TARGET_INFO_NETSCAPE_URL:
-             selection_atom = gdk_atom_intern_static_string("WebKitClipboardUrl");
-             // We require URL and label, which are both stored in text format
-             // and are needed to be retrieved as such.
-             target_atom = gdk_atom_intern_static_string("UTF8_STRING");
-             break;
-     }
+     WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(WEBKIT_WEB_VIEW(widget));
  
-     DNDContentsRequest* contents_request = g_new(DNDContentsRequest, 1);
-     contents_request->info = info;
-     contents_request->is_url_label_request = FALSE;
-     contents_request->dnd_selection_data = selection_data;
+     // This might happen if a drag is still in progress after a WebKitWebView
+     // is diposed and before it is finalized.
+     if (!priv->draggingDataObjects.contains(context))
+         return;
  
-     gtk_clipboard_request_contents(gtk_clipboard_get(selection_atom), target_atom,
-                                    clipboard_contents_received, contents_request);
+     pasteboardHelperInstance()->fillSelectionData(selectionData, info, priv->draggingDataObjects.get(context).get());
  }
  
  #if GTK_CHECK_VERSION(2, 12, 0)
@@@ -2677,8 -2646,7 +2646,8 @@@ static void webkit_web_view_update_sett
      gboolean autoLoadImages, autoShrinkImages, printBackgrounds,
          enableScripts, enablePlugins, enableDeveloperExtras, resizableTextAreas,
          enablePrivateBrowsing, enableCaretBrowsing, enableHTML5Database, enableHTML5LocalStorage,
 -        enableXSSAuditor, enableSpatialNavigation, javascriptCanOpenWindows, enableOfflineWebAppCache,
 +        enableXSSAuditor, enableSpatialNavigation, javascriptCanOpenWindows,
 +        javaScriptCanAccessClipboard, enableOfflineWebAppCache,
          enableUniversalAccessFromFileURI, enableFileAccessFromFileURI,
          enableDOMPaste, tabKeyCyclesThroughElements,
          enableSiteSpecificQuirks, usePageCache, enableJavaApplet;
@@@ -2708,7 -2676,6 +2677,7 @@@
                   "enable-xss-auditor", &enableXSSAuditor,
                   "enable-spatial-navigation", &enableSpatialNavigation,
                   "javascript-can-open-windows-automatically", &javascriptCanOpenWindows,
 +                 "javascript-can-access-clipboard", &javaScriptCanAccessClipboard,
                   "enable-offline-web-application-cache", &enableOfflineWebAppCache,
                   "editing-behavior", &editingBehavior,
                   "enable-universal-access-from-file-uris", &enableUniversalAccessFromFileURI,
@@@ -2744,7 -2711,6 +2713,7 @@@
      settings->setXSSAuditorEnabled(enableXSSAuditor);
      settings->setSpatialNavigationEnabled(enableSpatialNavigation);
      settings->setJavaScriptCanOpenWindowsAutomatically(javascriptCanOpenWindows);
 +    settings->setJavaScriptCanAccessClipboard(javaScriptCanAccessClipboard);
      settings->setOfflineWebApplicationCacheEnabled(enableOfflineWebAppCache);
      settings->setEditingBehavior(core(editingBehavior));
      settings->setAllowUniversalAccessFromFileURLs(enableUniversalAccessFromFileURI);
@@@ -2842,8 -2808,6 +2811,8 @@@ static void webkit_web_view_settings_no
          settings->setSpatialNavigationEnabled(g_value_get_boolean(&value));
      else if (name == g_intern_string("javascript-can-open-windows-automatically"))
          settings->setJavaScriptCanOpenWindowsAutomatically(g_value_get_boolean(&value));
 +    else if (name == g_intern_string("javascript-can-access-clipboard"))
 +        settings->setJavaScriptCanAccessClipboard(g_value_get_boolean(&value));
      else if (name == g_intern_string("enable-offline-web-application-cache"))
          settings->setOfflineWebApplicationCacheEnabled(g_value_get_boolean(&value));
      else if (name == g_intern_string("editing-behavior"))
diff --combined WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
index a0c2b21,dbb1344..6141b21
--- a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
@@@ -320,7 -320,6 +320,7 @@@ static void resetDefaultsToConsistentVa
                   "enable-html5-local-storage", TRUE,
                   "enable-xss-auditor", FALSE,
                   "enable-spatial-navigation", FALSE,
 +                 "javascript-can-access-clipboard", TRUE,
                   "javascript-can-open-windows-automatically", TRUE,
                   "enable-offline-web-application-cache", TRUE,
                   "enable-universal-access-from-file-uris", TRUE,
@@@ -627,7 -626,7 +627,7 @@@ static void webViewWindowObjectCleared(
      ASSERT(!exception);
  
      JSStringRef eventSenderStr = JSStringCreateWithUTF8CString("eventSender");
-     JSValueRef eventSender = makeEventSender(context);
+     JSValueRef eventSender = makeEventSender(context, !webkit_web_frame_get_parent(frame));
      JSObjectSetProperty(context, windowObject, eventSenderStr, eventSender, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, 0);
      JSStringRelease(eventSenderStr);
  }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list