<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[20709] trunk/WebCore</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/20709">20709</a></dd>
<dt>Author</dt> <dd>adele</dd>
<dt>Date</dt> <dd>2007-04-04 18:05:49 -0700 (Wed, 04 Apr 2007)</dd>
</dl>

<h3>Log Message</h3>
<pre>        Reviewed by Oliver.

        Fix for &lt;rdar://5105009&gt; Prepare for fix to send mousedown and mouseup (but not click) events when right-clicking

        * page/EventHandler.cpp: Don't ever send click events for right-clicks.
        (WebCore::EventHandler::handleMouseDoubleClickEvent):
        (WebCore::EventHandler::handleMouseReleaseEvent):
        
        Check that the mousedown and mouseup are not with the right button before performing default behavior.
        * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::defaultEventHandler):
        * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler):
        * html/HTMLSelectElement.cpp:
        (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
        (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
        * html/HTMLTextFieldInnerElement.cpp:
        (WebCore::HTMLSearchFieldResultsButtonElement::defaultEventHandler):
        (WebCore::HTMLSearchFieldCancelButtonElement::defaultEventHandler):
        * ksvg2/svg/SVGAElement.cpp:(WebCore::SVGAElement::defaultEventHandler):
        * rendering/RenderFrameSet.cpp: (WebCore::RenderFrameSet::userResize):
        * rendering/RenderSlider.cpp: (WebCore::HTMLSliderThumbElement::defaultEventHandler):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCorehtmlHTMLAnchorElementcpp">trunk/WebCore/html/HTMLAnchorElement.cpp</a></li>
<li><a href="#trunkWebCorehtmlHTMLInputElementcpp">trunk/WebCore/html/HTMLInputElement.cpp</a></li>
<li><a href="#trunkWebCorehtmlHTMLSelectElementcpp">trunk/WebCore/html/HTMLSelectElement.cpp</a></li>
<li><a href="#trunkWebCorehtmlHTMLTextFieldInnerElementcpp">trunk/WebCore/html/HTMLTextFieldInnerElement.cpp</a></li>
<li><a href="#trunkWebCoreksvg2svgSVGAElementcpp">trunk/WebCore/ksvg2/svg/SVGAElement.cpp</a></li>
<li><a href="#trunkWebCorepageEventHandlercpp">trunk/WebCore/page/EventHandler.cpp</a></li>
<li><a href="#trunkWebCorerenderingRenderFrameSetcpp">trunk/WebCore/rendering/RenderFrameSet.cpp</a></li>
<li><a href="#trunkWebCorerenderingRenderSlidercpp">trunk/WebCore/rendering/RenderSlider.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (20708 => 20709)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2007-04-04 20:52:39 UTC (rev 20708)
+++ trunk/WebCore/ChangeLog        2007-04-05 01:05:49 UTC (rev 20709)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2007-04-04  Adele Peterson  &lt;adele@apple.com&gt;
+
+        Reviewed by Oliver.
+
+        Fix for &lt;rdar://5105009&gt; Prepare for fix to send mousedown and mouseup (but not click) events when right-clicking
+
+        * page/EventHandler.cpp: Don't ever send click events for right-clicks.
+        (WebCore::EventHandler::handleMouseDoubleClickEvent):
+        (WebCore::EventHandler::handleMouseReleaseEvent):
+        
+        Check that the mousedown and mouseup are not with the right button before performing default behavior.
+        * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::defaultEventHandler):
+        * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler):
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
+        (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
+        * html/HTMLTextFieldInnerElement.cpp:
+        (WebCore::HTMLSearchFieldResultsButtonElement::defaultEventHandler):
+        (WebCore::HTMLSearchFieldCancelButtonElement::defaultEventHandler):
+        * ksvg2/svg/SVGAElement.cpp:(WebCore::SVGAElement::defaultEventHandler):
+        * rendering/RenderFrameSet.cpp: (WebCore::RenderFrameSet::userResize):
+        * rendering/RenderSlider.cpp: (WebCore::HTMLSliderThumbElement::defaultEventHandler):
+
</ins><span class="cx"> 2007-04-03  Justin Garcia  &lt;justin.garcia@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by darin
</span></span></pre></div>
<a id="trunkWebCorehtmlHTMLAnchorElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/html/HTMLAnchorElement.cpp (20708 => 20709)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/html/HTMLAnchorElement.cpp        2007-04-04 20:52:39 UTC (rev 20708)
+++ trunk/WebCore/html/HTMLAnchorElement.cpp        2007-04-05 01:05:49 UTC (rev 20709)
</span><span class="lines">@@ -221,7 +221,7 @@
</span><span class="cx">     } else if (m_isLink &amp;&amp; isContentEditable()) {
</span><span class="cx">     // This keeps track of the editable block that the selection was in (if it was in one) just before the link was clicked
</span><span class="cx">     // for the LiveWhenNotFocused editable link behavior
</span><del>-        if (evt-&gt;type() == mousedownEvent &amp;&amp; document()-&gt;frame() &amp;&amp; document()-&gt;frame()-&gt;selectionController()) {
</del><ins>+        if (evt-&gt;type() == mousedownEvent &amp;&amp; static_cast&lt;MouseEvent*&gt;(evt)-&gt;button() != RightButton &amp;&amp; document()-&gt;frame() &amp;&amp; document()-&gt;frame()-&gt;selectionController()) {
</ins><span class="cx">             MouseEvent* e = static_cast&lt;MouseEvent*&gt;(evt);
</span><span class="cx"> 
</span><span class="cx">             m_rootEditableElementForSelectionOnMouseDown = document()-&gt;frame()-&gt;selectionController()-&gt;rootEditableElement();
</span></span></pre></div>
<a id="trunkWebCorehtmlHTMLInputElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/html/HTMLInputElement.cpp (20708 => 20709)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/html/HTMLInputElement.cpp        2007-04-04 20:52:39 UTC (rev 20708)
+++ trunk/WebCore/html/HTMLInputElement.cpp        2007-04-05 01:05:49 UTC (rev 20709)
</span><span class="lines">@@ -1046,7 +1046,7 @@
</span><span class="cx">     // This result gives us enough info to perform the &quot;undo&quot; in postDispatch of the action we take here.
</span><span class="cx">     void* result = 0; 
</span><span class="cx">     if ((inputType() == CHECKBOX || inputType() == RADIO) &amp;&amp; evt-&gt;isMouseEvent()
</span><del>-            &amp;&amp; evt-&gt;type() == clickEvent &amp;&amp; static_cast&lt;MouseEvent*&gt;(evt)-&gt;button() == 0) {
</del><ins>+            &amp;&amp; evt-&gt;type() == clickEvent &amp;&amp; static_cast&lt;MouseEvent*&gt;(evt)-&gt;button() == LeftButton) {
</ins><span class="cx">         if (inputType() == CHECKBOX) {
</span><span class="cx">             // As a way to store the state, we return 0 if we were unchecked, 1 if we were checked, and 2 for
</span><span class="cx">             // indeterminate.
</span><span class="lines">@@ -1084,7 +1084,7 @@
</span><span class="cx"> void HTMLInputElement::postDispatchEventHandler(Event *evt, void* data)
</span><span class="cx"> {
</span><span class="cx">     if ((inputType() == CHECKBOX || inputType() == RADIO) &amp;&amp; evt-&gt;isMouseEvent()
</span><del>-            &amp;&amp; evt-&gt;type() == clickEvent &amp;&amp; static_cast&lt;MouseEvent*&gt;(evt)-&gt;button() == 0) {
</del><ins>+            &amp;&amp; evt-&gt;type() == clickEvent &amp;&amp; static_cast&lt;MouseEvent*&gt;(evt)-&gt;button() == LeftButton) {
</ins><span class="cx">         if (inputType() == CHECKBOX) {
</span><span class="cx">             // Reverse the checking we did in preDispatch.
</span><span class="cx">             if (evt-&gt;defaultPrevented() || evt-&gt;defaultHandled()) {
</span><span class="lines">@@ -1309,7 +1309,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (inputType() == RANGE &amp;&amp; renderer()) {
</span><span class="cx">         RenderSlider* slider = static_cast&lt;RenderSlider*&gt;(renderer());
</span><del>-        if (evt-&gt;isMouseEvent() &amp;&amp; evt-&gt;type() == mousedownEvent) {
</del><ins>+        if (evt-&gt;isMouseEvent() &amp;&amp; evt-&gt;type() == mousedownEvent &amp;&amp; static_cast&lt;MouseEvent*&gt;(evt)-&gt;button() == LeftButton) {
</ins><span class="cx">             MouseEvent* mEvt = static_cast&lt;MouseEvent*&gt;(evt);
</span><span class="cx">             if (!slider-&gt;mouseEventIsInThumb(mEvt)) {
</span><span class="cx">                 slider-&gt;setValueForPosition(slider-&gt;positionForOffset(IntPoint(mEvt-&gt;offsetX(), mEvt-&gt;offsetY())));
</span></span></pre></div>
<a id="trunkWebCorehtmlHTMLSelectElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/html/HTMLSelectElement.cpp (20708 => 20709)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/html/HTMLSelectElement.cpp        2007-04-04 20:52:39 UTC (rev 20708)
+++ trunk/WebCore/html/HTMLSelectElement.cpp        2007-04-05 01:05:49 UTC (rev 20709)
</span><span class="lines">@@ -672,7 +672,7 @@
</span><span class="cx">             evt-&gt;setDefaultHandled();
</span><span class="cx"> 
</span><span class="cx">     }
</span><del>-    if (evt-&gt;type() == mousedownEvent) {
</del><ins>+    if (evt-&gt;type() == mousedownEvent &amp;&amp; static_cast&lt;MouseEvent*&gt;(evt)-&gt;button() == LeftButton) {
</ins><span class="cx">         focus();
</span><span class="cx">         if (menuList-&gt;popupIsVisible())
</span><span class="cx">             menuList-&gt;hidePopup();
</span><span class="lines">@@ -691,7 +691,7 @@
</span><span class="cx">     if (!renderer() || !renderer()-&gt;canSelect())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (evt-&gt;type() == mousedownEvent) {
</del><ins>+    if (evt-&gt;type() == mousedownEvent &amp;&amp; static_cast&lt;MouseEvent*&gt;(evt)-&gt;button() == LeftButton) {
</ins><span class="cx">         focus();
</span><span class="cx">         
</span><span class="cx">         MouseEvent* mEvt = static_cast&lt;MouseEvent*&gt;(evt);
</span><span class="lines">@@ -751,7 +751,7 @@
</span><span class="cx"> 
</span><span class="cx">             evt-&gt;setDefaultHandled();
</span><span class="cx">         }
</span><del>-    } else if (evt-&gt;type() == mouseupEvent &amp;&amp; document()-&gt;frame()-&gt;eventHandler()-&gt;autoscrollRenderer() != renderer())
</del><ins>+    } else if (evt-&gt;type() == mouseupEvent &amp;&amp; static_cast&lt;MouseEvent*&gt;(evt)-&gt;button() == LeftButton &amp;&amp; document()-&gt;frame()-&gt;eventHandler()-&gt;autoscrollRenderer() != renderer())
</ins><span class="cx">         // This makes sure we fire onChange for a single click.  For drag selection, onChange will fire when the autoscroll timer stops.
</span><span class="cx">         listBoxOnChange();
</span><span class="cx">     else if (evt-&gt;type() == keypressEvent) {
</span></span></pre></div>
<a id="trunkWebCorehtmlHTMLTextFieldInnerElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/html/HTMLTextFieldInnerElement.cpp (20708 => 20709)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/html/HTMLTextFieldInnerElement.cpp        2007-04-04 20:52:39 UTC (rev 20708)
+++ trunk/WebCore/html/HTMLTextFieldInnerElement.cpp        2007-04-05 01:05:49 UTC (rev 20709)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;HTMLInputElement.h&quot;
</span><span class="cx"> #include &quot;HTMLTextAreaElement.h&quot;
</span><ins>+#include &quot;MouseEvent.h&quot;
</ins><span class="cx"> #include &quot;RenderTextControl.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -76,7 +77,7 @@
</span><span class="cx"> {
</span><span class="cx">     // On mousedown, bring up a menu, if needed
</span><span class="cx">     HTMLInputElement* input = static_cast&lt;HTMLInputElement*&gt;(shadowAncestorNode());
</span><del>-    if (evt-&gt;type() == mousedownEvent) {
</del><ins>+    if (evt-&gt;type() == mousedownEvent &amp;&amp; static_cast&lt;MouseEvent*&gt;(evt)-&gt;button() == LeftButton) {
</ins><span class="cx">         input-&gt;focus();
</span><span class="cx">         input-&gt;select();
</span><span class="cx">         if (input &amp;&amp; input-&gt;renderer() &amp;&amp; static_cast&lt;RenderTextControl*&gt;(input-&gt;renderer())-&gt;popupIsVisible())
</span><span class="lines">@@ -99,14 +100,14 @@
</span><span class="cx"> {
</span><span class="cx">     // If the element is visible, on mouseup, clear the value, and set selection
</span><span class="cx">     HTMLInputElement* input = static_cast&lt;HTMLInputElement*&gt;(shadowAncestorNode());
</span><del>-    if (evt-&gt;type() == mousedownEvent) {
</del><ins>+    if (evt-&gt;type() == mousedownEvent &amp;&amp; static_cast&lt;MouseEvent*&gt;(evt)-&gt;button() == LeftButton) {
</ins><span class="cx">         input-&gt;focus();
</span><span class="cx">         input-&gt;select();
</span><span class="cx">         evt-&gt;setDefaultHandled();
</span><span class="cx">         if (Frame* frame = document()-&gt;frame())
</span><span class="cx">             frame-&gt;eventHandler()-&gt;setCapturingMouseEventsNode(this);
</span><span class="cx">         m_capturing = true;
</span><del>-    } else if (evt-&gt;type() == mouseupEvent) {
</del><ins>+    } else if (evt-&gt;type() == mouseupEvent &amp;&amp; static_cast&lt;MouseEvent*&gt;(evt)-&gt;button() == LeftButton) {
</ins><span class="cx">         if (m_capturing &amp;&amp; renderer() &amp;&amp; renderer()-&gt;style()-&gt;visibility() == VISIBLE) {
</span><span class="cx">             if (hovered()) {
</span><span class="cx">                 input-&gt;setValue(&quot;&quot;);
</span></span></pre></div>
<a id="trunkWebCoreksvg2svgSVGAElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ksvg2/svg/SVGAElement.cpp (20708 => 20709)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ksvg2/svg/SVGAElement.cpp        2007-04-04 20:52:39 UTC (rev 20708)
+++ trunk/WebCore/ksvg2/svg/SVGAElement.cpp        2007-04-05 01:05:49 UTC (rev 20709)
</span><span class="lines">@@ -95,7 +95,7 @@
</span><span class="cx"> void SVGAElement::defaultEventHandler(Event* evt)
</span><span class="cx"> {
</span><span class="cx">     // TODO : should use CLICK instead
</span><del>-    if ((evt-&gt;type() == EventNames::mouseupEvent &amp;&amp; m_isLink)) {
</del><ins>+    if ((evt-&gt;type() == EventNames::mouseupEvent &amp;&amp; static_cast&lt;MouseEvent*&gt;(evt)-&gt;button() != RightButton &amp;&amp; m_isLink)) {
</ins><span class="cx">         MouseEvent* e = static_cast&lt;MouseEvent*&gt;(evt);
</span><span class="cx"> 
</span><span class="cx">         if (e &amp;&amp; e-&gt;button() == RightButton) {
</span></span></pre></div>
<a id="trunkWebCorepageEventHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/page/EventHandler.cpp (20708 => 20709)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/page/EventHandler.cpp        2007-04-04 20:52:39 UTC (rev 20708)
+++ trunk/WebCore/page/EventHandler.cpp        2007-04-05 01:05:49 UTC (rev 20709)
</span><span class="lines">@@ -849,7 +849,8 @@
</span><span class="cx">     bool swallowMouseUpEvent = dispatchMouseEvent(mouseupEvent, mev.targetNode(), true, m_clickCount, mouseEvent, false);
</span><span class="cx"> 
</span><span class="cx">     bool swallowClickEvent = false;
</span><del>-    if (mev.targetNode() == m_clickNode)
</del><ins>+    // Don't ever dispatch click events for right clicks
+    if (mouseEvent.button() != RightButton &amp;&amp; mev.targetNode() == m_clickNode)
</ins><span class="cx">         swallowClickEvent = dispatchMouseEvent(clickEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true);
</span><span class="cx"> 
</span><span class="cx">     bool swallowMouseReleaseEvent = false;
</span><span class="lines">@@ -954,8 +955,9 @@
</span><span class="cx"> 
</span><span class="cx">     bool swallowMouseUpEvent = dispatchMouseEvent(mouseupEvent, mev.targetNode(), true, m_clickCount, mouseEvent, false);
</span><span class="cx"> 
</span><ins>+    // Don't ever dispatch click events for right clicks
</ins><span class="cx">     bool swallowClickEvent = false;
</span><del>-    if (m_clickCount &gt; 0 &amp;&amp; mev.targetNode() == m_clickNode)
</del><ins>+    if (m_clickCount &gt; 0 &amp;&amp; mouseEvent.button() != RightButton &amp;&amp; mev.targetNode() == m_clickNode)
</ins><span class="cx">         swallowClickEvent = dispatchMouseEvent(clickEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true);
</span><span class="cx"> 
</span><span class="cx">     if (m_resizeLayer) {
</span></span></pre></div>
<a id="trunkWebCorerenderingRenderFrameSetcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderFrameSet.cpp (20708 => 20709)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderFrameSet.cpp        2007-04-04 20:52:39 UTC (rev 20708)
+++ trunk/WebCore/rendering/RenderFrameSet.cpp        2007-04-05 01:05:49 UTC (rev 20709)
</span><span class="lines">@@ -556,7 +556,7 @@
</span><span class="cx">     if (!m_isResizing) {
</span><span class="cx">         if (needsLayout())
</span><span class="cx">             return false;
</span><del>-        if (evt-&gt;type() == mousedownEvent) {
</del><ins>+        if (evt-&gt;type() == mousedownEvent &amp;&amp; evt-&gt;button() == LeftButton) {
</ins><span class="cx">             startResizing(m_cols, evt-&gt;pageX() - xPos());
</span><span class="cx">             startResizing(m_rows, evt-&gt;pageY() - yPos());
</span><span class="cx">             if (m_cols.m_splitBeingResized != noSplit || m_rows.m_splitBeingResized != noSplit) {
</span><span class="lines">@@ -565,10 +565,10 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     } else {
</span><del>-        if (evt-&gt;type() == mousemoveEvent || evt-&gt;type() == mouseupEvent) {
</del><ins>+        if (evt-&gt;type() == mousemoveEvent || (evt-&gt;type() == mouseupEvent &amp;&amp; evt-&gt;button() == LeftButton)) {
</ins><span class="cx">             continueResizing(m_cols, evt-&gt;pageX() - xPos());
</span><span class="cx">             continueResizing(m_rows, evt-&gt;pageY() - yPos());
</span><del>-            if (evt-&gt;type() == mouseupEvent) {
</del><ins>+            if (evt-&gt;type() == mouseupEvent &amp;&amp; evt-&gt;button() == 0) {
</ins><span class="cx">                 setIsResizing(false);
</span><span class="cx">                 return true;
</span><span class="cx">             }
</span></span></pre></div>
<a id="trunkWebCorerenderingRenderSlidercpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderSlider.cpp (20708 => 20709)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderSlider.cpp        2007-04-04 20:52:39 UTC (rev 20708)
+++ trunk/WebCore/rendering/RenderSlider.cpp        2007-04-05 01:05:49 UTC (rev 20709)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx"> void HTMLSliderThumbElement::defaultEventHandler(Event* event)
</span><span class="cx"> {
</span><span class="cx">     const AtomicString&amp; eventType = event-&gt;type();
</span><del>-    if (eventType == mousedownEvent &amp;&amp; event-&gt;isMouseEvent()) {
</del><ins>+    if (eventType == mousedownEvent &amp;&amp; event-&gt;isMouseEvent() &amp;&amp; static_cast&lt;MouseEvent*&gt;(event)-&gt;button() == LeftButton) {
</ins><span class="cx">         MouseEvent* mouseEvent = static_cast&lt;MouseEvent*&gt;(event);
</span><span class="cx">         if (document()-&gt;frame() &amp;&amp; renderer() &amp;&amp; renderer()-&gt;parent()
</span><span class="cx">                 &amp;&amp; static_cast&lt;RenderSlider*&gt;(renderer()-&gt;parent())-&gt;mouseEventIsInThumb(mouseEvent)) {
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx">             event-&gt;setDefaultHandled();
</span><span class="cx">             return;
</span><span class="cx">         }
</span><del>-    } else if (eventType == mouseupEvent) {
</del><ins>+    } else if (eventType == mouseupEvent &amp;&amp; static_cast&lt;MouseEvent*&gt;(event)-&gt;button() == LeftButton) {
</ins><span class="cx">         if (m_inDragMode) {
</span><span class="cx">             if (Frame* frame = document()-&gt;frame())
</span><span class="cx">                 frame-&gt;eventHandler()-&gt;setCapturingMouseEventsNode(0);      
</span></span></pre>
</div>
</div>

</body>
</html>