diff options
author | Christian Persch <chpe@src.gnome.org> | 2008-12-27 20:06:02 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2008-12-27 20:06:02 +0800 |
commit | d641360ee8e645b9662bf8d13aa80adf8764ba22 (patch) | |
tree | 983234fbc3d97416068411adf3f73d7996c2c7cd | |
parent | 3f4cc11ed7e5826bba9e7ce0b1a47072d2e9fc35 (diff) | |
download | gsoc2013-epiphany-d641360ee8e645b9662bf8d13aa80adf8764ba22.tar gsoc2013-epiphany-d641360ee8e645b9662bf8d13aa80adf8764ba22.tar.gz gsoc2013-epiphany-d641360ee8e645b9662bf8d13aa80adf8764ba22.tar.bz2 gsoc2013-epiphany-d641360ee8e645b9662bf8d13aa80adf8764ba22.tar.lz gsoc2013-epiphany-d641360ee8e645b9662bf8d13aa80adf8764ba22.tar.xz gsoc2013-epiphany-d641360ee8e645b9662bf8d13aa80adf8764ba22.tar.zst gsoc2013-epiphany-d641360ee8e645b9662bf8d13aa80adf8764ba22.zip |
More gecko 1.9.1 fixes.
svn path=/branches/gnome-2-24/; revision=8645
-rw-r--r-- | embed/mozilla/EventContext.cpp | 27 | ||||
-rw-r--r-- | m4/gecko.m4 | 11 |
2 files changed, 33 insertions, 5 deletions
diff --git a/embed/mozilla/EventContext.cpp b/embed/mozilla/EventContext.cpp index 0cc04fe6b..12e0ea42e 100644 --- a/embed/mozilla/EventContext.cpp +++ b/embed/mozilla/EventContext.cpp @@ -67,11 +67,14 @@ #ifdef ALLOW_PRIVATE_API #include <nsIDOMNSEvent.h> -#include <nsIDOMNSHTMLElement.h> #include <nsIDOMViewCSS.h> #include <nsIDOMViewCSS.h> #include <nsIDOMXULDocument.h> #include <nsITextToSubURI.h> +#include <nsIDOMNSHTMLElement.h> +#ifdef HAVE_GECKO_1_9_1 +#include <nsIDOMNSElement.h> +#endif #endif #include "ephy-debug.h" @@ -666,20 +669,34 @@ nsresult EventContext::GetCSSBackground (nsIDOMNode *node, nsAString& url) nsresult EventContext::GetTargetCoords (nsIDOMEventTarget *aTarget, PRInt32 *aX, PRInt32 *aY) { /* Calculate the node coordinates relative to the widget origin */ - nsCOMPtr<nsIDOMNSHTMLElement> elem (do_QueryInterface(aTarget)); + + nsCOMPtr<nsIDOMNSHTMLElement> htmlElem (do_QueryInterface(aTarget)); +#ifdef HAVE_GECKO_1_9_1 + nsCOMPtr<nsIDOMNSElement> elem (do_QueryInterface(htmlElem)); +#endif PRInt32 x = 0, y = 0; - while (elem) + while (htmlElem) { PRInt32 val; +#ifdef HAVE_GECKO_1_9_1 elem->GetOffsetTop(&val); y += val; elem->GetScrollTop(&val); y -= val; elem->GetOffsetLeft(&val); x += val; elem->GetScrollLeft(&val); x -= val; +#else + htmlElem->GetOffsetTop(&val); y += val; + htmlElem->GetScrollTop(&val); y -= val; + htmlElem->GetOffsetLeft(&val); x += val; + htmlElem->GetScrollLeft(&val); x -= val; +#endif nsCOMPtr<nsIDOMElement> parent; - elem->GetOffsetParent (getter_AddRefs (parent)); - elem = do_QueryInterface(parent); + htmlElem->GetOffsetParent (getter_AddRefs (parent)); + htmlElem = do_QueryInterface(parent); +#ifdef HAVE_GECKO_1_9_1 + elem = do_QueryInterface (parent); +#endif } *aX = x; diff --git a/m4/gecko.m4 b/m4/gecko.m4 index 6e6136ed1..fc0e0d505 100644 --- a/m4/gecko.m4 +++ b/m4/gecko.m4 @@ -346,6 +346,16 @@ if test "$gecko_cv_gecko_version_int" -ge "1009000"; then gecko_cv_have_gecko_1_9=yes fi +if test "${gecko_cv_gecko}" = "libxul-embedding" -o "${gecko_cv_gecko}" = "libxul"; then + PKG_CHECK_EXISTS([${gecko_cv_gecko} >= 1.9.1],[gecko_cv_have_gecko_1_9_1=yes],[gecko_cv_have_gecko_1_9_1=no]) +else + gecko_cv_have_gecko_1_9_1=no +fi + +if test "gecko_cv_have_gecko_1_9_1" = "yes"; then + AC_DEFINE([HAVE_GECKO_1_9_1],[1],[Define if we have gecko 1.9.1]) +fi + fi # if gecko_cv_have_gecko $1[]_VERSION=$gecko_cv_gecko_version @@ -393,6 +403,7 @@ AM_CONDITIONAL([HAVE_GECKO_1_7],[test "$gecko_cv_have_gecko" = "yes" -a "$gecko_ AM_CONDITIONAL([HAVE_GECKO_1_8],[test "$gecko_cv_have_gecko" = "yes" -a "$gecko_cv_gecko_version_int" -ge "1008000"]) AM_CONDITIONAL([HAVE_GECKO_1_8_1],[test "$gecko_cv_have_gecko" = "yes" -a "$gecko_cv_gecko_version_int" -ge "1008001"]) AM_CONDITIONAL([HAVE_GECKO_1_9],[test "$gecko_cv_have_gecko" = "yes" -a "$gecko_cv_gecko_version_int" -ge "1009000"]) +AM_CONDITIONAL([HAVE_GECKO_1_9_1],[test "$gecko_cv_have_gecko" = "yes" -a "$gecko_cv_have_gecko_1_9_1" = "yes"]) AM_CONDITIONAL([HAVE_GECKO_HOME],[test "x$_GECKO_HOME" != "x"]) AM_CONDITIONAL([HAVE_GECKO_DEBUG],[test "$gecko_cv_have_debug" = "yes"]) AM_CONDITIONAL([HAVE_GECKO_XPCOM_GLUE],[test "$gecko_cv_have_xpcom_glue" = "yes"]) |