author | Sylvestre Ledru <sledru@mozilla.com> |
Wed, 01 May 2019 08:47:10 +0000 | |
changeset 472056 | e1993a1f09ac53cd1a04fdf6a87f8cad8e44f73e |
parent 472055 | 25e1607e6f1e5345cccb8eb501b7cbdad182f9fb |
child 472057 | 8ccd4b2a5fbaee6cd2c1326521082fe32c07556a |
push id | 35946 |
push user | apavel@mozilla.com |
push date | Wed, 01 May 2019 15:54:31 +0000 |
treeherder | mozilla-central@a027a998b8b7 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | Ehsan |
bugs | 1547143 |
milestone | 68.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/accessible/atk/UtilInterface.cpp +++ b/accessible/atk/UtilInterface.cpp @@ -19,54 +19,54 @@ using namespace mozilla::a11y; typedef AtkUtil MaiUtil; typedef AtkUtilClass MaiUtilClass; #define MAI_VERSION MOZILLA_VERSION #define MAI_NAME "Gecko" extern "C" { static guint (*gail_add_global_event_listener)(GSignalEmissionHook listener, - const gchar *event_type); + const gchar* event_type); static void (*gail_remove_global_event_listener)(guint remove_listener); static void (*gail_remove_key_event_listener)(guint remove_listener); -static AtkObject *(*gail_get_root)(); +static AtkObject* (*gail_get_root)(); } struct MaiUtilListenerInfo { gint key; guint signal_id; gulong hook_id; // For window create/destory/minimize/maximize/restore/activate/deactivate // events, we'll chain gail_util's add/remove_global_event_listener. // So we store the listenerid returned by gail's add_global_event_listener // in this structure to call gail's remove_global_event_listener later. guint gail_listenerid; }; -static GHashTable *sListener_list = nullptr; +static GHashTable* sListener_list = nullptr; static gint sListener_idx = 1; extern "C" { static guint add_listener(GSignalEmissionHook listener, - const gchar *object_type, const gchar *signal, - const gchar *hook_data, guint gail_listenerid = 0) { + const gchar* object_type, const gchar* signal, + const gchar* hook_data, guint gail_listenerid = 0) { GType type; guint signal_id; gint rc = 0; type = g_type_from_name(object_type); if (type) { signal_id = g_signal_lookup(signal, type); if (signal_id > 0) { - MaiUtilListenerInfo *listener_info; + MaiUtilListenerInfo* listener_info; rc = sListener_idx; listener_info = - (MaiUtilListenerInfo *)g_malloc(sizeof(MaiUtilListenerInfo)); + (MaiUtilListenerInfo*)g_malloc(sizeof(MaiUtilListenerInfo)); listener_info->key = sListener_idx; listener_info->hook_id = g_signal_add_emission_hook( signal_id, 0, listener, g_strdup(hook_data), (GDestroyNotify)g_free); listener_info->signal_id = signal_id; listener_info->gail_listenerid = gail_listenerid; g_hash_table_insert(sListener_list, &(listener_info->key), listener_info); sListener_idx++; @@ -75,19 +75,19 @@ static guint add_listener(GSignalEmissio } } else { g_warning("Invalid object type %s\n", object_type); } return rc; } static guint mai_util_add_global_event_listener(GSignalEmissionHook listener, - const gchar *event_type) { + const gchar* event_type) { guint rc = 0; - gchar **split_string; + gchar** split_string; split_string = g_strsplit(event_type, ":", 3); if (split_string) { if (!strcmp("window", split_string[0])) { guint gail_listenerid = 0; if (gail_add_global_event_listener) { // call gail's function to track gtk native window events @@ -101,21 +101,21 @@ static guint mai_util_add_global_event_l } g_strfreev(split_string); } return rc; } static void mai_util_remove_global_event_listener(guint remove_listener) { if (remove_listener > 0) { - MaiUtilListenerInfo *listener_info; + MaiUtilListenerInfo* listener_info; gint tmp_idx = remove_listener; listener_info = - (MaiUtilListenerInfo *)g_hash_table_lookup(sListener_list, &tmp_idx); + (MaiUtilListenerInfo*)g_hash_table_lookup(sListener_list, &tmp_idx); if (listener_info != nullptr) { if (gail_remove_global_event_listener && listener_info->gail_listenerid) { gail_remove_global_event_listener(listener_info->gail_listenerid); } /* Hook id of 0 and signal id of 0 are invalid */ if (listener_info->hook_id != 0 && listener_info->signal_id != 0) { @@ -139,18 +139,18 @@ static void mai_util_remove_global_event g_warning("No listener with the specified listener id %d", remove_listener); } } else { g_warning("Invalid listener_id %d", remove_listener); } } -static AtkKeyEventStruct *atk_key_event_from_gdk_event_key(GdkEventKey *key) { - AtkKeyEventStruct *event = g_new0(AtkKeyEventStruct, 1); +static AtkKeyEventStruct* atk_key_event_from_gdk_event_key(GdkEventKey* key) { + AtkKeyEventStruct* event = g_new0(AtkKeyEventStruct, 1); switch (key->type) { case GDK_KEY_PRESS: event->type = ATK_KEY_EVENT_PRESS; break; case GDK_KEY_RELEASE: event->type = ATK_KEY_EVENT_RELEASE; break; default: @@ -168,48 +168,48 @@ static AtkKeyEventStruct *atk_key_event_ } event->keycode = key->hardware_keycode; event->timestamp = key->time; return event; } struct MaiKeyEventInfo { - AtkKeyEventStruct *key_event; + AtkKeyEventStruct* key_event; gpointer func_data; }; union AtkKeySnoopFuncPointer { AtkKeySnoopFunc func_ptr; gpointer data; }; static gboolean notify_hf(gpointer key, gpointer value, gpointer data) { - MaiKeyEventInfo *info = (MaiKeyEventInfo *)data; + MaiKeyEventInfo* info = (MaiKeyEventInfo*)data; AtkKeySnoopFuncPointer atkKeySnoop; atkKeySnoop.data = value; return (atkKeySnoop.func_ptr)(info->key_event, info->func_data) ? TRUE : FALSE; } static void insert_hf(gpointer key, gpointer value, gpointer data) { - GHashTable *new_table = (GHashTable *)data; + GHashTable* new_table = (GHashTable*)data; g_hash_table_insert(new_table, key, value); } -static GHashTable *sKey_listener_list = nullptr; +static GHashTable* sKey_listener_list = nullptr; -static gint mai_key_snooper(GtkWidget *the_widget, GdkEventKey *event, +static gint mai_key_snooper(GtkWidget* the_widget, GdkEventKey* event, gpointer func_data) { /* notify each AtkKeySnoopFunc in turn... */ - MaiKeyEventInfo *info = g_new0(MaiKeyEventInfo, 1); + MaiKeyEventInfo* info = g_new0(MaiKeyEventInfo, 1); gint consumed = 0; if (sKey_listener_list) { - GHashTable *new_hash = g_hash_table_new(nullptr, nullptr); + GHashTable* new_hash = g_hash_table_new(nullptr, nullptr); g_hash_table_foreach(sKey_listener_list, insert_hf, new_hash); info->key_event = atk_key_event_from_gdk_event_key(event); info->func_data = func_data; consumed = g_hash_table_foreach_steal(new_hash, notify_hf, info); g_hash_table_destroy(new_hash); g_free(info->key_event); } g_free(info); @@ -252,50 +252,50 @@ static void mai_util_remove_key_event_li } g_hash_table_remove(sKey_listener_list, GUINT_TO_POINTER(remove_listener)); if (g_hash_table_size(sKey_listener_list) == 0) { gtk_key_snooper_remove(sKey_snooper_id); } } -static AtkObject *mai_util_get_root() { - ApplicationAccessible *app = ApplicationAcc(); +static AtkObject* mai_util_get_root() { + ApplicationAccessible* app = ApplicationAcc(); if (app) return app->GetAtkObject(); // We've shutdown, try to use gail instead // (to avoid assert in spi_atk_tidy_windows()) // XXX tbsaunde then why didn't we replace the gail atk_util impl? if (gail_get_root) return gail_get_root(); return nullptr; } -static const gchar *mai_util_get_toolkit_name() { return MAI_NAME; } +static const gchar* mai_util_get_toolkit_name() { return MAI_NAME; } -static const gchar *mai_util_get_toolkit_version() { return MAI_VERSION; } +static const gchar* mai_util_get_toolkit_version() { return MAI_VERSION; } static void _listener_info_destroy(gpointer data) { g_free(data); } -static void window_added(AtkObject *atk_obj, guint index, AtkObject *child) { +static void window_added(AtkObject* atk_obj, guint index, AtkObject* child) { if (!IS_MAI_OBJECT(child)) return; static guint id = g_signal_lookup("create", MAI_TYPE_ATK_OBJECT); g_signal_emit(child, id, 0); } -static void window_removed(AtkObject *atk_obj, guint index, AtkObject *child) { +static void window_removed(AtkObject* atk_obj, guint index, AtkObject* child) { if (!IS_MAI_OBJECT(child)) return; static guint id = g_signal_lookup("destroy", MAI_TYPE_ATK_OBJECT); g_signal_emit(child, id, 0); } -static void UtilInterfaceInit(MaiUtilClass *klass) { - AtkUtilClass *atk_class; +static void UtilInterfaceInit(MaiUtilClass* klass) { + AtkUtilClass* atk_class; gpointer data; data = g_type_class_peek(ATK_TYPE_UTIL); atk_class = ATK_UTIL_CLASS(data); // save gail function pointer gail_add_global_event_listener = atk_class->add_global_event_listener; gail_remove_global_event_listener = atk_class->remove_global_event_listener; @@ -309,17 +309,17 @@ static void UtilInterfaceInit(MaiUtilCla atk_class->remove_key_event_listener = mai_util_remove_key_event_listener; atk_class->get_root = mai_util_get_root; atk_class->get_toolkit_name = mai_util_get_toolkit_name; atk_class->get_toolkit_version = mai_util_get_toolkit_version; sListener_list = g_hash_table_new_full(g_int_hash, g_int_equal, nullptr, _listener_info_destroy); // Keep track of added/removed windows. - AtkObject *root = atk_get_root(); + AtkObject* root = atk_get_root(); g_signal_connect(root, "children-changed::add", (GCallback)window_added, nullptr); g_signal_connect(root, "children-changed::remove", (GCallback)window_removed, nullptr); } } GType mai_util_get_type() {
--- a/accessible/atk/nsMaiHyperlink.cpp +++ b/accessible/atk/nsMaiHyperlink.cpp @@ -33,44 +33,44 @@ using namespace mozilla::a11y; struct MaiAtkHyperlink { AtkHyperlink parent; /* * The MaiHyperlink whose properties and features are exported via this * hyperlink instance. */ - MaiHyperlink *maiHyperlink; + MaiHyperlink* maiHyperlink; }; struct MaiAtkHyperlinkClass { AtkHyperlinkClass parent_class; }; GType mai_atk_hyperlink_get_type(void); G_BEGIN_DECLS /* callbacks for AtkHyperlink */ -static void classInitCB(AtkHyperlinkClass *aClass); -static void finalizeCB(GObject *aObj); +static void classInitCB(AtkHyperlinkClass* aClass); +static void finalizeCB(GObject* aObj); /* callbacks for AtkHyperlink virtual functions */ -static gchar *getUriCB(AtkHyperlink *aLink, gint aLinkIndex); -static AtkObject *getObjectCB(AtkHyperlink *aLink, gint aLinkIndex); -static gint getEndIndexCB(AtkHyperlink *aLink); -static gint getStartIndexCB(AtkHyperlink *aLink); -static gboolean isValidCB(AtkHyperlink *aLink); -static gint getAnchorCountCB(AtkHyperlink *aLink); +static gchar* getUriCB(AtkHyperlink* aLink, gint aLinkIndex); +static AtkObject* getObjectCB(AtkHyperlink* aLink, gint aLinkIndex); +static gint getEndIndexCB(AtkHyperlink* aLink); +static gint getStartIndexCB(AtkHyperlink* aLink); +static gboolean isValidCB(AtkHyperlink* aLink); +static gint getAnchorCountCB(AtkHyperlink* aLink); G_END_DECLS static gpointer parent_class = nullptr; -static MaiHyperlink *GetMaiHyperlink(AtkHyperlink *aHyperlink) { +static MaiHyperlink* GetMaiHyperlink(AtkHyperlink* aHyperlink) { NS_ENSURE_TRUE(MAI_IS_ATK_HYPERLINK(aHyperlink), nullptr); - MaiHyperlink *maiHyperlink = MAI_ATK_HYPERLINK(aHyperlink)->maiHyperlink; + MaiHyperlink* maiHyperlink = MAI_ATK_HYPERLINK(aHyperlink)->maiHyperlink; NS_ENSURE_TRUE(maiHyperlink != nullptr, nullptr); NS_ENSURE_TRUE(maiHyperlink->GetAtkHyperlink() == aHyperlink, nullptr); return maiHyperlink; } GType mai_atk_hyperlink_get_type(void) { static GType type = 0; @@ -91,136 +91,136 @@ GType mai_atk_hyperlink_get_type(void) { type = g_type_register_static(ATK_TYPE_HYPERLINK, "MaiAtkHyperlink", &tinfo, GTypeFlags(0)); } return type; } MaiHyperlink::MaiHyperlink(AccessibleOrProxy aHyperLink) : mHyperlink(aHyperLink), mMaiAtkHyperlink(nullptr) { - mMaiAtkHyperlink = reinterpret_cast<AtkHyperlink *>( + mMaiAtkHyperlink = reinterpret_cast<AtkHyperlink*>( g_object_new(mai_atk_hyperlink_get_type(), nullptr)); NS_ASSERTION(mMaiAtkHyperlink, "OUT OF MEMORY"); if (!mMaiAtkHyperlink) return; MAI_ATK_HYPERLINK(mMaiAtkHyperlink)->maiHyperlink = this; } MaiHyperlink::~MaiHyperlink() { if (mMaiAtkHyperlink) { MAI_ATK_HYPERLINK(mMaiAtkHyperlink)->maiHyperlink = nullptr; g_object_unref(mMaiAtkHyperlink); } } /* static functions for ATK callbacks */ -void classInitCB(AtkHyperlinkClass *aClass) { - GObjectClass *gobject_class = G_OBJECT_CLASS(aClass); +void classInitCB(AtkHyperlinkClass* aClass) { + GObjectClass* gobject_class = G_OBJECT_CLASS(aClass); parent_class = g_type_class_peek_parent(aClass); aClass->get_uri = getUriCB; aClass->get_object = getObjectCB; aClass->get_end_index = getEndIndexCB; aClass->get_start_index = getStartIndexCB; aClass->is_valid = isValidCB; aClass->get_n_anchors = getAnchorCountCB; gobject_class->finalize = finalizeCB; } -void finalizeCB(GObject *aObj) { +void finalizeCB(GObject* aObj) { NS_ASSERTION(MAI_IS_ATK_HYPERLINK(aObj), "Invalid MaiAtkHyperlink"); if (!MAI_IS_ATK_HYPERLINK(aObj)) return; - MaiAtkHyperlink *maiAtkHyperlink = MAI_ATK_HYPERLINK(aObj); + MaiAtkHyperlink* maiAtkHyperlink = MAI_ATK_HYPERLINK(aObj); maiAtkHyperlink->maiHyperlink = nullptr; /* call parent finalize function */ if (G_OBJECT_CLASS(parent_class)->finalize) G_OBJECT_CLASS(parent_class)->finalize(aObj); } -gchar *getUriCB(AtkHyperlink *aLink, gint aLinkIndex) { - MaiHyperlink *maiLink = GetMaiHyperlink(aLink); +gchar* getUriCB(AtkHyperlink* aLink, gint aLinkIndex) { + MaiHyperlink* maiLink = GetMaiHyperlink(aLink); if (!maiLink) return nullptr; nsAutoCString cautoStr; - if (Accessible *hyperlink = maiLink->GetAccHyperlink()) { + if (Accessible* hyperlink = maiLink->GetAccHyperlink()) { nsCOMPtr<nsIURI> uri = hyperlink->AnchorURIAt(aLinkIndex); if (!uri) return nullptr; nsresult rv = uri->GetSpec(cautoStr); NS_ENSURE_SUCCESS(rv, nullptr); return g_strdup(cautoStr.get()); } bool valid; maiLink->Proxy()->AnchorURIAt(aLinkIndex, cautoStr, &valid); if (!valid) return nullptr; return g_strdup(cautoStr.get()); } -AtkObject *getObjectCB(AtkHyperlink *aLink, gint aLinkIndex) { - MaiHyperlink *maiLink = GetMaiHyperlink(aLink); +AtkObject* getObjectCB(AtkHyperlink* aLink, gint aLinkIndex) { + MaiHyperlink* maiLink = GetMaiHyperlink(aLink); if (!maiLink) { return nullptr; } - if (Accessible *hyperlink = maiLink->GetAccHyperlink()) { - Accessible *anchor = hyperlink->AnchorAt(aLinkIndex); + if (Accessible* hyperlink = maiLink->GetAccHyperlink()) { + Accessible* anchor = hyperlink->AnchorAt(aLinkIndex); NS_ENSURE_TRUE(anchor, nullptr); return AccessibleWrap::GetAtkObject(anchor); } - ProxyAccessible *anchor = maiLink->Proxy()->AnchorAt(aLinkIndex); + ProxyAccessible* anchor = maiLink->Proxy()->AnchorAt(aLinkIndex); return anchor ? GetWrapperFor(anchor) : nullptr; } -gint getEndIndexCB(AtkHyperlink *aLink) { - MaiHyperlink *maiLink = GetMaiHyperlink(aLink); +gint getEndIndexCB(AtkHyperlink* aLink) { + MaiHyperlink* maiLink = GetMaiHyperlink(aLink); if (!maiLink) return false; - if (Accessible *hyperlink = maiLink->GetAccHyperlink()) + if (Accessible* hyperlink = maiLink->GetAccHyperlink()) return static_cast<gint>(hyperlink->EndOffset()); bool valid = false; uint32_t endIdx = maiLink->Proxy()->EndOffset(&valid); return valid ? static_cast<gint>(endIdx) : -1; } -gint getStartIndexCB(AtkHyperlink *aLink) { - MaiHyperlink *maiLink = GetMaiHyperlink(aLink); +gint getStartIndexCB(AtkHyperlink* aLink) { + MaiHyperlink* maiLink = GetMaiHyperlink(aLink); if (!maiLink) return -1; - if (Accessible *hyperlink = maiLink->GetAccHyperlink()) + if (Accessible* hyperlink = maiLink->GetAccHyperlink()) return static_cast<gint>(hyperlink->StartOffset()); bool valid = false; uint32_t startIdx = maiLink->Proxy()->StartOffset(&valid); return valid ? static_cast<gint>(startIdx) : -1; } -gboolean isValidCB(AtkHyperlink *aLink) { - MaiHyperlink *maiLink = GetMaiHyperlink(aLink); +gboolean isValidCB(AtkHyperlink* aLink) { + MaiHyperlink* maiLink = GetMaiHyperlink(aLink); if (!maiLink) return false; - if (Accessible *hyperlink = maiLink->GetAccHyperlink()) + if (Accessible* hyperlink = maiLink->GetAccHyperlink()) return static_cast<gboolean>(hyperlink->IsLinkValid()); return static_cast<gboolean>(maiLink->Proxy()->IsLinkValid()); } -gint getAnchorCountCB(AtkHyperlink *aLink) { - MaiHyperlink *maiLink = GetMaiHyperlink(aLink); +gint getAnchorCountCB(AtkHyperlink* aLink) { + MaiHyperlink* maiLink = GetMaiHyperlink(aLink); if (!maiLink) return -1; - if (Accessible *hyperlink = maiLink->GetAccHyperlink()) + if (Accessible* hyperlink = maiLink->GetAccHyperlink()) return static_cast<gint>(hyperlink->AnchorCount()); bool valid = false; uint32_t anchorCount = maiLink->Proxy()->AnchorCount(&valid); return valid ? static_cast<gint>(anchorCount) : -1; }
--- a/accessible/base/nsCoreUtils.cpp +++ b/accessible/base/nsCoreUtils.cpp @@ -38,41 +38,41 @@ #include "mozilla/dom/Selection.h" using namespace mozilla; //////////////////////////////////////////////////////////////////////////////// // nsCoreUtils //////////////////////////////////////////////////////////////////////////////// -bool nsCoreUtils::IsLabelWithControl(nsIContent *aContent) { - dom::HTMLLabelElement *label = dom::HTMLLabelElement::FromNode(aContent); +bool nsCoreUtils::IsLabelWithControl(nsIContent* aContent) { + dom::HTMLLabelElement* label = dom::HTMLLabelElement::FromNode(aContent); if (label && label->GetControl()) return true; return false; } -bool nsCoreUtils::HasClickListener(nsIContent *aContent) { +bool nsCoreUtils::HasClickListener(nsIContent* aContent) { NS_ENSURE_TRUE(aContent, false); - EventListenerManager *listenerManager = + EventListenerManager* listenerManager = aContent->GetExistingListenerManager(); return listenerManager && (listenerManager->HasListenersFor(nsGkAtoms::onclick) || listenerManager->HasListenersFor(nsGkAtoms::onmousedown) || listenerManager->HasListenersFor(nsGkAtoms::onmouseup)); } -void nsCoreUtils::DispatchClickEvent(XULTreeElement *aTree, int32_t aRowIndex, - nsTreeColumn *aColumn, - const nsAString &aPseudoElt) { +void nsCoreUtils::DispatchClickEvent(XULTreeElement* aTree, int32_t aRowIndex, + nsTreeColumn* aColumn, + const nsAString& aPseudoElt) { RefPtr<dom::Element> tcElm = aTree->GetTreeBody(); if (!tcElm) return; - Document *document = tcElm->GetUncomposedDoc(); + Document* document = tcElm->GetUncomposedDoc(); if (!document) return; RefPtr<PresShell> presShell = document->GetPresShell(); if (!presShell) { return; } // Ensure row is visible. @@ -87,17 +87,17 @@ void nsCoreUtils::DispatchClickEvent(XUL } RefPtr<DOMRect> treeBodyRect = tcElm->GetBoundingClientRect(); int32_t tcX = (int32_t)treeBodyRect->X(); int32_t tcY = (int32_t)treeBodyRect->Y(); // Dispatch mouse events. AutoWeakFrame tcFrame = tcElm->GetPrimaryFrame(); - nsIFrame *rootFrame = presShell->GetRootFrame(); + nsIFrame* rootFrame = presShell->GetRootFrame(); nsPoint offset; nsCOMPtr<nsIWidget> rootWidget = rootFrame->GetView()->GetNearestWidget(&offset); RefPtr<nsPresContext> presContext = presShell->GetPresContext(); int32_t cnvdX = presContext->CSSPixelsToDevPixels(tcX + int32_t(rect.x) + 1) + @@ -109,38 +109,38 @@ void nsCoreUtils::DispatchClickEvent(XUL DispatchMouseEvent(eMouseDown, cnvdX, cnvdY, tcElm, tcFrame, presShell, rootWidget); DispatchMouseEvent(eMouseUp, cnvdX, cnvdY, tcElm, tcFrame, presShell, rootWidget); } void nsCoreUtils::DispatchMouseEvent(EventMessage aMessage, int32_t aX, - int32_t aY, nsIContent *aContent, - nsIFrame *aFrame, PresShell *aPresShell, - nsIWidget *aRootWidget) { + int32_t aY, nsIContent* aContent, + nsIFrame* aFrame, PresShell* aPresShell, + nsIWidget* aRootWidget) { WidgetMouseEvent event(true, aMessage, aRootWidget, WidgetMouseEvent::eReal, WidgetMouseEvent::eNormal); event.mRefPoint = LayoutDeviceIntPoint(aX, aY); event.mClickCount = 1; event.mButton = MouseButton::eLeft; event.mTime = PR_IntervalNow(); event.mInputSource = dom::MouseEvent_Binding::MOZ_SOURCE_UNKNOWN; nsEventStatus status = nsEventStatus_eIgnore; aPresShell->HandleEventWithTarget(&event, aFrame, aContent, &status); } void nsCoreUtils::DispatchTouchEvent(EventMessage aMessage, int32_t aX, - int32_t aY, nsIContent *aContent, - nsIFrame *aFrame, PresShell *aPresShell, - nsIWidget *aRootWidget) { - nsIDocShell *docShell = nullptr; + int32_t aY, nsIContent* aContent, + nsIFrame* aFrame, PresShell* aPresShell, + nsIWidget* aRootWidget) { + nsIDocShell* docShell = nullptr; if (aPresShell->GetDocument()) { docShell = aPresShell->GetDocument()->GetDocShell(); } if (!dom::TouchEvent::PrefEnabled(docShell)) { return; } WidgetTouchEvent event(true, aMessage, aRootWidget); @@ -151,85 +151,85 @@ void nsCoreUtils::DispatchTouchEvent(Eve RefPtr<dom::Touch> t = new dom::Touch(-1, LayoutDeviceIntPoint(aX, aY), LayoutDeviceIntPoint(1, 1), 0.0f, 1.0f); t->SetTouchTarget(aContent); event.mTouches.AppendElement(t); nsEventStatus status = nsEventStatus_eIgnore; aPresShell->HandleEventWithTarget(&event, aFrame, aContent, &status); } -uint32_t nsCoreUtils::GetAccessKeyFor(nsIContent *aContent) { +uint32_t nsCoreUtils::GetAccessKeyFor(nsIContent* aContent) { // Accesskeys are registered by @accesskey attribute only. At first check // whether it is presented on the given element to avoid the slow // EventStateManager::GetRegisteredAccessKey() method. if (!aContent->IsElement() || !aContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::accesskey)) return 0; - nsPresContext *presContext = aContent->OwnerDoc()->GetPresContext(); + nsPresContext* presContext = aContent->OwnerDoc()->GetPresContext(); if (!presContext) return 0; - EventStateManager *esm = presContext->EventStateManager(); + EventStateManager* esm = presContext->EventStateManager(); if (!esm) return 0; return esm->GetRegisteredAccessKey(aContent->AsElement()); } -nsIContent *nsCoreUtils::GetDOMElementFor(nsIContent *aContent) { +nsIContent* nsCoreUtils::GetDOMElementFor(nsIContent* aContent) { if (aContent->IsElement()) return aContent; if (aContent->IsText()) return aContent->GetFlattenedTreeParent(); return nullptr; } -nsINode *nsCoreUtils::GetDOMNodeFromDOMPoint(nsINode *aNode, uint32_t aOffset) { +nsINode* nsCoreUtils::GetDOMNodeFromDOMPoint(nsINode* aNode, uint32_t aOffset) { if (aNode && aNode->IsElement()) { uint32_t childCount = aNode->GetChildCount(); NS_ASSERTION(aOffset <= childCount, "Wrong offset of the DOM point!"); // The offset can be after last child of container node that means DOM point // is placed immediately after the last child. In this case use the DOM node // from the given DOM point is used as result node. if (aOffset != childCount) return aNode->GetChildAt_Deprecated(aOffset); } return aNode; } -bool nsCoreUtils::IsAncestorOf(nsINode *aPossibleAncestorNode, - nsINode *aPossibleDescendantNode, - nsINode *aRootNode) { +bool nsCoreUtils::IsAncestorOf(nsINode* aPossibleAncestorNode, + nsINode* aPossibleDescendantNode, + nsINode* aRootNode) { NS_ENSURE_TRUE(aPossibleAncestorNode && aPossibleDescendantNode, false); - nsINode *parentNode = aPossibleDescendantNode; + nsINode* parentNode = aPossibleDescendantNode; while ((parentNode = parentNode->GetParentNode()) && parentNode != aRootNode) { if (parentNode == aPossibleAncestorNode) return true; } return false; } -nsresult nsCoreUtils::ScrollSubstringTo(nsIFrame *aFrame, nsRange *aRange, +nsresult nsCoreUtils::ScrollSubstringTo(nsIFrame* aFrame, nsRange* aRange, uint32_t aScrollType) { ScrollAxis vertical, horizontal; ConvertScrollTypeToPercents(aScrollType, &vertical, &horizontal); return ScrollSubstringTo(aFrame, aRange, vertical, horizontal); } -nsresult nsCoreUtils::ScrollSubstringTo(nsIFrame *aFrame, nsRange *aRange, +nsresult nsCoreUtils::ScrollSubstringTo(nsIFrame* aFrame, nsRange* aRange, ScrollAxis aVertical, ScrollAxis aHorizontal) { if (!aFrame || !aRange) { return NS_ERROR_FAILURE; } - nsPresContext *presContext = aFrame->PresContext(); + nsPresContext* presContext = aFrame->PresContext(); nsCOMPtr<nsISelectionController> selCon; aFrame->GetSelectionController(presContext, getter_AddRefs(selCon)); NS_ENSURE_TRUE(selCon, NS_ERROR_FAILURE); RefPtr<dom::Selection> selection = selCon->GetSelection(nsISelectionController::SELECTION_ACCESSIBILITY); @@ -240,36 +240,36 @@ nsresult nsCoreUtils::ScrollSubstringTo( aVertical, aHorizontal, Selection::SCROLL_SYNCHRONOUS); selection->CollapseToStart(IgnoreErrors()); return NS_OK; } -void nsCoreUtils::ScrollFrameToPoint(nsIFrame *aScrollableFrame, - nsIFrame *aFrame, - const nsIntPoint &aPoint) { - nsIScrollableFrame *scrollableFrame = do_QueryFrame(aScrollableFrame); +void nsCoreUtils::ScrollFrameToPoint(nsIFrame* aScrollableFrame, + nsIFrame* aFrame, + const nsIntPoint& aPoint) { + nsIScrollableFrame* scrollableFrame = do_QueryFrame(aScrollableFrame); if (!scrollableFrame) return; nsPoint point = ToAppUnits(aPoint, aFrame->PresContext()->AppUnitsPerDevPixel()); nsRect frameRect = aFrame->GetScreenRectInAppUnits(); nsPoint deltaPoint = point - frameRect.TopLeft(); nsPoint scrollPoint = scrollableFrame->GetScrollPosition(); scrollPoint -= deltaPoint; scrollableFrame->ScrollTo(scrollPoint, ScrollMode::Instant); } void nsCoreUtils::ConvertScrollTypeToPercents(uint32_t aScrollType, - ScrollAxis *aVertical, - ScrollAxis *aHorizontal) { + ScrollAxis* aVertical, + ScrollAxis* aHorizontal) { WhereToScroll whereY, whereX; WhenToScroll whenY, whenX; switch (aScrollType) { case nsIAccessibleScrollType::SCROLL_TYPE_TOP_LEFT: whereY = kScrollToTop; whenY = WhenToScroll::Always; whereX = kScrollToLeft; whenX = WhenToScroll::Always; @@ -309,94 +309,94 @@ void nsCoreUtils::ConvertScrollTypeToPer whenY = WhenToScroll::IfNotFullyVisible; whereX = kScrollMinimum; whenX = WhenToScroll::IfNotFullyVisible; } *aVertical = ScrollAxis(whereY, whenY); *aHorizontal = ScrollAxis(whereX, whenX); } -nsIntPoint nsCoreUtils::GetScreenCoordsForWindow(nsINode *aNode) { +nsIntPoint nsCoreUtils::GetScreenCoordsForWindow(nsINode* aNode) { nsIntPoint coords(0, 0); nsCOMPtr<nsIDocShellTreeItem> treeItem(GetDocShellFor(aNode)); if (!treeItem) return coords; nsCOMPtr<nsIDocShellTreeOwner> treeOwner; treeItem->GetTreeOwner(getter_AddRefs(treeOwner)); if (!treeOwner) return coords; nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(treeOwner); if (baseWindow) baseWindow->GetPosition(&coords.x, &coords.y); // in device pixels return coords; } -already_AddRefed<nsIDocShell> nsCoreUtils::GetDocShellFor(nsINode *aNode) { +already_AddRefed<nsIDocShell> nsCoreUtils::GetDocShellFor(nsINode* aNode) { if (!aNode) return nullptr; nsCOMPtr<nsIDocShell> docShell = aNode->OwnerDoc()->GetDocShell(); return docShell.forget(); } -bool nsCoreUtils::IsRootDocument(Document *aDocument) { +bool nsCoreUtils::IsRootDocument(Document* aDocument) { nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = aDocument->GetDocShell(); NS_ASSERTION(docShellTreeItem, "No document shell for document!"); nsCOMPtr<nsIDocShellTreeItem> parentTreeItem; docShellTreeItem->GetParent(getter_AddRefs(parentTreeItem)); return !parentTreeItem; } -bool nsCoreUtils::IsContentDocument(Document *aDocument) { +bool nsCoreUtils::IsContentDocument(Document* aDocument) { nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = aDocument->GetDocShell(); NS_ASSERTION(docShellTreeItem, "No document shell tree item for document!"); return (docShellTreeItem->ItemType() == nsIDocShellTreeItem::typeContent); } -bool nsCoreUtils::IsTabDocument(Document *aDocumentNode) { +bool nsCoreUtils::IsTabDocument(Document* aDocumentNode) { nsCOMPtr<nsIDocShellTreeItem> treeItem(aDocumentNode->GetDocShell()); nsCOMPtr<nsIDocShellTreeItem> parentTreeItem; treeItem->GetParent(getter_AddRefs(parentTreeItem)); // Tab document running in own process doesn't have parent. if (XRE_IsContentProcess()) return !parentTreeItem; // Parent of docshell for tab document running in chrome process is root. nsCOMPtr<nsIDocShellTreeItem> rootTreeItem; treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem)); return parentTreeItem == rootTreeItem; } -bool nsCoreUtils::IsErrorPage(Document *aDocument) { - nsIURI *uri = aDocument->GetDocumentURI(); +bool nsCoreUtils::IsErrorPage(Document* aDocument) { + nsIURI* uri = aDocument->GetDocumentURI(); bool isAboutScheme = false; uri->SchemeIs("about", &isAboutScheme); if (!isAboutScheme) return false; nsAutoCString path; uri->GetPathQueryRef(path); NS_NAMED_LITERAL_CSTRING(neterror, "neterror"); NS_NAMED_LITERAL_CSTRING(certerror, "certerror"); return StringBeginsWith(path, neterror) || StringBeginsWith(path, certerror); } -bool nsCoreUtils::GetID(nsIContent *aContent, nsAString &aID) { +bool nsCoreUtils::GetID(nsIContent* aContent, nsAString& aID) { return aContent->IsElement() && aContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::id, aID); } -bool nsCoreUtils::GetUIntAttr(nsIContent *aContent, nsAtom *aAttr, - int32_t *aUInt) { +bool nsCoreUtils::GetUIntAttr(nsIContent* aContent, nsAtom* aAttr, + int32_t* aUInt) { nsAutoString value; if (!aContent->IsElement()) { return false; } aContent->AsElement()->GetAttr(kNameSpaceID_None, aAttr, value); if (!value.IsEmpty()) { nsresult error = NS_OK; int32_t integer = value.ToInteger(&error); @@ -404,121 +404,121 @@ bool nsCoreUtils::GetUIntAttr(nsIContent *aUInt = integer; return true; } } return false; } -void nsCoreUtils::GetLanguageFor(nsIContent *aContent, nsIContent *aRootContent, - nsAString &aLanguage) { +void nsCoreUtils::GetLanguageFor(nsIContent* aContent, nsIContent* aRootContent, + nsAString& aLanguage) { aLanguage.Truncate(); - nsIContent *walkUp = aContent; + nsIContent* walkUp = aContent; while (walkUp && walkUp != aRootContent && (!walkUp->IsElement() || !walkUp->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::lang, aLanguage))) walkUp = walkUp->GetParent(); } -XULTreeElement *nsCoreUtils::GetTree(nsIContent *aContent) { +XULTreeElement* nsCoreUtils::GetTree(nsIContent* aContent) { // Find DOMNode's parents recursively until reach the <tree> tag - nsIContent *currentContent = aContent; + nsIContent* currentContent = aContent; while (currentContent) { if (currentContent->NodeInfo()->Equals(nsGkAtoms::tree, kNameSpaceID_XUL)) { return XULTreeElement::FromNode(currentContent); } currentContent = currentContent->GetFlattenedTreeParent(); } return nullptr; } already_AddRefed<nsTreeColumn> nsCoreUtils::GetFirstSensibleColumn( - XULTreeElement *aTree) { + XULTreeElement* aTree) { RefPtr<nsTreeColumns> cols = aTree->GetColumns(); if (!cols) return nullptr; RefPtr<nsTreeColumn> column = cols->GetFirstColumn(); if (column && IsColumnHidden(column)) return GetNextSensibleColumn(column); return column.forget(); } -uint32_t nsCoreUtils::GetSensibleColumnCount(XULTreeElement *aTree) { +uint32_t nsCoreUtils::GetSensibleColumnCount(XULTreeElement* aTree) { uint32_t count = 0; RefPtr<nsTreeColumns> cols = aTree->GetColumns(); if (!cols) return count; - nsTreeColumn *column = cols->GetFirstColumn(); + nsTreeColumn* column = cols->GetFirstColumn(); while (column) { if (!IsColumnHidden(column)) count++; column = column->GetNext(); } return count; } already_AddRefed<nsTreeColumn> nsCoreUtils::GetSensibleColumnAt( - XULTreeElement *aTree, uint32_t aIndex) { + XULTreeElement* aTree, uint32_t aIndex) { uint32_t idx = aIndex; nsCOMPtr<nsTreeColumn> column = GetFirstSensibleColumn(aTree); while (column) { if (idx == 0) return column.forget(); idx--; column = GetNextSensibleColumn(column); } return nullptr; } already_AddRefed<nsTreeColumn> nsCoreUtils::GetNextSensibleColumn( - nsTreeColumn *aColumn) { + nsTreeColumn* aColumn) { RefPtr<nsTreeColumn> nextColumn = aColumn->GetNext(); while (nextColumn && IsColumnHidden(nextColumn)) { nextColumn = nextColumn->GetNext(); } return nextColumn.forget(); } already_AddRefed<nsTreeColumn> nsCoreUtils::GetPreviousSensibleColumn( - nsTreeColumn *aColumn) { + nsTreeColumn* aColumn) { RefPtr<nsTreeColumn> prevColumn = aColumn->GetPrevious(); while (prevColumn && IsColumnHidden(prevColumn)) { prevColumn = prevColumn->GetPrevious(); } return prevColumn.forget(); } -bool nsCoreUtils::IsColumnHidden(nsTreeColumn *aColumn) { - Element *element = aColumn->Element(); +bool nsCoreUtils::IsColumnHidden(nsTreeColumn* aColumn) { + Element* element = aColumn->Element(); return element->AttrValueIs(kNameSpaceID_None, nsGkAtoms::hidden, nsGkAtoms::_true, eCaseMatters); } -void nsCoreUtils::ScrollTo(PresShell *aPresShell, nsIContent *aContent, +void nsCoreUtils::ScrollTo(PresShell* aPresShell, nsIContent* aContent, uint32_t aScrollType) { ScrollAxis vertical, horizontal; ConvertScrollTypeToPercents(aScrollType, &vertical, &horizontal); aPresShell->ScrollContentIntoView(aContent, vertical, horizontal, ScrollFlags::ScrollOverflowHidden); } -bool nsCoreUtils::IsWhitespaceString(const nsAString &aString) { +bool nsCoreUtils::IsWhitespaceString(const nsAString& aString) { nsAString::const_char_iterator iterBegin, iterEnd; aString.BeginReading(iterBegin); aString.EndReading(iterEnd); while (iterBegin != iterEnd && IsWhitespace(*iterBegin)) ++iterBegin; return iterBegin == iterEnd;
--- a/accessible/base/nsCoreUtils.h +++ b/accessible/base/nsCoreUtils.h @@ -34,282 +34,282 @@ class XULTreeElement; class nsCoreUtils { public: typedef mozilla::PresShell PresShell; typedef mozilla::dom::Document Document; /** * Return true if the given node is a label of a control. */ - static bool IsLabelWithControl(nsIContent *aContent); + static bool IsLabelWithControl(nsIContent* aContent); /** * Return true if the given node has registered click, mousedown or mouseup * event listeners. */ - static bool HasClickListener(nsIContent *aContent); + static bool HasClickListener(nsIContent* aContent); /** * Dispatch click event to XUL tree cell. * * @param aTree [in] tree * @param aRowIndex [in] row index * @param aColumn [in] column object * @param aPseudoElm [in] pseudo element inside the cell, see * XULTreeElement for available values */ MOZ_CAN_RUN_SCRIPT - static void DispatchClickEvent(mozilla::dom::XULTreeElement *aTree, - int32_t aRowIndex, nsTreeColumn *aColumn, - const nsAString &aPseudoElt = EmptyString()); + static void DispatchClickEvent(mozilla::dom::XULTreeElement* aTree, + int32_t aRowIndex, nsTreeColumn* aColumn, + const nsAString& aPseudoElt = EmptyString()); /** * Send mouse event to the given element. * * @param aMessage [in] an event message (see EventForwards.h) * @param aX [in] x coordinate in dev pixels * @param aY [in] y coordinate in dev pixels * @param aContent [in] the element * @param aFrame [in] frame of the element * @param aPresShell [in] the presshell for the element * @param aRootWidget [in] the root widget of the element */ MOZ_CAN_RUN_SCRIPT static void DispatchMouseEvent(mozilla::EventMessage aMessage, int32_t aX, - int32_t aY, nsIContent *aContent, - nsIFrame *aFrame, PresShell *aPresShell, - nsIWidget *aRootWidget); + int32_t aY, nsIContent* aContent, + nsIFrame* aFrame, PresShell* aPresShell, + nsIWidget* aRootWidget); /** * Send a touch event with a single touch point to the given element. * * @param aMessage [in] an event message (see EventForwards.h) * @param aX [in] x coordinate in dev pixels * @param aY [in] y coordinate in dev pixels * @param aContent [in] the element * @param aFrame [in] frame of the element * @param aPresShell [in] the presshell for the element * @param aRootWidget [in] the root widget of the element */ MOZ_CAN_RUN_SCRIPT static void DispatchTouchEvent(mozilla::EventMessage aMessage, int32_t aX, - int32_t aY, nsIContent *aContent, - nsIFrame *aFrame, PresShell *aPresShell, - nsIWidget *aRootWidget); + int32_t aY, nsIContent* aContent, + nsIFrame* aFrame, PresShell* aPresShell, + nsIWidget* aRootWidget); /** * Return an accesskey registered on the given element by * EventStateManager or 0 if there is no registered accesskey. * * @param aContent - the given element. */ - static uint32_t GetAccessKeyFor(nsIContent *aContent); + static uint32_t GetAccessKeyFor(nsIContent* aContent); /** * Return DOM element related with the given node, i.e. * a) itself if it is DOM element * b) parent element if it is text node * c) otherwise nullptr * * @param aNode [in] the given DOM node */ - static nsIContent *GetDOMElementFor(nsIContent *aContent); + static nsIContent* GetDOMElementFor(nsIContent* aContent); /** * Return DOM node for the given DOM point. */ - static nsINode *GetDOMNodeFromDOMPoint(nsINode *aNode, uint32_t aOffset); + static nsINode* GetDOMNodeFromDOMPoint(nsINode* aNode, uint32_t aOffset); /** * Is the first passed in node an ancestor of the second? * Note: A node is not considered to be the ancestor of itself. * * @param aPossibleAncestorNode [in] node to test for ancestor-ness of * aPossibleDescendantNode * @param aPossibleDescendantNode [in] node to test for descendant-ness of * aPossibleAncestorNode * @param aRootNode [in, optional] the root node that search * search should be performed within * @return true if aPossibleAncestorNode is an ancestor of * aPossibleDescendantNode */ - static bool IsAncestorOf(nsINode *aPossibleAncestorNode, - nsINode *aPossibleDescendantNode, - nsINode *aRootNode = nullptr); + static bool IsAncestorOf(nsINode* aPossibleAncestorNode, + nsINode* aPossibleDescendantNode, + nsINode* aRootNode = nullptr); /** * Helper method to scroll range into view, used for implementation of * nsIAccessibleText::scrollSubstringTo(). * * @param aFrame the frame for accessible the range belongs to. * @param aRange the range to scroll to * @param aScrollType the place a range should be scrolled to */ - static nsresult ScrollSubstringTo(nsIFrame *aFrame, nsRange *aRange, + static nsresult ScrollSubstringTo(nsIFrame* aFrame, nsRange* aRange, uint32_t aScrollType); /** Helper method to scroll range into view, used for implementation of * nsIAccessibleText::scrollSubstringTo[Point](). * * @param aFrame the frame for accessible the range belongs to. * @param aRange the range to scroll to * @param aVertical how to align vertically, specified in percents, and * when. * @param aHorizontal how to align horizontally, specified in percents, * and when. */ - static nsresult ScrollSubstringTo(nsIFrame *aFrame, nsRange *aRange, + static nsresult ScrollSubstringTo(nsIFrame* aFrame, nsRange* aRange, mozilla::ScrollAxis aVertical, mozilla::ScrollAxis aHorizontal); /** * Scrolls the given frame to the point, used for implememntation of * nsIAccessible::scrollToPoint and nsIAccessibleText::scrollSubstringToPoint. * * @param aScrollableFrame the scrollable frame * @param aFrame the frame to scroll * @param aPoint the point scroll to */ - static void ScrollFrameToPoint(nsIFrame *aScrollableFrame, nsIFrame *aFrame, - const nsIntPoint &aPoint); + static void ScrollFrameToPoint(nsIFrame* aScrollableFrame, nsIFrame* aFrame, + const nsIntPoint& aPoint); /** * Converts scroll type constant defined in nsIAccessibleScrollType to * vertical and horizontal parameters. */ static void ConvertScrollTypeToPercents(uint32_t aScrollType, - mozilla::ScrollAxis *aVertical, - mozilla::ScrollAxis *aHorizontal); + mozilla::ScrollAxis* aVertical, + mozilla::ScrollAxis* aHorizontal); /** * Returns coordinates in device pixels relative screen for the top level * window. * * @param aNode the DOM node hosted in the window. */ - static nsIntPoint GetScreenCoordsForWindow(nsINode *aNode); + static nsIntPoint GetScreenCoordsForWindow(nsINode* aNode); /** * Return document shell for the given DOM node. */ - static already_AddRefed<nsIDocShell> GetDocShellFor(nsINode *aNode); + static already_AddRefed<nsIDocShell> GetDocShellFor(nsINode* aNode); /** * Return true if the given document is root document. */ - static bool IsRootDocument(Document *aDocument); + static bool IsRootDocument(Document* aDocument); /** * Return true if the given document is content document (not chrome). */ - static bool IsContentDocument(Document *aDocument); + static bool IsContentDocument(Document* aDocument); /** * Return true if the given document node is for tab document accessible. */ - static bool IsTabDocument(Document *aDocumentNode); + static bool IsTabDocument(Document* aDocumentNode); /** * Return true if the given document is an error page. */ - static bool IsErrorPage(Document *aDocument); + static bool IsErrorPage(Document* aDocument); /** * Return presShell for the document containing the given DOM node. */ - static PresShell *GetPresShellFor(nsINode *aNode) { + static PresShell* GetPresShellFor(nsINode* aNode) { return aNode->OwnerDoc()->GetPresShell(); } /** * Get the ID for an element, in some types of XML this may not be the ID * attribute * @param aContent Node to get the ID for * @param aID Where to put ID string * @return true if there is an ID set for this node */ - static bool GetID(nsIContent *aContent, nsAString &aID); + static bool GetID(nsIContent* aContent, nsAString& aID); /** * Convert attribute value of the given node to positive integer. If no * attribute or wrong value then false is returned. */ - static bool GetUIntAttr(nsIContent *aContent, nsAtom *aAttr, int32_t *aUInt); + static bool GetUIntAttr(nsIContent* aContent, nsAtom* aAttr, int32_t* aUInt); /** * Returns language for the given node. * * @param aContent [in] the given node * @param aRootContent [in] container of the given node * @param aLanguage [out] language */ - static void GetLanguageFor(nsIContent *aContent, nsIContent *aRootContent, - nsAString &aLanguage); + static void GetLanguageFor(nsIContent* aContent, nsIContent* aRootContent, + nsAString& aLanguage); /** * Return tree from any levels DOMNode under the XUL tree. */ - static mozilla::dom::XULTreeElement *GetTree(nsIContent *aContent); + static mozilla::dom::XULTreeElement* GetTree(nsIContent* aContent); /** * Return first sensible column for the given tree box object. */ static already_AddRefed<nsTreeColumn> GetFirstSensibleColumn( - mozilla::dom::XULTreeElement *aTree); + mozilla::dom::XULTreeElement* aTree); /** * Return sensible columns count for the given tree box object. */ - static uint32_t GetSensibleColumnCount(mozilla::dom::XULTreeElement *aTree); + static uint32_t GetSensibleColumnCount(mozilla::dom::XULTreeElement* aTree); /** * Return sensible column at the given index for the given tree box object. */ static already_AddRefed<nsTreeColumn> GetSensibleColumnAt( - mozilla::dom::XULTreeElement *aTree, uint32_t aIndex); + mozilla::dom::XULTreeElement* aTree, uint32_t aIndex); /** * Return next sensible column for the given column. */ static already_AddRefed<nsTreeColumn> GetNextSensibleColumn( - nsTreeColumn *aColumn); + nsTreeColumn* aColumn); /** * Return previous sensible column for the given column. */ static already_AddRefed<nsTreeColumn> GetPreviousSensibleColumn( - nsTreeColumn *aColumn); + nsTreeColumn* aColumn); /** * Return true if the given column is hidden (i.e. not sensible). */ - static bool IsColumnHidden(nsTreeColumn *aColumn); + static bool IsColumnHidden(nsTreeColumn* aColumn); /** * Scroll content into view. */ MOZ_CAN_RUN_SCRIPT - static void ScrollTo(PresShell *aPresShell, nsIContent *aContent, + static void ScrollTo(PresShell* aPresShell, nsIContent* aContent, uint32_t aScrollType); /** * Return true if the given node is table header element. */ - static bool IsHTMLTableHeader(nsIContent *aContent) { + static bool IsHTMLTableHeader(nsIContent* aContent) { return aContent->NodeInfo()->Equals(nsGkAtoms::th) || (aContent->IsElement() && aContent->AsElement()->HasAttr( kNameSpaceID_None, nsGkAtoms::scope)); } /** * Returns true if the given string is empty or contains whitespace symbols * only. In contrast to nsWhitespaceTokenizer class it takes into account * non-breaking space (0xa0). */ - static bool IsWhitespaceString(const nsAString &aString); + static bool IsWhitespaceString(const nsAString& aString); /** * Returns true if the given character is whitespace symbol. */ static bool IsWhitespace(char16_t aChar) { return aChar == ' ' || aChar == '\n' || aChar == '\r' || aChar == '\t' || aChar == 0xa0; }
--- a/accessible/base/nsTextEquivUtils.h +++ b/accessible/base/nsTextEquivUtils.h @@ -43,116 +43,116 @@ class nsTextEquivUtils { /** * Determines if the accessible has a given name rule. * * @param aAccessible [in] the given accessible * @param aRule [in] a given name rule * @return true if the accessible has the rule */ - static inline bool HasNameRule(Accessible *aAccessible, + static inline bool HasNameRule(Accessible* aAccessible, ETextEquivRule aRule) { return (GetRoleRule(aAccessible->Role()) & aRule) == aRule; } /** * Calculates the name from accessible subtree if allowed. * * @param aAccessible [in] the given accessible * @param aName [out] accessible name */ - static nsresult GetNameFromSubtree(const Accessible *aAccessible, - nsAString &aName); + static nsresult GetNameFromSubtree(const Accessible* aAccessible, + nsAString& aName); /** * Calculates text equivalent from the subtree. Similar to GetNameFromSubtree. * However it returns not empty result for things like HTML p. */ - static void GetTextEquivFromSubtree(const Accessible *aAccessible, - nsString &aTextEquiv) { + static void GetTextEquivFromSubtree(const Accessible* aAccessible, + nsString& aTextEquiv) { aTextEquiv.Truncate(); AppendFromAccessibleChildren(aAccessible, &aTextEquiv); aTextEquiv.CompressWhitespace(); } /** * Calculates text equivalent for the given accessible from its IDRefs * attribute (like aria-labelledby or aria-describedby). * * @param aAccessible [in] the accessible text equivalent is computed for * @param aIDRefsAttr [in] IDRefs attribute on DOM node of the accessible * @param aTextEquiv [out] result text equivalent */ - static nsresult GetTextEquivFromIDRefs(const Accessible *aAccessible, - nsAtom *aIDRefsAttr, - nsAString &aTextEquiv); + static nsresult GetTextEquivFromIDRefs(const Accessible* aAccessible, + nsAtom* aIDRefsAttr, + nsAString& aTextEquiv); /** * Calculates the text equivalent from the given content and its subtree if * allowed and appends it to the given string. * * @param aInitiatorAcc [in] the accessible text equivalent is computed for * in the end (root accessible of text equivalent * calculation recursion) * @param aContent [in] the given content the text equivalent is * computed from * @param aString [in, out] the string */ - static nsresult AppendTextEquivFromContent(const Accessible *aInitiatorAcc, - nsIContent *aContent, - nsAString *aString); + static nsresult AppendTextEquivFromContent(const Accessible* aInitiatorAcc, + nsIContent* aContent, + nsAString* aString); /** * Calculates the text equivalent from the given text content (may be text * node or html:br) and appends it to the given string. * * @param aContent [in] the text content * @param aString [in, out] the string */ - static nsresult AppendTextEquivFromTextContent(nsIContent *aContent, - nsAString *aString); + static nsresult AppendTextEquivFromTextContent(nsIContent* aContent, + nsAString* aString); private: /** * Iterates accessible children and calculates text equivalent from each * child. */ - static nsresult AppendFromAccessibleChildren(const Accessible *aAccessible, - nsAString *aString); + static nsresult AppendFromAccessibleChildren(const Accessible* aAccessible, + nsAString* aString); /** * Calculates text equivalent from the given accessible and its subtree if * allowed. */ - static nsresult AppendFromAccessible(Accessible *aAccessible, - nsAString *aString); + static nsresult AppendFromAccessible(Accessible* aAccessible, + nsAString* aString); /** * Calculates text equivalent from the value of given accessible. */ - static nsresult AppendFromValue(Accessible *aAccessible, nsAString *aString); + static nsresult AppendFromValue(Accessible* aAccessible, nsAString* aString); /** * Iterates DOM children and calculates text equivalent from each child node. */ - static nsresult AppendFromDOMChildren(nsIContent *aContent, - nsAString *aString); + static nsresult AppendFromDOMChildren(nsIContent* aContent, + nsAString* aString); /** * Calculates text equivalent from the given DOM node and its subtree if * allowed. */ - static nsresult AppendFromDOMNode(nsIContent *aContent, nsAString *aString); + static nsresult AppendFromDOMNode(nsIContent* aContent, nsAString* aString); /** * Concatenates strings and appends space between them. Returns true if * text equivalent string was appended. */ - static bool AppendString(nsAString *aString, - const nsAString &aTextEquivalent); + static bool AppendString(nsAString* aString, + const nsAString& aTextEquivalent); /** * Returns the rule (constant of ETextEquivRule) for a given role. */ static uint32_t GetRoleRule(mozilla::a11y::roles::Role aRole); }; #endif
--- a/accessible/interfaces/msaa/AccessibleMarshalThunk.c +++ b/accessible/interfaces/msaa/AccessibleMarshalThunk.c @@ -2,16 +2,16 @@ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "ISimpleDOM.h" HRESULT STDMETHODCALLTYPE ISimpleDOMNode_get_localInterface_Proxy( - ISimpleDOMNode *This, void **localInterface) { + ISimpleDOMNode* This, void** localInterface) { return E_NOTIMPL; } HRESULT STDMETHODCALLTYPE ISimpleDOMNode_get_localInterface_Stub( - ISimpleDOMNode *This, IUnknown **localInterface) { + ISimpleDOMNode* This, IUnknown** localInterface) { return E_NOTIMPL; }
--- a/accessible/ipc/win/handler/HandlerTextLeaf.cpp +++ b/accessible/ipc/win/handler/HandlerTextLeaf.cpp @@ -9,18 +9,18 @@ #endif // defined(MOZILLA_INTERNAL_API) #include "HandlerTextLeaf.h" #include "mozilla/Assertions.h" namespace mozilla { namespace a11y { -HandlerTextLeaf::HandlerTextLeaf(IDispatch *aParent, long aIndexInParent, - HWND aHwnd, AccChildData &aData) +HandlerTextLeaf::HandlerTextLeaf(IDispatch* aParent, long aIndexInParent, + HWND aHwnd, AccChildData& aData) : mParent(aParent), mIndexInParent(aIndexInParent), mHwnd(aHwnd), mData(aData) { MOZ_ASSERT(aParent); } HandlerTextLeaf::~HandlerTextLeaf() { @@ -34,164 +34,164 @@ IMPL_IUNKNOWN_QUERY_IFACE(IDispatch) IMPL_IUNKNOWN_QUERY_IFACE(IAccessible) IMPL_IUNKNOWN_QUERY_IFACE(IAccessible2) IMPL_IUNKNOWN_QUERY_IFACE(IServiceProvider) IMPL_IUNKNOWN_QUERY_TAIL /*** IDispatch ***/ HRESULT -HandlerTextLeaf::GetTypeInfoCount(UINT *pctinfo) { return E_NOTIMPL; } +HandlerTextLeaf::GetTypeInfoCount(UINT* pctinfo) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { +HandlerTextLeaf::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, - LCID lcid, DISPID *rgDispId) { +HandlerTextLeaf::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames, UINT cNames, + LCID lcid, DISPID* rgDispId) { return E_NOTIMPL; } HRESULT HandlerTextLeaf::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, - WORD wFlags, DISPPARAMS *pDispParams, - VARIANT *pVarResult, EXCEPINFO *pExcepInfo, - UINT *puArgErr) { + WORD wFlags, DISPPARAMS* pDispParams, + VARIANT* pVarResult, EXCEPINFO* pExcepInfo, + UINT* puArgErr) { return E_NOTIMPL; } /*** IAccessible ***/ HRESULT -HandlerTextLeaf::get_accParent(IDispatch **ppdispParent) { +HandlerTextLeaf::get_accParent(IDispatch** ppdispParent) { if (!ppdispParent) { return E_INVALIDARG; } RefPtr<IDispatch> parent(mParent); parent.forget(ppdispParent); return S_OK; } HRESULT -HandlerTextLeaf::get_accChildCount(long *pcountChildren) { +HandlerTextLeaf::get_accChildCount(long* pcountChildren) { if (!pcountChildren) { return E_INVALIDARG; } *pcountChildren = 0; return S_OK; } HRESULT -HandlerTextLeaf::get_accChild(VARIANT varChild, IDispatch **ppdispChild) { +HandlerTextLeaf::get_accChild(VARIANT varChild, IDispatch** ppdispChild) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::get_accName(VARIANT varChild, BSTR *pszName) { +HandlerTextLeaf::get_accName(VARIANT varChild, BSTR* pszName) { if (varChild.lVal != CHILDID_SELF || !pszName) { return E_INVALIDARG; } *pszName = CopyBSTR(mData.mText); return S_OK; } HRESULT -HandlerTextLeaf::get_accValue(VARIANT varChild, BSTR *pszValue) { +HandlerTextLeaf::get_accValue(VARIANT varChild, BSTR* pszValue) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::get_accDescription(VARIANT varChild, BSTR *pszDescription) { +HandlerTextLeaf::get_accDescription(VARIANT varChild, BSTR* pszDescription) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::get_accRole(VARIANT varChild, VARIANT *pvarRole) { +HandlerTextLeaf::get_accRole(VARIANT varChild, VARIANT* pvarRole) { if (varChild.lVal != CHILDID_SELF || !pvarRole) { return E_INVALIDARG; } pvarRole->vt = VT_I4; pvarRole->lVal = mData.mTextRole; return S_OK; } HRESULT -HandlerTextLeaf::get_accState(VARIANT varChild, VARIANT *pvarState) { +HandlerTextLeaf::get_accState(VARIANT varChild, VARIANT* pvarState) { if (varChild.lVal != CHILDID_SELF || !pvarState) { return E_INVALIDARG; } pvarState->vt = VT_I4; pvarState->lVal = mData.mTextState; return S_OK; } HRESULT -HandlerTextLeaf::get_accHelp(VARIANT varChild, BSTR *pszHelp) { +HandlerTextLeaf::get_accHelp(VARIANT varChild, BSTR* pszHelp) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::get_accHelpTopic(BSTR *pszHelpFile, VARIANT varChild, - long *pidTopic) { +HandlerTextLeaf::get_accHelpTopic(BSTR* pszHelpFile, VARIANT varChild, + long* pidTopic) { return E_NOTIMPL; } HRESULT HandlerTextLeaf::get_accKeyboardShortcut(VARIANT varChild, - BSTR *pszKeyboardShortcut) { + BSTR* pszKeyboardShortcut) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::get_accFocus(VARIANT *pvarChild) { return E_NOTIMPL; } +HandlerTextLeaf::get_accFocus(VARIANT* pvarChild) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::get_accSelection(VARIANT *pvarChildren) { return E_NOTIMPL; } +HandlerTextLeaf::get_accSelection(VARIANT* pvarChildren) { return E_NOTIMPL; } HRESULT HandlerTextLeaf::get_accDefaultAction(VARIANT varChild, - BSTR *pszDefaultAction) { + BSTR* pszDefaultAction) { return E_NOTIMPL; } HRESULT HandlerTextLeaf::accSelect(long flagsSelect, VARIANT varChild) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::accLocation(long *pxLeft, long *pyTop, long *pcxWidth, - long *pcyHeight, VARIANT varChild) { +HandlerTextLeaf::accLocation(long* pxLeft, long* pyTop, long* pcxWidth, + long* pcyHeight, VARIANT varChild) { if (varChild.lVal != CHILDID_SELF || !pxLeft || !pyTop || !pcxWidth || !pcyHeight) { return E_INVALIDARG; } *pxLeft = mData.mTextLeft; *pyTop = mData.mTextTop; *pcxWidth = mData.mTextWidth; *pcyHeight = mData.mTextHeight; return S_OK; } HRESULT HandlerTextLeaf::accNavigate(long navDir, VARIANT varStart, - VARIANT *pvarEndUpAt) { + VARIANT* pvarEndUpAt) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::accHitTest(long xLeft, long yTop, VARIANT *pvarChild) { +HandlerTextLeaf::accHitTest(long xLeft, long yTop, VARIANT* pvarChild) { return E_NOTIMPL; } HRESULT HandlerTextLeaf::accDoDefaultAction(VARIANT varChild) { return E_NOTIMPL; } HRESULT HandlerTextLeaf::put_accName(VARIANT varChild, BSTR szName) { @@ -201,33 +201,33 @@ HandlerTextLeaf::put_accName(VARIANT var HRESULT HandlerTextLeaf::put_accValue(VARIANT varChild, BSTR szValue) { return E_NOTIMPL; } /*** IAccessible2 ***/ HRESULT -HandlerTextLeaf::get_nRelations(long *nRelations) { return E_NOTIMPL; } +HandlerTextLeaf::get_nRelations(long* nRelations) { return E_NOTIMPL; } HRESULT HandlerTextLeaf::get_relation(long relationIndex, - IAccessibleRelation *