[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
kocienda
kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:11:11 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 5fe9d7be1eac5f836b1379e45baf309e86466aa2
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Nov 12 16:49:17 2003 +0000
Reviewed by Maciej
* khtml/html/html_elementimpl.cpp:
(HTMLElementImpl::click): Implemented a programmatic click function for
elements.
* khtml/html/html_elementimpl.h:
* khtml/html/html_formimpl.cpp:
(HTMLFormElementImpl::submitClick): Implemented a programmatic click function for
elements.
(HTMLInputElementImpl::click): This implementation calls through
to Cocoa button programmatic click function to get user interface
feedback for button elements, and calls through to the superclass
for other elements.
* khtml/html/html_formimpl.h:
* khtml/html/html_inlineimpl.cpp: Removed click() function for anchors.
No longer needed.
* khtml/html/html_inlineimpl.h: Ditto.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5464 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index d00fb32..6ef533b 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,23 @@
+2003-11-12 Ken Kocienda <kocienda at apple.com>
+
+ Reviewed by Maciej
+
+ * khtml/html/html_elementimpl.cpp:
+ (HTMLElementImpl::click): Implemented a programmatic click function for
+ elements.
+ * khtml/html/html_elementimpl.h:
+ * khtml/html/html_formimpl.cpp:
+ (HTMLFormElementImpl::submitClick): Implemented a programmatic click function for
+ elements.
+ (HTMLInputElementImpl::click): This implementation calls through
+ to Cocoa button programmatic click function to get user interface
+ feedback for button elements, and calls through to the superclass
+ for other elements.
+ * khtml/html/html_formimpl.h:
+ * khtml/html/html_inlineimpl.cpp: Removed click() function for anchors.
+ No longer needed.
+ * khtml/html/html_inlineimpl.h: Ditto.
+
2003-11-12 David Hyatt <hyatt at apple.com>
Fix build bustage in deployment builds.
diff --git a/WebCore/khtml/html/html_elementimpl.cpp b/WebCore/khtml/html/html_elementimpl.cpp
index 28c98bf..8de86c5 100644
--- a/WebCore/khtml/html/html_elementimpl.cpp
+++ b/WebCore/khtml/html/html_elementimpl.cpp
@@ -609,6 +609,20 @@ void HTMLElementImpl::setContentEditable(const DOMString &enabled) {
}
}
+void HTMLElementImpl::click()
+{
+ int x = 0;
+ int y = 0;
+ if (renderer()) {
+ renderer()->absolutePosition(x,y);
+ x += renderer()->width() / 2;
+ y += renderer()->height() / 2;
+ }
+ // always send click
+ QMouseEvent evt(QEvent::MouseButtonRelease, QPoint(x,y), Qt::LeftButton, 0);
+ dispatchMouseEvent(&evt, EventImpl::KHTML_CLICK_EVENT);
+}
+
// -------------------------------------------------------------------------
HTMLGenericElementImpl::HTMLGenericElementImpl(DocumentPtr *doc, ushort i)
: HTMLElementImpl(doc)
diff --git a/WebCore/khtml/html/html_elementimpl.h b/WebCore/khtml/html/html_elementimpl.h
index a0dc686..66a2ddf 100644
--- a/WebCore/khtml/html/html_elementimpl.h
+++ b/WebCore/khtml/html/html_elementimpl.h
@@ -65,6 +65,8 @@ public:
virtual DOMString contentEditable() const;
virtual void setContentEditable(const DOMString &enabled);
+ virtual void click();
+
#if APPLE_CHANGES
virtual bool isGenericFormElement() const { return false; }
#endif
diff --git a/WebCore/khtml/html/html_formimpl.cpp b/WebCore/khtml/html/html_formimpl.cpp
index eda5071..29a2489 100644
--- a/WebCore/khtml/html/html_formimpl.cpp
+++ b/WebCore/khtml/html/html_formimpl.cpp
@@ -152,18 +152,7 @@ void HTMLFormElementImpl::submitClick()
HTMLInputElementImpl *element = static_cast<HTMLInputElementImpl *>(it.current());
if (element->isSuccessfulSubmitButton() && element->renderer()) {
submitFound = true;
- if (element->inputType() == HTMLInputElementImpl::IMAGE) {
- // have to send simulated clicks differently for image types
- // since they do not have a widget
- int x = 0;
- int y = 0;
- element->renderer()->absolutePosition(x,y);
- QMouseEvent e2(QEvent::MouseButtonRelease, QPoint(x,y), Qt::LeftButton, 0);
- element->dispatchMouseEvent(&e2, EventImpl::KHTML_CLICK_EVENT);
- }
- else {
- static_cast<QButton *>(static_cast<RenderWidget *>(element->renderer())->widget())->click();
- }
+ element->click();
break;
}
}
@@ -1099,7 +1088,6 @@ bool HTMLButtonElementImpl::encoding(const QTextCodec* codec, khtml::encodingLis
return true;
}
-
// -------------------------------------------------------------------------
HTMLFieldSetElementImpl::HTMLFieldSetElementImpl(DocumentPtr *doc, HTMLFormElementImpl *f)
@@ -1262,12 +1250,33 @@ void HTMLInputElementImpl::select( )
static_cast<RenderFileButton*>(m_render)->select();
}
-void HTMLInputElementImpl::click( )
+void HTMLInputElementImpl::click()
{
- // ###
-#ifdef FORMS_DEBUG
- kdDebug( 6030 ) << " HTMLInputElementImpl::click( )" << endl;
+ switch (inputType()) {
+ case HIDDEN:
+ // a no-op for this type
+ break;
+ case CHECKBOX:
+ case RADIO:
+ case SUBMIT:
+ case RESET:
+ case BUTTON:
+#if APPLE_CHANGES
+ {
+ QWidget *widget;
+ if (renderer() && (widget = static_cast<RenderWidget *>(renderer())->widget())) {
+ // using this method gives us nice Cocoa user interface feedback
+ static_cast<QButton *>(widget)->click();
+ }
+ else
+ HTMLGenericFormElementImpl::click();
+ break;
+ }
#endif
+ default:
+ HTMLGenericFormElementImpl::click();
+ break;
+ }
}
void HTMLInputElementImpl::parseAttribute(AttributeImpl *attr)
diff --git a/WebCore/khtml/html/html_formimpl.h b/WebCore/khtml/html/html_formimpl.h
index 77d4ee1..e8ee6ad 100644
--- a/WebCore/khtml/html/html_formimpl.h
+++ b/WebCore/khtml/html/html_formimpl.h
@@ -299,7 +299,8 @@ public:
virtual void restoreState(QStringList &);
void select();
- void click();
+
+ virtual void click();
virtual void parseAttribute(AttributeImpl *attr);
diff --git a/WebCore/khtml/html/html_inlineimpl.cpp b/WebCore/khtml/html/html_inlineimpl.cpp
index 5ee195c..64a3d67 100644
--- a/WebCore/khtml/html/html_inlineimpl.cpp
+++ b/WebCore/khtml/html/html_inlineimpl.cpp
@@ -189,19 +189,6 @@ void HTMLAnchorElementImpl::parseAttribute(AttributeImpl *attr)
}
}
-void HTMLAnchorElementImpl::click()
-{
- int x = 0;
- int y = 0;
- if (renderer()) {
- renderer()->absolutePosition(x,y);
- x += renderer()->width() / 2;
- y += renderer()->height() / 2;
- }
- QMouseEvent event(QEvent::MouseButtonRelease, QPoint(x,y), Qt::LeftButton, 0);
- dispatchMouseEvent(&event, EventImpl::KHTML_CLICK_EVENT);
-}
-
// -------------------------------------------------------------------------
HTMLBRElementImpl::HTMLBRElementImpl(DocumentPtr *doc) : HTMLElementImpl(doc)
diff --git a/WebCore/khtml/html/html_inlineimpl.h b/WebCore/khtml/html/html_inlineimpl.h
index 74003d1..6c4458b 100644
--- a/WebCore/khtml/html/html_inlineimpl.h
+++ b/WebCore/khtml/html/html_inlineimpl.h
@@ -43,7 +43,6 @@ public:
virtual Id id() const;
virtual void parseAttribute(AttributeImpl *attr);
virtual void defaultEventHandler(EventImpl *evt);
- void click();
protected:
bool m_hasTarget : 1;
};
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list