Commit e226046c authored by Sylvestre Ledru's avatar Sylvestre Ledru
Browse files

Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan

# ignore-this-changeset

Depends on D28954

Differential Revision: https://phabricator.services.mozilla.com/D28956

--HG--
extra : moz-landing-system : lando
parent 130a9e0f
......@@ -24,10 +24,10 @@ typedef AtkUtilClass MaiUtilClass;
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 {
......@@ -41,13 +41,13 @@ struct MaiUtilListenerInfo {
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;
......@@ -56,12 +56,12 @@ static guint add_listener(GSignalEmissionHook listener,
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);
......@@ -80,9 +80,9 @@ static guint add_listener(GSignalEmissionHook listener,
}
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);
......@@ -106,11 +106,11 @@ static guint mai_util_add_global_event_listener(GSignalEmissionHook listener,
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) {
......@@ -144,8 +144,8 @@ static void mai_util_remove_global_event_listener(guint 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;
......@@ -173,7 +173,7 @@ static AtkKeyEventStruct *atk_key_event_from_gdk_event_key(GdkEventKey *key) {
}
struct MaiKeyEventInfo {
AtkKeyEventStruct *key_event;
AtkKeyEventStruct* key_event;
gpointer func_data;
};
......@@ -183,7 +183,7 @@ union AtkKeySnoopFuncPointer {
};
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
......@@ -191,20 +191,20 @@ static gboolean notify_hf(gpointer key, gpointer value, gpointer data) {
}
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;
......@@ -257,8 +257,8 @@ static void mai_util_remove_key_event_listener(guint remove_listener) {
}
}
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
......@@ -269,28 +269,28 @@ static AtkObject *mai_util_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);
......@@ -314,7 +314,7 @@ static void UtilInterfaceInit(MaiUtilClass *klass) {
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,
......
......@@ -38,7 +38,7 @@ struct MaiAtkHyperlink {
* The MaiHyperlink whose properties and features are exported via this
* hyperlink instance.
*/
MaiHyperlink *maiHyperlink;
MaiHyperlink* maiHyperlink;
};
struct MaiAtkHyperlinkClass {
......@@ -49,23 +49,23 @@ 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;
......@@ -96,7 +96,7 @@ GType mai_atk_hyperlink_get_type(void) {
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;
......@@ -113,8 +113,8 @@ MaiHyperlink::~MaiHyperlink() {
/* 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);
......@@ -128,11 +128,11 @@ void classInitCB(AtkHyperlinkClass *aClass) {
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 */
......@@ -140,12 +140,12 @@ void finalizeCB(GObject *aObj) {
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;
......@@ -162,28 +162,28 @@ gchar *getUriCB(AtkHyperlink *aLink, gint aLinkIndex) {
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;
......@@ -191,11 +191,11 @@ gint getEndIndexCB(AtkHyperlink *aLink) {
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;
......@@ -203,21 +203,21 @@ gint getStartIndexCB(AtkHyperlink *aLink) {
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;
......
......@@ -43,16 +43,16 @@ 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 &&
......@@ -61,13 +61,13 @@ bool nsCoreUtils::HasClickListener(nsIContent *aContent) {
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();
......@@ -92,7 +92,7 @@ void nsCoreUtils::DispatchClickEvent(XULTreeElement *aTree, int32_t aRowIndex,
// Dispatch mouse events.
AutoWeakFrame tcFrame = tcElm->GetPrimaryFrame();
nsIFrame *rootFrame = presShell->GetRootFrame();
nsIFrame* rootFrame = presShell->GetRootFrame();
nsPoint offset;
nsCOMPtr<nsIWidget> rootWidget =
......@@ -114,9 +114,9 @@ void nsCoreUtils::DispatchClickEvent(XULTreeElement *aTree, int32_t aRowIndex,
}
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);
......@@ -132,10 +132,10 @@ void nsCoreUtils::DispatchMouseEvent(EventMessage aMessage, int32_t aX,
}
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();
}
......@@ -156,7 +156,7 @@ void nsCoreUtils::DispatchTouchEvent(EventMessage aMessage, int32_t aX,
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.
......@@ -164,16 +164,16 @@ uint32_t nsCoreUtils::GetAccessKeyFor(nsIContent *aContent) {
!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();
......@@ -181,7 +181,7 @@ nsIContent *nsCoreUtils::GetDOMElementFor(nsIContent *aContent) {
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!");
......@@ -195,12 +195,12 @@ nsINode *nsCoreUtils::GetDOMNodeFromDOMPoint(nsINode *aNode, uint32_t 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;
......@@ -209,7 +209,7 @@ bool nsCoreUtils::IsAncestorOf(nsINode *aPossibleAncestorNode,
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);
......@@ -217,14 +217,14 @@ nsresult nsCoreUtils::ScrollSubstringTo(nsIFrame *aFrame, nsRange *aRange,
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));
......@@ -245,10 +245,10 @@ nsresult nsCoreUtils::ScrollSubstringTo(nsIFrame *aFrame, nsRange *aRange,
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 =
......@@ -263,8 +263,8 @@ void nsCoreUtils::ScrollFrameToPoint(nsIFrame *aScrollableFrame,
}
void nsCoreUtils::ConvertScrollTypeToPercents(uint32_t aScrollType,
ScrollAxis *aVertical,
ScrollAxis *aHorizontal) {
ScrollAxis* aVertical,
ScrollAxis* aHorizontal) {
WhereToScroll whereY, whereX;
WhenToScroll whenY, whenX;
switch (aScrollType) {
......@@ -314,7 +314,7 @@ void nsCoreUtils::ConvertScrollTypeToPercents(uint32_t aScrollType,
*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;
......@@ -330,14 +330,14 @@ nsIntPoint nsCoreUtils::GetScreenCoordsForWindow(nsINode *aNode) {
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!");
......@@ -347,14 +347,14 @@ bool nsCoreUtils::IsRootDocument(Document *aDocument) {
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;
......@@ -370,8 +370,8 @@ bool nsCoreUtils::IsTabDocument(Document *aDocumentNode) {
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;
......@@ -385,13 +385,13 @@ bool nsCoreUtils::IsErrorPage(Document *aDocument) {
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;
......@@ -409,11 +409,11 @@ bool nsCoreUtils::GetUIntAttr(nsIContent *aContent, nsAtom *aAttr,
return false;
}
void nsCoreUtils::GetLanguageFor(nsIContent *aContent, nsIContent *aRootContent,
nsAString &aLanguage) {
void nsCoreUtils::GetLanguageFor(nsIContent* aContent, nsIContent* aRootContent,
nsAString& aLanguage) {
aLanguage.Truncate();