mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Merge latest green b2g-inbound changeset and mozilla-central
This commit is contained in:
commit
4e6f3c8e19
2
CLOBBER
2
CLOBBER
@ -18,4 +18,4 @@
|
||||
# Modifying this file will now automatically clobber the buildbot machines \o/
|
||||
#
|
||||
|
||||
Multiple WebIDL changes requiring a clobber on Windows due to bug 890744
|
||||
Removal of XPIDL for bug 893117 requires a clobber to make sure interfaces aren't generated.
|
||||
|
@ -39,8 +39,6 @@ MIDL_GENERATED_FILES = \
|
||||
ISimpleDOMText_i.c \
|
||||
$(NULL)
|
||||
|
||||
SRCDIR_CSRCS = $(addprefix $(srcdir)/,$(CSRCS))
|
||||
|
||||
OS_LIBS = $(call EXPAND_LIBNAME,kernel32 rpcns4 rpcrt4 oleaut32)
|
||||
|
||||
$(MIDL_GENERATED_FILES): done_gen
|
||||
|
@ -48,6 +48,8 @@ NotificationController::~NotificationController()
|
||||
NS_IMPL_CYCLE_COLLECTING_NATIVE_ADDREF(NotificationController)
|
||||
NS_IMPL_CYCLE_COLLECTING_NATIVE_RELEASE(NotificationController)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(NotificationController)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(NotificationController)
|
||||
if (tmp->mDocument)
|
||||
tmp->Shutdown();
|
||||
|
@ -41,6 +41,8 @@
|
||||
#include "nsITreeBoxObject.h"
|
||||
#include "nsITreeColumns.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsCoreUtils
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@ -130,7 +132,7 @@ nsCoreUtils::DispatchMouseEvent(uint32_t aEventType, int32_t aX, int32_t aY,
|
||||
nsMouseEvent event(true, aEventType, aRootWidget,
|
||||
nsMouseEvent::eReal, nsMouseEvent::eNormal);
|
||||
|
||||
event.refPoint = nsIntPoint(aX, aY);
|
||||
event.refPoint = LayoutDeviceIntPoint(aX, aY);
|
||||
|
||||
event.clickCount = 1;
|
||||
event.button = nsMouseEvent::eLeftButton;
|
||||
|
@ -840,7 +840,7 @@ Accessible::ChildAtPoint(int32_t aX, int32_t aY,
|
||||
|
||||
nsMouseEvent dummyEvent(true, NS_MOUSE_MOVE, rootWidget,
|
||||
nsMouseEvent::eSynthesized);
|
||||
dummyEvent.refPoint = nsIntPoint(aX - rootRect.x, aY - rootRect.y);
|
||||
dummyEvent.refPoint = LayoutDeviceIntPoint(aX - rootRect.x, aY - rootRect.y);
|
||||
|
||||
nsIFrame* popupFrame = nsLayoutUtils::
|
||||
GetPopupFrameForEventCoordinates(accDocument->PresContext()->GetRootPresContext(),
|
||||
|
@ -103,6 +103,8 @@ DocAccessible::~DocAccessible()
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsISupports
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(DocAccessible)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(DocAccessible, Accessible)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mNotificationController)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mVirtualCursor)
|
||||
|
@ -3,4 +3,3 @@
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
MOZ_APP_DISPLAYNAME=Firefox
|
||||
MOZ_UA_BUILDID=20100101
|
||||
|
@ -22,9 +22,5 @@ ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
||||
DEFINES += -DHAS_SAFARI_MIGRATOR
|
||||
endif
|
||||
|
||||
EXTRA_PP_JS_MODULES = \
|
||||
MigrationUtils.jsm \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
@ -38,3 +38,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
|
||||
|
||||
LIBRARY_NAME = 'migration_s'
|
||||
|
||||
EXTRA_PP_JS_MODULES += [
|
||||
'MigrationUtils.jsm',
|
||||
]
|
||||
|
||||
|
@ -1,17 +0,0 @@
|
||||
# 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/.
|
||||
|
||||
DEPTH = @DEPTH@
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
EXTRA_PP_JS_MODULES := \
|
||||
SessionStore.jsm \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
@ -20,3 +20,8 @@ EXTRA_JS_MODULES = [
|
||||
'XPathGenerator.jsm',
|
||||
'_SessionFile.jsm',
|
||||
]
|
||||
|
||||
EXTRA_PP_JS_MODULES += [
|
||||
'SessionStore.jsm',
|
||||
]
|
||||
|
||||
|
@ -181,7 +181,9 @@ var ContextUI = {
|
||||
|
||||
// Dismiss the navbar if visible.
|
||||
dismissNavbar: function dismissNavbar() {
|
||||
Elements.navbar.dismiss();
|
||||
if (!StartUI.isVisible) {
|
||||
Elements.navbar.dismiss();
|
||||
}
|
||||
},
|
||||
|
||||
// Dismiss the tabstray if visible.
|
||||
|
@ -148,6 +148,10 @@ var Appbar = {
|
||||
}
|
||||
},
|
||||
|
||||
onAutocompleteCloseButton: function () {
|
||||
Elements.autocomplete.closePopup();
|
||||
},
|
||||
|
||||
dispatchContextualAction: function(aActionName){
|
||||
let activeTileset = this.activeTileset;
|
||||
if (activeTileset && ('isBound' in this.activeTileset)) {
|
||||
|
@ -1,9 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<bindings xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<binding id="appbarBinding">
|
||||
<content>
|
||||
<binding id="appbarBinding">
|
||||
<content>
|
||||
<xul:toolbar anonid="toolbar"><children/></xul:toolbar>
|
||||
</content>
|
||||
|
||||
@ -29,13 +29,20 @@
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
|
||||
<method name="dismiss">
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (!this.isShowing)
|
||||
return;
|
||||
|
||||
let self = this;
|
||||
this.setAttribute("hiding", "true");
|
||||
this.addEventListener("transitionend", function appbar_transitionend() {
|
||||
self.removeEventListener("transitionend", appbar_transitionend, false);
|
||||
self.removeAttribute("hiding");
|
||||
}, false);
|
||||
|
||||
this._fire("MozAppbarDismissing");
|
||||
this.removeAttribute("visible");
|
||||
]]>
|
||||
|
@ -45,6 +45,7 @@ let Elements = {};
|
||||
["toolbar", "toolbar"],
|
||||
["browsers", "browsers"],
|
||||
["navbar", "navbar"],
|
||||
["autocomplete", "urlbar-autocomplete"],
|
||||
["contextappbar", "contextappbar"],
|
||||
["findbar", "findbar"],
|
||||
["contentViewport", "content-viewport"],
|
||||
@ -550,13 +551,12 @@ var BrowserUI = {
|
||||
break;
|
||||
case "metro_viewstate_changed":
|
||||
this._adjustDOMforViewState();
|
||||
let autocomplete = document.getElementById("urlbar-autocomplete");
|
||||
if (aData == "snapped") {
|
||||
FlyoutPanelsUI.hide();
|
||||
autocomplete.setAttribute("orient", "vertical");
|
||||
Elements.autocomplete.setAttribute("orient", "vertical");
|
||||
}
|
||||
else {
|
||||
autocomplete.setAttribute("orient", "horizontal");
|
||||
Elements.autocomplete.setAttribute("orient", "horizontal");
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -259,17 +259,14 @@
|
||||
<hbox id="progress-control" />
|
||||
</hbox>
|
||||
|
||||
<vbox id="toolbar-autocomplete" flex="1">
|
||||
<vbox id="toolbar-overlay" flex="1">
|
||||
<!-- Autocomplete -->
|
||||
<scrollbox flex="1">
|
||||
<hbox id="urlbar-autocomplete" observes="bcast_windowState"/>
|
||||
</scrollbox>
|
||||
|
||||
<!-- Main toolbar -->
|
||||
<toolbar id="toolbar" flex="1">
|
||||
<observes element="bcast_windowState" attribute="*"/>
|
||||
<observes element="bcast_urlbarState" attribute="*"/>
|
||||
|
||||
<toolbar id="toolbar" flex="1" observes="bcast_windowState">
|
||||
<toolbarbutton id="back-button" class="appbar-primary"
|
||||
command="cmd_back"/>
|
||||
<toolbarbutton id="forward-button" class="appbar-primary"
|
||||
@ -296,14 +293,28 @@
|
||||
command="cmd_stop"/>
|
||||
</hbox>
|
||||
|
||||
<toolbarbutton id="download-button" class="appbar-secondary"
|
||||
oncommand="Appbar.onDownloadButton()"/>
|
||||
<toolbarbutton id="star-button" class="appbar-primary" type="checkbox"
|
||||
oncommand="Appbar.onStarButton()"/>
|
||||
<toolbarbutton id="pin-button" class="appbar-primary" type="checkbox"
|
||||
oncommand="Appbar.onPinButton()"/>
|
||||
<toolbarbutton id="menu-button" class="appbar-primary"
|
||||
oncommand="Appbar.onMenuButton(event)"/>
|
||||
<stack id="toolbar-contextual">
|
||||
<observes element="bcast_windowState" attribute="*"/>
|
||||
<observes element="bcast_urlbarState" attribute="*"/>
|
||||
|
||||
<hbox id="toolbar-context-page" pack="end">
|
||||
<toolbarbutton id="download-button" class="appbar-secondary"
|
||||
oncommand="Appbar.onDownloadButton()"/>
|
||||
<toolbarbutton id="star-button" class="appbar-primary"
|
||||
type="checkbox"
|
||||
oncommand="Appbar.onStarButton()"/>
|
||||
<toolbarbutton id="pin-button" class="appbar-primary"
|
||||
type="checkbox"
|
||||
oncommand="Appbar.onPinButton()"/>
|
||||
<toolbarbutton id="menu-button" class="appbar-primary"
|
||||
oncommand="Appbar.onMenuButton(event)"/>
|
||||
</hbox>
|
||||
|
||||
<hbox id="toolbar-context-autocomplete" pack="end">
|
||||
<toolbarbutton id="close-button" class="appbar-secondary"
|
||||
oncommand="Appbar.onAutocompleteCloseButton()"/>
|
||||
</hbox>
|
||||
</stack>
|
||||
</toolbar>
|
||||
</vbox>
|
||||
</appbar>
|
||||
@ -371,10 +382,16 @@
|
||||
<textbox id="findbar-textbox" type="search"
|
||||
oncommand="FindHelperUI.search(this.value)"
|
||||
oninput="FindHelperUI.updateCommands(this.value); "/>
|
||||
<button class="previous-button" command="cmd_findPrevious"/>
|
||||
<button class="next-button" command="cmd_findNext"/>
|
||||
|
||||
<toolbarbutton id="findbar-previous-button" class="appbar-secondary"
|
||||
command="cmd_findPrevious"/>
|
||||
<toolbarbutton id="findbar-next-button" class="appbar-secondary"
|
||||
command="cmd_findNext"/>
|
||||
|
||||
<spacer flex="1"/>
|
||||
<button id="findbar-close" class="close-button" command="cmd_findClose"/>
|
||||
|
||||
<toolbarbutton id="findbar-close-button" class="appbar-secondary"
|
||||
command="cmd_findClose"/>
|
||||
</appbar>
|
||||
|
||||
<!-- Context button bar -->
|
||||
|
@ -116,15 +116,16 @@ var FindHelperUI = {
|
||||
// Shutdown selection related ui
|
||||
SelectionHelperUI.closeEditSession();
|
||||
|
||||
this.search(this._textbox.value);
|
||||
this._textbox.select();
|
||||
this._textbox.focus();
|
||||
this._open = true;
|
||||
|
||||
let findbar = this._container;
|
||||
setTimeout(() => {
|
||||
Elements.browsers.setAttribute("findbar", true);
|
||||
findbar.show();
|
||||
|
||||
this.search(this._textbox.value);
|
||||
this._textbox.select();
|
||||
this._textbox.focus();
|
||||
|
||||
this._open = true;
|
||||
}, 0);
|
||||
|
||||
// Prevent the view to scroll automatically while searching
|
||||
|
@ -73,7 +73,7 @@ gTests.push({
|
||||
yield waitForEvent(Elements.findbar, "transitionend");
|
||||
is(Elements.findbar.isShowing, true, "Show find bar with menu item");
|
||||
|
||||
EventUtils.synthesizeMouse(document.getElementById("findbar-close"), 1, 1, {});
|
||||
EventUtils.synthesizeMouse(document.getElementById("findbar-close-button"), 1, 1, {});
|
||||
yield waitForEvent(Elements.findbar, "transitionend");
|
||||
is(Elements.findbar.isShowing, false, "Hide find bar with close button");
|
||||
|
||||
|
@ -1,27 +0,0 @@
|
||||
# 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/.
|
||||
|
||||
DEPTH = @DEPTH@
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
# metro/components.manifest
|
||||
EXTRA_COMPONENTS = \
|
||||
AlertsService.js \
|
||||
ContentPermissionPrompt.js \
|
||||
DownloadManagerUI.js \
|
||||
PromptService.js \
|
||||
ContentDispatchChooser.js \
|
||||
LoginManagerPrompter.js \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_SAFE_BROWSING
|
||||
EXTRA_COMPONENTS += SafeBrowsing.js
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
@ -11,6 +11,20 @@ XPIDL_SOURCES += [
|
||||
MODULE = 'components'
|
||||
|
||||
# metro/components.manifest
|
||||
EXTRA_COMPONENTS += [
|
||||
'AlertsService.js',
|
||||
'ContentDispatchChooser.js',
|
||||
'ContentPermissionPrompt.js',
|
||||
'DownloadManagerUI.js',
|
||||
'LoginManagerPrompter.js',
|
||||
'PromptService.js',
|
||||
]
|
||||
|
||||
if CONFIG['MOZ_SAFE_BROWSING']:
|
||||
EXTRA_COMPONENTS += [
|
||||
'SafeBrowsing.js',
|
||||
]
|
||||
|
||||
EXTRA_PP_COMPONENTS += [
|
||||
'AboutRedirector.js',
|
||||
'BrowserCLH.js',
|
||||
|
@ -444,10 +444,6 @@ documenttab[selected] .documenttab-selection {
|
||||
|
||||
/* Navigation bar ========================================================== */
|
||||
|
||||
#navbar[startpage] {
|
||||
transform: none;
|
||||
}
|
||||
|
||||
/* Progress meter ---------------------------------------------------------- */
|
||||
|
||||
#progress-container {
|
||||
@ -483,10 +479,12 @@ documenttab[selected] .documenttab-selection {
|
||||
|
||||
/* Toolbar ----------------------------------------------------------------- */
|
||||
|
||||
#toolbar-autocomplete {
|
||||
#toolbar-overlay {
|
||||
background-color: @panel_light_color@;
|
||||
}
|
||||
|
||||
/* Combined back/forward buttons */
|
||||
|
||||
#back-button {
|
||||
list-style-image: url(chrome://browser/skin/images/navbar-back.png);
|
||||
position: relative;
|
||||
@ -584,6 +582,7 @@ documenttab[selected] .documenttab-selection {
|
||||
|
||||
/* Combined stop-reload button */
|
||||
.urlbar-button {
|
||||
margin: 0;
|
||||
-moz-image-region: rect(0px, 30px, 30px, 0px);
|
||||
}
|
||||
|
||||
@ -673,20 +672,33 @@ documenttab[selected] .documenttab-selection {
|
||||
visibility: collapse;
|
||||
}
|
||||
|
||||
/* Application-Specific */
|
||||
/* Contextual toolbar controls */
|
||||
|
||||
#toolbar-context-autocomplete,
|
||||
#toolbar-context-page {
|
||||
transition-property: opacity, visibility;
|
||||
transition-duration: @forward_transition_length@;
|
||||
transition-timing-function: @metro_animation_easing@;
|
||||
}
|
||||
|
||||
#toolbar-contextual:not([autocomplete]) #toolbar-context-autocomplete,
|
||||
#toolbar-contextual[startpage] #toolbar-context-page,
|
||||
#toolbar-contextual[autocomplete] #toolbar-context-page {
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#download-button {
|
||||
-moz-image-region: rect(0px, 40px, 40px, 0px) !important;
|
||||
}
|
||||
#download-button:hover {
|
||||
#download-button:hover:not(:active) {
|
||||
-moz-image-region: rect(40px, 40px, 80px, 0px) !important;
|
||||
}
|
||||
#download-button:active {
|
||||
-moz-image-region: rect(80px, 40px, 120px, 0px) !important;
|
||||
}
|
||||
|
||||
/* Page-Specific */
|
||||
|
||||
#pin-button {
|
||||
list-style-image: url(chrome://browser/skin/images/navbar-pin.png);
|
||||
}
|
||||
@ -727,6 +739,18 @@ documenttab[selected] .documenttab-selection {
|
||||
}
|
||||
}
|
||||
|
||||
#close-button {
|
||||
-moz-image-region: rect(0px, 480px, 40px, 440px);
|
||||
}
|
||||
|
||||
#close-button:hover:not(:active) {
|
||||
-moz-image-region: rect(40px, 480px, 80px, 440px);
|
||||
}
|
||||
|
||||
#close-button:active {
|
||||
-moz-image-region: rect(80px, 480px, 120px, 440px);
|
||||
}
|
||||
|
||||
/* Panel UI ================================================================ */
|
||||
|
||||
#panel-container {
|
||||
@ -802,88 +826,23 @@ documenttab[selected] .documenttab-selection {
|
||||
#findbar {
|
||||
background-color: @metro_orange@;
|
||||
padding: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#findbar > toolbar {
|
||||
min-height: @findbar_height@ !important;
|
||||
}
|
||||
|
||||
#findbar > .previous-button,
|
||||
#findbar > .next-button,
|
||||
#findbar > .close-button {
|
||||
list-style-image: url(chrome://browser/skin/images/appbar-icons.png);
|
||||
min-width: @touch_button_small@ !important; /* button size */
|
||||
min-height: @touch_button_small@ !important; /* button size */
|
||||
border: none !important;
|
||||
background-image: none !important;
|
||||
background-color: inherit !important;
|
||||
pointer-events: auto;
|
||||
-moz-user-focus: ignore !important;
|
||||
margin: 0 @margin_normal@ !important;
|
||||
}
|
||||
|
||||
#findbar > .close-button {
|
||||
-moz-margin-start: 0;
|
||||
-moz-image-region: rect(0px, 480px, 40px, 440px);
|
||||
}
|
||||
|
||||
#findbar > .close-button:hover {
|
||||
-moz-image-region: rect(40px, 480px, 80px, 440px);
|
||||
}
|
||||
|
||||
#findbar > .close-button:active {
|
||||
-moz-image-region: rect(80px, 480px, 120px, 440px);
|
||||
}
|
||||
|
||||
#findbar > .previous-button {
|
||||
-moz-margin-end: 0;
|
||||
-moz-image-region: rect(0px, 400px, 40px, 360px);
|
||||
}
|
||||
|
||||
#findbar > .previous-button:hover {
|
||||
-moz-image-region: rect(40px, 400px, 80px, 360px);
|
||||
}
|
||||
|
||||
#findbar > .previous-button:active{
|
||||
-moz-image-region: rect(80px, 400px, 120px, 360px);
|
||||
}
|
||||
|
||||
#findbar > .next-button {
|
||||
-moz-margin-start: 0;
|
||||
-moz-image-region: rect(0px, 440px, 40px, 400px);
|
||||
}
|
||||
|
||||
#findbar > .next-button:hover {
|
||||
-moz-image-region: rect(40px, 440px, 80px, 400px);
|
||||
}
|
||||
|
||||
#findbar > .next-button:active {
|
||||
-moz-image-region: rect(80px, 440px, 120px, 400px);
|
||||
}
|
||||
|
||||
#findbar-textbox {
|
||||
pointer-events: auto;
|
||||
-moz-margin-end: 0;
|
||||
border: none !important;
|
||||
width: 20em;
|
||||
}
|
||||
|
||||
.textbox-search-icon {
|
||||
list-style-image: url("chrome://browser/skin/images/search-glass-30.png");
|
||||
-moz-image-region: auto;
|
||||
}
|
||||
|
||||
/* Override the default box ordering and make the find textbox appear to the
|
||||
right of the icon */
|
||||
#findbar-textbox input {
|
||||
-moz-box-ordinal-group: 2
|
||||
}
|
||||
|
||||
#findbar-textbox deck {
|
||||
margin-right: @margin_normal@;
|
||||
}
|
||||
|
||||
#findbar-textbox[status="1"] { /* Ci.nsITypeAheadFind.FIND_NOTFOUND */
|
||||
background: rgb(255,200,200);
|
||||
}
|
||||
@ -892,6 +851,47 @@ documenttab[selected] .documenttab-selection {
|
||||
background: #8db8d8;
|
||||
}
|
||||
|
||||
.textbox-search-icon {
|
||||
list-style-image: url("chrome://browser/skin/images/search-glass-30.png");
|
||||
-moz-image-region: auto;
|
||||
}
|
||||
|
||||
#findbar-previous-button {
|
||||
-moz-image-region: rect(0px, 400px, 40px, 360px);
|
||||
}
|
||||
|
||||
#findbar-previous-button:hover:not(:active) {
|
||||
-moz-image-region: rect(40px, 400px, 80px, 360px);
|
||||
}
|
||||
|
||||
#findbar-previous-button:active {
|
||||
-moz-image-region: rect(80px, 400px, 120px, 360px);
|
||||
}
|
||||
|
||||
#findbar-next-button {
|
||||
-moz-image-region: rect(0px, 440px, 40px, 400px);
|
||||
}
|
||||
|
||||
#findbar-next-button:hover:not(:active) {
|
||||
-moz-image-region: rect(40px, 440px, 80px, 400px);
|
||||
}
|
||||
|
||||
#findbar-next-button:active {
|
||||
-moz-image-region: rect(80px, 440px, 120px, 400px);
|
||||
}
|
||||
|
||||
#findbar-close-button {
|
||||
-moz-image-region: rect(0px, 480px, 40px, 440px);
|
||||
}
|
||||
|
||||
#findbar-close-button:hover:not(:active) {
|
||||
-moz-image-region: rect(40px, 480px, 80px, 440px);
|
||||
}
|
||||
|
||||
#findbar-close-button:active {
|
||||
-moz-image-region: rect(80px, 480px, 120px, 440px);
|
||||
}
|
||||
|
||||
/* Contextual appbar ======================================================= */
|
||||
|
||||
#contextualactions-tray {
|
||||
|
@ -679,6 +679,7 @@ arrowbox {
|
||||
}
|
||||
|
||||
/* App bars ----------------------------------------------------------------- */
|
||||
|
||||
appbar {
|
||||
display: block;
|
||||
position: fixed;
|
||||
@ -687,15 +688,12 @@ appbar {
|
||||
transform: translateY(100%);
|
||||
transition: transform @metro_animation_duration@ @metro_animation_easing@;
|
||||
font-size: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
appbar toolbar {
|
||||
-moz-appearance: none;
|
||||
-moz-box-align: center;
|
||||
border: 0;
|
||||
width: 100%;
|
||||
min-height: @toolbar_height@;
|
||||
font-size: 1rem;
|
||||
appbar[hiding],
|
||||
appbar[visible] {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
appbar[visible] {
|
||||
@ -709,7 +707,17 @@ appbar[visible] {
|
||||
bottom @appbar_keyboard_slideup_duration@ @metro_animation_easing@;
|
||||
}
|
||||
|
||||
appbar toolbar > toolbarbutton {
|
||||
|
||||
appbar toolbar {
|
||||
-moz-appearance: none;
|
||||
-moz-box-align: center;
|
||||
border: 0;
|
||||
width: 100%;
|
||||
min-height: @toolbar_height@;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
appbar toolbar toolbarbutton {
|
||||
border: 0;
|
||||
margin: 0 @toolbar_horizontal_spacing@;
|
||||
padding: 0;
|
||||
@ -717,7 +725,7 @@ appbar toolbar > toolbarbutton {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
appbar toolbar > toolbarbutton[disabled] {
|
||||
appbar toolbar toolbarbutton[disabled] {
|
||||
visibility: collapse;
|
||||
}
|
||||
|
||||
@ -725,11 +733,11 @@ appbar toolbar[labelled] {
|
||||
min-height: @labelled_toolbar_height@;
|
||||
}
|
||||
|
||||
appbar toolbar[labelled] > toolbarbutton {
|
||||
appbar toolbar[labelled] toolbarbutton {
|
||||
-moz-box-orient: vertical;
|
||||
}
|
||||
|
||||
appbar toolbar[labelled] > toolbarbutton > .toolbarbutton-text {
|
||||
appbar toolbar[labelled] toolbarbutton > .toolbarbutton-text {
|
||||
display: block;
|
||||
padding-top: @metro_spacing_small@;
|
||||
font-size: 0.75rem;
|
||||
|
@ -11,11 +11,6 @@ include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
EXTRA_PP_JS_MODULES = \
|
||||
AboutHomeUtils.jsm \
|
||||
RecentWindow.jsm \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZILLA_OFFICIAL
|
||||
DEFINES += -DMOZILLA_OFFICIAL=1
|
||||
endif
|
||||
|
@ -24,3 +24,9 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
||||
'WindowsJumpLists.jsm',
|
||||
'WindowsPreviewPerTab.jsm',
|
||||
]
|
||||
|
||||
EXTRA_PP_JS_MODULES += [
|
||||
'AboutHomeUtils.jsm',
|
||||
'RecentWindow.jsm',
|
||||
]
|
||||
|
||||
|
@ -106,15 +106,21 @@ this.webappsUI = {
|
||||
label: bundle.getString("webapps.install"),
|
||||
accessKey: bundle.getString("webapps.install.accesskey"),
|
||||
callback: function() {
|
||||
let app = WebappsInstaller.install(aData);
|
||||
let app = WebappsInstaller.init(aData);
|
||||
|
||||
if (app) {
|
||||
let localDir = null;
|
||||
if (app.appProfile) {
|
||||
localDir = app.appProfile.localDir;
|
||||
}
|
||||
|
||||
DOMApplicationRegistry.confirmInstall(aData, false, localDir);
|
||||
installationSuccessNotification(aData, app, aWindow);
|
||||
DOMApplicationRegistry.confirmInstall(aData, false, localDir, null,
|
||||
function (aManifest) {
|
||||
if (WebappsInstaller.install(aData, aManifest)) {
|
||||
installationSuccessNotification(aData, app, aWindow);
|
||||
}
|
||||
}
|
||||
);
|
||||
} else {
|
||||
DOMApplicationRegistry.denyInstall(aData);
|
||||
}
|
||||
@ -122,7 +128,8 @@ this.webappsUI = {
|
||||
};
|
||||
|
||||
let requestingURI = aWindow.makeURI(aData.from);
|
||||
let manifest = new ManifestHelper(aData.app.manifest, aData.app.origin);
|
||||
let jsonManifest = aData.isPackage ? aData.app.updateManifest : aData.app.manifest;
|
||||
let manifest = new ManifestHelper(jsonManifest, aData.app.origin);
|
||||
|
||||
let host;
|
||||
try {
|
||||
|
@ -297,7 +297,7 @@ case "$target" in
|
||||
# The build tools got moved around to different directories in
|
||||
# SDK Tools r22. Try to locate them.
|
||||
android_build_tools=""
|
||||
for suffix in 18.0.0 17.0.0 android-4.2.2; do
|
||||
for suffix in 18.0.1 18.0.0 17.0.0 android-4.2.2; do
|
||||
tools_directory="$android_sdk/../../build-tools/$suffix"
|
||||
if test -d "$tools_directory" ; then
|
||||
android_build_tools="$tools_directory"
|
||||
|
@ -217,6 +217,8 @@ EOF
|
||||
CPPFLAGS="$_SAVE_CPPFLAGS"
|
||||
CXX="$_SAVE_CXX"
|
||||
fi
|
||||
elif test "$GNU_CXX"; then
|
||||
HOST_CXXFLAGS="$HOST_CXXFLAGS -std=gnu++0x"
|
||||
fi
|
||||
AC_LANG_C
|
||||
])
|
||||
|
@ -33,7 +33,7 @@ def tokens2re(tokens):
|
||||
return re.compile('(?:%s|%s)' % (nonescaped, r'(?P<escape>\\\\)'))
|
||||
|
||||
_unquoted_tokens = tokens2re({
|
||||
'whitespace': r'[\t\r\n ]',
|
||||
'whitespace': r'[\t\r\n ]+',
|
||||
'quote': r'[\'"]',
|
||||
'comment': '#',
|
||||
'special': r'[<>&|`~(){}$;]',
|
||||
@ -59,7 +59,7 @@ class ClineSplitter(list):
|
||||
"""
|
||||
def __init__(self, cline, cwd):
|
||||
self.cwd = cwd
|
||||
self.arg = ''
|
||||
self.arg = None
|
||||
self.cline = cline
|
||||
self.glob = False
|
||||
self._parse_unquoted()
|
||||
@ -68,6 +68,8 @@ class ClineSplitter(list):
|
||||
"""
|
||||
Push the given string as part of the current argument
|
||||
"""
|
||||
if self.arg is None:
|
||||
self.arg = ''
|
||||
self.arg += str
|
||||
|
||||
def _next(self):
|
||||
@ -75,7 +77,7 @@ class ClineSplitter(list):
|
||||
Finalize current argument, effectively adding it to the list.
|
||||
Perform globbing if needed.
|
||||
"""
|
||||
if not self.arg:
|
||||
if self.arg is None:
|
||||
return
|
||||
if self.glob:
|
||||
if os.path.isabs(self.arg):
|
||||
@ -92,7 +94,7 @@ class ClineSplitter(list):
|
||||
self.glob = False
|
||||
else:
|
||||
self.append(self.arg)
|
||||
self.arg = ''
|
||||
self.arg = None
|
||||
|
||||
def _parse_unquoted(self):
|
||||
"""
|
||||
@ -108,7 +110,8 @@ class ClineSplitter(list):
|
||||
break
|
||||
# The beginning of the string, up to the found token, is part of
|
||||
# the current argument
|
||||
self._push(self.cline[:m.start()])
|
||||
if m.start():
|
||||
self._push(self.cline[:m.start()])
|
||||
self.cline = self.cline[m.end():]
|
||||
|
||||
match = dict([(name, value) for name, value in m.groupdict().items() if value])
|
||||
@ -142,7 +145,8 @@ class ClineSplitter(list):
|
||||
self._push(m.group(0))
|
||||
else:
|
||||
raise Exception, "Shouldn't reach here"
|
||||
self._next()
|
||||
if self.arg:
|
||||
self._next()
|
||||
|
||||
def _parse_quoted(self):
|
||||
# Single quoted strings are preserved, except for the final quote
|
||||
|
2
build/pymake/tests/empty-arg.mk
Normal file
2
build/pymake/tests/empty-arg.mk
Normal file
@ -0,0 +1,2 @@
|
||||
all:
|
||||
@ sh -c 'if [ $$# = 3 ] ; then echo TEST-PASS; else echo TEST-FAIL; fi' -- a "" b
|
@ -18,6 +18,7 @@ _MOZBUILD_EXTERNAL_VARIABLES := \
|
||||
CPP_UNIT_TESTS \
|
||||
DIRS \
|
||||
EXTRA_PP_COMPONENTS \
|
||||
EXTRA_PP_JS_MODULES \
|
||||
GTEST_CMMSRCS \
|
||||
GTEST_CPPSRCS \
|
||||
GTEST_CSRCS \
|
||||
|
@ -5905,6 +5905,10 @@ if test -n "$MOZ_WEBGL_DISABLED"; then
|
||||
MOZ_ANGLE_RENDERER=
|
||||
fi
|
||||
|
||||
if test -n "$MOZ_WEBGL"; then
|
||||
AC_DEFINE(MOZ_WEBGL)
|
||||
fi
|
||||
|
||||
if test -n "$MOZ_WEBGL_CONFORMANT"; then
|
||||
AC_DEFINE(MOZ_WEBGL_CONFORMANT)
|
||||
fi
|
||||
@ -8749,8 +8753,6 @@ AC_SUBST(MOZ_UA_OS_AGNOSTIC)
|
||||
if test -n "$MOZ_UA_OS_AGNOSTIC"; then
|
||||
AC_DEFINE(MOZ_UA_OS_AGNOSTIC)
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED(MOZ_UA_BUILDID, "$MOZ_UA_BUILDID")
|
||||
AC_SUBST(MOZ_UA_BUILDID)
|
||||
|
||||
AC_SUBST(MOZ_APP_STATIC_INI)
|
||||
|
||||
|
@ -750,7 +750,7 @@ public:
|
||||
*/
|
||||
static nsresult ReportToConsoleNonLocalized(const nsAString& aErrorText,
|
||||
uint32_t aErrorFlags,
|
||||
const char *aCategory,
|
||||
const nsACString& aCategory,
|
||||
nsIDocument* aDocument,
|
||||
nsIURI* aURI = nullptr,
|
||||
const nsAFlatString& aSourceLine
|
||||
@ -794,7 +794,7 @@ public:
|
||||
PropertiesFile_COUNT
|
||||
};
|
||||
static nsresult ReportToConsole(uint32_t aErrorFlags,
|
||||
const char *aCategory,
|
||||
const nsACString& aCategory,
|
||||
nsIDocument* aDocument,
|
||||
PropertiesFile aFile,
|
||||
const char *aMessageName,
|
||||
@ -805,6 +805,26 @@ public:
|
||||
= EmptyString(),
|
||||
uint32_t aLineNumber = 0,
|
||||
uint32_t aColumnNumber = 0);
|
||||
// This overload allows passing a literal string for aCategory.
|
||||
template<uint32_t N>
|
||||
static nsresult ReportToConsole(uint32_t aErrorFlags,
|
||||
const char (&aCategory)[N],
|
||||
nsIDocument* aDocument,
|
||||
PropertiesFile aFile,
|
||||
const char *aMessageName,
|
||||
const PRUnichar **aParams = nullptr,
|
||||
uint32_t aParamsLength = 0,
|
||||
nsIURI* aURI = nullptr,
|
||||
const nsAFlatString& aSourceLine
|
||||
= EmptyString(),
|
||||
uint32_t aLineNumber = 0,
|
||||
uint32_t aColumnNumber = 0)
|
||||
{
|
||||
nsDependentCString category(aCategory, N - 1);
|
||||
return ReportToConsole(aErrorFlags, category, aDocument, aFile,
|
||||
aMessageName, aParams, aParamsLength, aURI,
|
||||
aSourceLine, aLineNumber, aColumnNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the localized string named |aKey| in properties file |aFile|.
|
||||
@ -1278,9 +1298,6 @@ public:
|
||||
mozilla::DeferredFinalizeFunction aFunc,
|
||||
void* aThing);
|
||||
|
||||
static void ReleaseWrapper(void* aScriptObjectHolder,
|
||||
nsWrapperCache* aCache);
|
||||
|
||||
/*
|
||||
* Notify when the first XUL menu is opened and when the all XUL menus are
|
||||
* closed. At opening, aInstalling should be TRUE, otherwise, it should be
|
||||
|
@ -57,6 +57,8 @@ Attr::Attr(nsDOMAttributeMap *aAttrMap,
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(Attr)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Attr)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
|
||||
|
||||
|
@ -80,6 +80,8 @@ EventSource::~EventSource()
|
||||
// EventSource::nsISupports
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(EventSource)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(EventSource)
|
||||
bool isBlack = tmp->IsBlack();
|
||||
if (isBlack || tmp->mWaitingForOnStopRequest) {
|
||||
|
@ -29,6 +29,8 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(FileIOObject)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIRequestObserver)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(FileIOObject)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(FileIOObject,
|
||||
nsDOMEventTargetHelper)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mProgressNotifier)
|
||||
|
@ -989,7 +989,7 @@ FragmentOrElement::DestroyContent()
|
||||
|
||||
// XXX We really should let cycle collection do this, but that currently still
|
||||
// leaks (see https://bugzilla.mozilla.org/show_bug.cgi?id=406684).
|
||||
nsContentUtils::ReleaseWrapper(this, this);
|
||||
ReleaseWrapper(this);
|
||||
|
||||
uint32_t i, count = mAttrsAndChildren.ChildCount();
|
||||
for (i = 0; i < count; ++i) {
|
||||
@ -1148,6 +1148,8 @@ FragmentOrElement::ClearContentUnbinder()
|
||||
ContentUnbinder::UnbindAll();
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(FragmentOrElement)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(FragmentOrElement)
|
||||
nsINode::Unlink(tmp);
|
||||
|
||||
|
@ -22,14 +22,6 @@ endif
|
||||
|
||||
GQI_SRCS = contentbase.gqi
|
||||
|
||||
EXTRA_COMPONENTS = \
|
||||
contentSecurityPolicy.manifest \
|
||||
contentAreaDropListener.js \
|
||||
contentAreaDropListener.manifest \
|
||||
messageWakeupService.js \
|
||||
messageWakeupService.manifest \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
include $(topsrcdir)/ipc/chromium/chromium-config.mk
|
||||
|
@ -156,6 +156,8 @@ NodeIterator::~NodeIterator()
|
||||
* nsISupports and cycle collection stuff
|
||||
*/
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(NodeIterator)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(NodeIterator)
|
||||
if (tmp->mRoot)
|
||||
tmp->mRoot->RemoveMutationObserver(tmp);
|
||||
|
@ -577,6 +577,8 @@ WebSocket::Constructor(const GlobalObject& aGlobal,
|
||||
return webSocket.forget();
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(WebSocket)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(WebSocket)
|
||||
bool isBlack = tmp->IsBlack();
|
||||
if (isBlack|| tmp->mKeepingAlive) {
|
||||
|
@ -154,6 +154,14 @@ CPP_SOURCES += [
|
||||
'nsXMLNameSpaceMap.cpp',
|
||||
]
|
||||
|
||||
EXTRA_COMPONENTS += [
|
||||
'contentAreaDropListener.js',
|
||||
'contentAreaDropListener.manifest',
|
||||
'contentSecurityPolicy.manifest',
|
||||
'messageWakeupService.js',
|
||||
'messageWakeupService.manifest',
|
||||
]
|
||||
|
||||
EXTRA_PP_COMPONENTS += [
|
||||
'contentSecurityPolicy.js',
|
||||
]
|
||||
|
@ -66,6 +66,8 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsContentSink)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDocumentObserver)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsContentSink)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsContentSink)
|
||||
if (tmp->mDocument) {
|
||||
tmp->mDocument->RemoveObserver(tmp);
|
||||
|
@ -2967,7 +2967,7 @@ nsresult nsContentUtils::FormatLocalizedString(PropertiesFile aFile,
|
||||
|
||||
/* static */ nsresult
|
||||
nsContentUtils::ReportToConsole(uint32_t aErrorFlags,
|
||||
const char *aCategory,
|
||||
const nsACString& aCategory,
|
||||
nsIDocument* aDocument,
|
||||
PropertiesFile aFile,
|
||||
const char *aMessageName,
|
||||
@ -3002,7 +3002,7 @@ nsContentUtils::ReportToConsole(uint32_t aErrorFlags,
|
||||
/* static */ nsresult
|
||||
nsContentUtils::ReportToConsoleNonLocalized(const nsAString& aErrorText,
|
||||
uint32_t aErrorFlags,
|
||||
const char *aCategory,
|
||||
const nsACString& aCategory,
|
||||
nsIDocument* aDocument,
|
||||
nsIURI* aURI,
|
||||
const nsAFlatString& aSourceLine,
|
||||
@ -6290,24 +6290,6 @@ nsContentUtils::IsInPointerLockContext(nsIDOMWindow* aWin)
|
||||
return top == lockTop;
|
||||
}
|
||||
|
||||
// static
|
||||
void
|
||||
nsContentUtils::ReleaseWrapper(void* aScriptObjectHolder,
|
||||
nsWrapperCache* aCache)
|
||||
{
|
||||
if (aCache->PreservingWrapper()) {
|
||||
// PreserveWrapper puts new DOM bindings in the JS holders hash, but they
|
||||
// can also be in the DOM expando hash, so we need to try to remove them
|
||||
// from both here.
|
||||
JSObject* obj = aCache->GetWrapperPreserveColor();
|
||||
if (aCache->IsDOMBinding() && obj && js::IsProxy(obj)) {
|
||||
DOMProxyHandler::GetAndClearExpandoObject(obj);
|
||||
}
|
||||
aCache->SetPreservingWrapper(false);
|
||||
DropJSObjects(aScriptObjectHolder);
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
int32_t
|
||||
nsContentUtils::GetAdjustedOffsetInTextControl(nsIFrame* aOffsetFrame,
|
||||
|
@ -61,6 +61,8 @@ nsDOMAttributeMap::DropReference()
|
||||
mContent = nullptr;
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMAttributeMap)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDOMAttributeMap)
|
||||
tmp->DropReference();
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
|
||||
|
@ -56,6 +56,8 @@ nsDOMDataChannel::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
|
||||
return DataChannelBinding::Wrap(aCx, aScope, this);
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMDataChannel)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsDOMDataChannel,
|
||||
nsDOMEventTargetHelper)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
@ -451,6 +451,8 @@ NS_IMPL_RELEASE(nsDOMFile)
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// nsDOMFileCC implementation
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMFileCC)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_0(nsDOMFileCC)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsDOMFileCC)
|
||||
// We don't have anything to traverse, but some of our subclasses do.
|
||||
|
@ -54,6 +54,8 @@ using namespace mozilla::dom;
|
||||
#define LOADSTART_STR "loadstart"
|
||||
#define LOADEND_STR "loadend"
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMFileReader)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsDOMFileReader,
|
||||
FileIOObject)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mFile)
|
||||
|
@ -326,6 +326,8 @@ NS_INTERFACE_MAP_END
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMMutationObserver)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMMutationObserver)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMMutationObserver)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsDOMMutationObserver)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_END
|
||||
|
@ -1838,6 +1838,7 @@ CustomPrototypeTrace(const nsAString& aName, JS::Heap<JSObject*>& aObject, void
|
||||
return PL_DHASH_NEXT;
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDocument)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsDocument)
|
||||
CustomPrototypeTraceArgs customPrototypeArgs = { aCallbacks, aClosure };
|
||||
@ -2480,7 +2481,7 @@ nsDocument::SendToConsole(nsCOMArray<nsISecurityConsoleMessage>& aMessages)
|
||||
aMessages[i]->GetCategory(category);
|
||||
|
||||
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
|
||||
NS_ConvertUTF16toUTF8(category).get(),
|
||||
NS_ConvertUTF16toUTF8(category),
|
||||
this, nsContentUtils::eSECURITY_PROPERTIES,
|
||||
NS_ConvertUTF16toUTF8(messageTag).get());
|
||||
}
|
||||
@ -7788,7 +7789,7 @@ nsDocument::Destroy()
|
||||
|
||||
// XXX We really should let cycle collection do this, but that currently still
|
||||
// leaks (see https://bugzilla.mozilla.org/show_bug.cgi?id=406684).
|
||||
nsContentUtils::ReleaseWrapper(static_cast<nsINode*>(this), this);
|
||||
ReleaseWrapper(static_cast<nsINode*>(this));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -46,6 +46,8 @@ using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
using namespace mozilla::dom::ipc;
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsFrameMessageManager)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsFrameMessageManager)
|
||||
uint32_t count = tmp->mListeners.Length();
|
||||
for (uint32_t i = 0; i < count; i++) {
|
||||
|
@ -63,6 +63,8 @@ nsGenericDOMDataNode::~nsGenericDOMDataNode()
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsGenericDOMDataNode)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(nsGenericDOMDataNode)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsGenericDOMDataNode)
|
||||
@ -694,7 +696,7 @@ nsGenericDOMDataNode::DestroyContent()
|
||||
{
|
||||
// XXX We really should let cycle collection do this, but that currently still
|
||||
// leaks (see https://bugzilla.mozilla.org/show_bug.cgi?id=406684).
|
||||
nsContentUtils::ReleaseWrapper(this, this);
|
||||
ReleaseWrapper(this);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -1254,9 +1254,9 @@ nsINode::Traverse(nsINode *tmp, nsCycleCollectionTraversalCallback &cb)
|
||||
|
||||
/* static */
|
||||
void
|
||||
nsINode::Unlink(nsINode *tmp)
|
||||
nsINode::Unlink(nsINode* tmp)
|
||||
{
|
||||
nsContentUtils::ReleaseWrapper(tmp, tmp);
|
||||
tmp->ReleaseWrapper(tmp);
|
||||
|
||||
nsSlots *slots = tmp->GetExistingSlots();
|
||||
if (slots) {
|
||||
|
@ -260,7 +260,7 @@ nsInProcessTabChildGlobal::DelayedDisconnect()
|
||||
}
|
||||
|
||||
if (!mLoadingScript) {
|
||||
nsContentUtils::ReleaseWrapper(static_cast<EventTarget*>(this), this);
|
||||
ReleaseWrapper(static_cast<EventTarget*>(this));
|
||||
mGlobal = nullptr;
|
||||
} else {
|
||||
mDelayedDisconnect = true;
|
||||
|
@ -111,6 +111,8 @@ nsNodeInfo::nsNodeInfo(nsIAtom *aName, nsIAtom *aPrefix, int32_t aNamespaceID,
|
||||
|
||||
// nsISupports
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsNodeInfo)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_0(nsNodeInfo)
|
||||
|
||||
static const char* kNSURIs[] = {
|
||||
|
@ -159,6 +159,8 @@ nsNodeInfoManager::~nsNodeInfoManager()
|
||||
nsLayoutStatics::Release();
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsNodeInfoManager)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_0(nsNodeInfoManager)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsNodeInfoManager)
|
||||
if (tmp->mDocument &&
|
||||
|
@ -260,7 +260,7 @@ nsNodeUtils::LastRelease(nsINode* aNode)
|
||||
}
|
||||
}
|
||||
|
||||
nsContentUtils::ReleaseWrapper(aNode, aNode);
|
||||
aNode->ReleaseWrapper(aNode);
|
||||
}
|
||||
|
||||
struct MOZ_STACK_CLASS nsHandlerData
|
||||
|
@ -280,6 +280,8 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsRange)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMRange)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsRange)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsRange)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mOwner);
|
||||
|
@ -244,6 +244,8 @@ XMLHttpRequestAuthPrompt::PromptPassword(const PRUnichar* aDialogTitle,
|
||||
|
||||
/////////////////////////////////////////////
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsXHREventTarget)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXHREventTarget,
|
||||
nsDOMEventTargetHelper)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
@ -448,6 +450,8 @@ nsXMLHttpRequest::SetRequestObserver(nsIRequestObserver* aObserver)
|
||||
mRequestObserver = aObserver;
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsXMLHttpRequest)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsXMLHttpRequest)
|
||||
bool isBlack = tmp->IsBlack();
|
||||
if (isBlack || tmp->mWaitingForOnStopRequest) {
|
||||
@ -3808,6 +3812,8 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(nsXMLHttpRequestXPCOMifier)
|
||||
|
||||
// Can't NS_IMPL_CYCLE_COLLECTION_1 because mXHR has ambiguous
|
||||
// inheritance from nsISupports.
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsXMLHttpRequestXPCOMifier)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsXMLHttpRequestXPCOMifier)
|
||||
if (tmp->mXHR) {
|
||||
tmp->mXHR->mXPCOMifier = nullptr;
|
||||
|
@ -688,8 +688,7 @@ class nsXMLHttpRequestXPCOMifier MOZ_FINAL : public nsIStreamListener,
|
||||
public nsIChannelEventSink,
|
||||
public nsIProgressEventSink,
|
||||
public nsIInterfaceRequestor,
|
||||
public nsITimerCallback,
|
||||
public nsCycleCollectionParticipant
|
||||
public nsITimerCallback
|
||||
{
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXMLHttpRequestXPCOMifier,
|
||||
|
@ -472,6 +472,8 @@ private:
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(CanvasRenderingContext2D)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(CanvasRenderingContext2D)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(CanvasRenderingContext2D)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(CanvasRenderingContext2D)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mCanvasElement)
|
||||
for (uint32_t i = 0; i < tmp->mStyleStack.Length(); i++) {
|
||||
|
@ -18,6 +18,8 @@ namespace dom {
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(ImageData)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(ImageData)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(ImageData)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ImageData)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
@ -1022,7 +1022,7 @@ bool WebGLContext::IsExtensionSupported(WebGLExtensionID ext) const
|
||||
break;
|
||||
}
|
||||
|
||||
if (Preferences::GetBool("webgl.enable-draft-extensions", false)) {
|
||||
if (Preferences::GetBool("webgl.enable-draft-extensions", false) || IsWebGL2()) {
|
||||
switch (ext) {
|
||||
case WEBGL_draw_buffers:
|
||||
return WebGLExtensionDrawBuffers::IsSupported(this);
|
||||
|
@ -6,6 +6,7 @@
|
||||
#ifndef nsEventStates_h__
|
||||
#define nsEventStates_h__
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsDebug.h"
|
||||
|
||||
/**
|
||||
@ -20,7 +21,7 @@ class nsEventStates
|
||||
public:
|
||||
typedef uint64_t InternalType;
|
||||
|
||||
nsEventStates()
|
||||
MOZ_CONSTEXPR nsEventStates()
|
||||
: mStates(0)
|
||||
{ }
|
||||
|
||||
@ -29,12 +30,12 @@ public:
|
||||
// In that case, we could be sure that only macros at the end were creating
|
||||
// nsEventStates instances with mStates set to something else than 0.
|
||||
// Unfortunately, this constructor is needed at at least two places now.
|
||||
explicit nsEventStates(InternalType aStates)
|
||||
explicit MOZ_CONSTEXPR nsEventStates(InternalType aStates)
|
||||
: mStates(aStates)
|
||||
{ }
|
||||
|
||||
nsEventStates(const nsEventStates& aEventStates) {
|
||||
mStates = aEventStates.mStates;
|
||||
MOZ_CONSTEXPR nsEventStates(const nsEventStates& aEventStates)
|
||||
: mStates(aEventStates.mStates) {
|
||||
}
|
||||
|
||||
nsEventStates& operator=(const nsEventStates& aEventStates) {
|
||||
@ -42,7 +43,7 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
nsEventStates operator|(const nsEventStates& aEventStates) const {
|
||||
nsEventStates MOZ_CONSTEXPR operator|(const nsEventStates& aEventStates) const {
|
||||
return nsEventStates(mStates | aEventStates.mStates);
|
||||
}
|
||||
|
||||
@ -54,7 +55,7 @@ public:
|
||||
// NOTE: calling if (eventStates1 & eventStates2) will not build.
|
||||
// This might work correctly if operator bool() is defined
|
||||
// but using HasState, HasAllStates or HasAtLeastOneOfStates is recommended.
|
||||
nsEventStates operator&(const nsEventStates& aEventStates) const {
|
||||
nsEventStates MOZ_CONSTEXPR operator&(const nsEventStates& aEventStates) const {
|
||||
return nsEventStates(mStates & aEventStates.mStates);
|
||||
}
|
||||
|
||||
|
@ -134,32 +134,25 @@ Touch::InitializePoints(nsPresContext* aPresContext, nsEvent* aEvent)
|
||||
if (mPointsInitialized) {
|
||||
return;
|
||||
}
|
||||
mClientPoint = nsDOMEvent::GetClientCoords(aPresContext,
|
||||
aEvent,
|
||||
mRefPoint,
|
||||
mClientPoint);
|
||||
mPagePoint = nsDOMEvent::GetPageCoords(aPresContext,
|
||||
aEvent,
|
||||
mRefPoint,
|
||||
mClientPoint);
|
||||
mScreenPoint = nsDOMEvent::GetScreenCoords(aPresContext, aEvent, mRefPoint);
|
||||
mClientPoint = nsDOMEvent::GetClientCoords(
|
||||
aPresContext, aEvent, LayoutDeviceIntPoint::FromUntyped(mRefPoint),
|
||||
mClientPoint);
|
||||
mPagePoint = nsDOMEvent::GetPageCoords(
|
||||
aPresContext, aEvent, LayoutDeviceIntPoint::FromUntyped(mRefPoint),
|
||||
mClientPoint);
|
||||
mScreenPoint = nsDOMEvent::GetScreenCoords(aPresContext, aEvent,
|
||||
LayoutDeviceIntPoint::FromUntyped(mRefPoint));
|
||||
mPointsInitialized = true;
|
||||
}
|
||||
|
||||
bool
|
||||
Touch::Equals(nsIDOMTouch* aTouch)
|
||||
Touch::Equals(Touch* aTouch)
|
||||
{
|
||||
float force;
|
||||
float orientation;
|
||||
int32_t radiusX, radiusY;
|
||||
aTouch->GetForce(&force);
|
||||
aTouch->GetRotationAngle(&orientation);
|
||||
aTouch->GetRadiusX(&radiusX);
|
||||
aTouch->GetRadiusY(&radiusY);
|
||||
return mRefPoint != aTouch->mRefPoint ||
|
||||
(mForce != force) ||
|
||||
(mRotationAngle != orientation) ||
|
||||
(mRadius.x != radiusX) || (mRadius.y != radiusY);
|
||||
return mRefPoint == aTouch->mRefPoint &&
|
||||
mForce == aTouch->Force() &&
|
||||
mRotationAngle == aTouch->RotationAngle() &&
|
||||
mRadius.x == aTouch->RadiusX() &&
|
||||
mRadius.y == aTouch->RadiusY();
|
||||
}
|
||||
|
||||
/* virtual */ JSObject*
|
||||
|
@ -85,7 +85,7 @@ public:
|
||||
{
|
||||
mTarget = aTarget;
|
||||
}
|
||||
bool Equals(nsIDOMTouch* aTouch);
|
||||
bool Equals(Touch* aTouch);
|
||||
|
||||
virtual JSObject* WrapObject(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
|
||||
@ -105,6 +105,10 @@ public:
|
||||
float RotationAngle() const { return mRotationAngle; }
|
||||
float Force() const { return mForce; }
|
||||
|
||||
nsCOMPtr<EventTarget> mTarget;
|
||||
nsIntPoint mRefPoint;
|
||||
bool mChanged;
|
||||
uint32_t mMessage;
|
||||
int32_t mIdentifier;
|
||||
CSSIntPoint mPagePoint;
|
||||
CSSIntPoint mClientPoint;
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include <algorithm>
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
/******************************************************************/
|
||||
@ -832,8 +833,8 @@ nsContentEventHandler::OnQueryCharacterAtPoint(nsQueryContentEvent* aEvent)
|
||||
rootWidget);
|
||||
eventOnRoot.refPoint = aEvent->refPoint;
|
||||
if (rootWidget != aEvent->widget) {
|
||||
eventOnRoot.refPoint += aEvent->widget->WidgetToScreenOffset();
|
||||
eventOnRoot.refPoint -= rootWidget->WidgetToScreenOffset();
|
||||
eventOnRoot.refPoint += LayoutDeviceIntPoint::FromUntyped(
|
||||
aEvent->widget->WidgetToScreenOffset() - rootWidget->WidgetToScreenOffset());
|
||||
}
|
||||
nsPoint ptInRoot =
|
||||
nsLayoutUtils::GetEventCoordinatesRelativeTo(&eventOnRoot, rootFrame);
|
||||
@ -891,16 +892,15 @@ nsContentEventHandler::OnQueryDOMWidgetHittest(nsQueryContentEvent* aEvent)
|
||||
nsIFrame* docFrame = mPresShell->GetRootFrame();
|
||||
NS_ENSURE_TRUE(docFrame, NS_ERROR_FAILURE);
|
||||
|
||||
nsIntPoint eventLoc =
|
||||
aEvent->refPoint + aEvent->widget->WidgetToScreenOffset();
|
||||
LayoutDeviceIntPoint eventLoc = aEvent->refPoint +
|
||||
LayoutDeviceIntPoint::FromUntyped(aEvent->widget->WidgetToScreenOffset());
|
||||
nsIntRect docFrameRect = docFrame->GetScreenRect(); // Returns CSS pixels
|
||||
eventLoc.x = mPresContext->DevPixelsToIntCSSPixels(eventLoc.x);
|
||||
eventLoc.y = mPresContext->DevPixelsToIntCSSPixels(eventLoc.y);
|
||||
eventLoc.x -= docFrameRect.x;
|
||||
eventLoc.y -= docFrameRect.y;
|
||||
CSSIntPoint eventLocCSS(
|
||||
mPresContext->DevPixelsToIntCSSPixels(eventLoc.x) - docFrameRect.x,
|
||||
mPresContext->DevPixelsToIntCSSPixels(eventLoc.y) - docFrameRect.y);
|
||||
|
||||
Element* contentUnderMouse =
|
||||
doc->ElementFromPointHelper(eventLoc.x, eventLoc.y, false, false);
|
||||
doc->ElementFromPointHelper(eventLocCSS.x, eventLocCSS.y, false, false);
|
||||
if (contentUnderMouse) {
|
||||
nsIWidget* targetWidget = nullptr;
|
||||
nsIFrame* targetFrame = contentUnderMouse->GetPrimaryFrame();
|
||||
|
@ -16,6 +16,8 @@ nsDOMDataContainerEvent::nsDOMDataContainerEvent(
|
||||
mData.Init();
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMDataContainerEvent)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsDOMDataContainerEvent,
|
||||
nsDOMEvent)
|
||||
if (tmp->mData.IsInitialized())
|
||||
|
@ -31,6 +31,8 @@
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMDataTransfer)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDOMDataTransfer)
|
||||
if (tmp->mFiles) {
|
||||
tmp->mFiles->Disconnect();
|
||||
|
@ -131,6 +131,8 @@ NS_INTERFACE_MAP_END
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMEvent)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMEvent)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMEvent)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsDOMEvent)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_END
|
||||
@ -1063,7 +1065,7 @@ nsDOMEvent::Shutdown()
|
||||
nsIntPoint
|
||||
nsDOMEvent::GetScreenCoords(nsPresContext* aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIntPoint aPoint)
|
||||
LayoutDeviceIntPoint aPoint)
|
||||
{
|
||||
if (nsEventStateManager::sIsPointerLocked) {
|
||||
return nsEventStateManager::sLastScreenPoint;
|
||||
@ -1081,10 +1083,11 @@ nsDOMEvent::GetScreenCoords(nsPresContext* aPresContext,
|
||||
|
||||
nsGUIEvent* guiEvent = static_cast<nsGUIEvent*>(aEvent);
|
||||
if (!guiEvent->widget) {
|
||||
return aPoint;
|
||||
return LayoutDeviceIntPoint::ToUntyped(aPoint);
|
||||
}
|
||||
|
||||
nsIntPoint offset = aPoint + guiEvent->widget->WidgetToScreenOffset();
|
||||
LayoutDeviceIntPoint offset = aPoint +
|
||||
LayoutDeviceIntPoint::FromUntyped(guiEvent->widget->WidgetToScreenOffset());
|
||||
nscoord factor = aPresContext->DeviceContext()->UnscaledAppUnitsPerDevPixel();
|
||||
return nsIntPoint(nsPresContext::AppUnitsToIntCSSPixels(offset.x * factor),
|
||||
nsPresContext::AppUnitsToIntCSSPixels(offset.y * factor));
|
||||
@ -1094,7 +1097,7 @@ nsDOMEvent::GetScreenCoords(nsPresContext* aPresContext,
|
||||
CSSIntPoint
|
||||
nsDOMEvent::GetPageCoords(nsPresContext* aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIntPoint aPoint,
|
||||
LayoutDeviceIntPoint aPoint,
|
||||
CSSIntPoint aDefaultPoint)
|
||||
{
|
||||
CSSIntPoint pagePoint = nsDOMEvent::GetClientCoords(aPresContext,
|
||||
@ -1118,7 +1121,7 @@ nsDOMEvent::GetPageCoords(nsPresContext* aPresContext,
|
||||
CSSIntPoint
|
||||
nsDOMEvent::GetClientCoords(nsPresContext* aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIntPoint aPoint,
|
||||
LayoutDeviceIntPoint aPoint,
|
||||
CSSIntPoint aDefaultPoint)
|
||||
{
|
||||
if (nsEventStateManager::sIsPointerLocked) {
|
||||
@ -1147,7 +1150,8 @@ nsDOMEvent::GetClientCoords(nsPresContext* aPresContext,
|
||||
return CSSIntPoint(0, 0);
|
||||
}
|
||||
nsPoint pt =
|
||||
nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, aPoint, rootFrame);
|
||||
nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent,
|
||||
LayoutDeviceIntPoint::ToUntyped(aPoint), rootFrame);
|
||||
|
||||
return CSSIntPoint::FromAppUnitsRounded(pt);
|
||||
}
|
||||
|
@ -102,13 +102,15 @@ public:
|
||||
static const char* GetEventName(uint32_t aEventType);
|
||||
static mozilla::CSSIntPoint
|
||||
GetClientCoords(nsPresContext* aPresContext, nsEvent* aEvent,
|
||||
nsIntPoint aPoint, mozilla::CSSIntPoint aDefaultPoint);
|
||||
mozilla::LayoutDeviceIntPoint aPoint,
|
||||
mozilla::CSSIntPoint aDefaultPoint);
|
||||
static mozilla::CSSIntPoint
|
||||
GetPageCoords(nsPresContext* aPresContext, nsEvent* aEvent, nsIntPoint aPoint,
|
||||
GetPageCoords(nsPresContext* aPresContext, nsEvent* aEvent,
|
||||
mozilla::LayoutDeviceIntPoint aPoint,
|
||||
mozilla::CSSIntPoint aDefaultPoint);
|
||||
static nsIntPoint GetScreenCoords(nsPresContext* aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIntPoint aPoint);
|
||||
static nsIntPoint
|
||||
GetScreenCoords(nsPresContext* aPresContext, nsEvent* aEvent,
|
||||
mozilla::LayoutDeviceIntPoint aPoint);
|
||||
|
||||
static already_AddRefed<nsDOMEvent> Constructor(const mozilla::dom::GlobalObject& aGlobal,
|
||||
const nsAString& aType,
|
||||
|
@ -17,6 +17,8 @@
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMEventTargetHelper)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsDOMEventTargetHelper)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_END
|
||||
@ -83,7 +85,7 @@ nsDOMEventTargetHelper::~nsDOMEventTargetHelper()
|
||||
if (mListenerManager) {
|
||||
mListenerManager->Disconnect();
|
||||
}
|
||||
nsContentUtils::ReleaseWrapper(this, this);
|
||||
ReleaseWrapper(this);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -10,6 +10,8 @@
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMMessageEvent)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsDOMMessageEvent, nsDOMEvent)
|
||||
tmp->mData = JSVAL_VOID;
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mSource)
|
||||
|
@ -35,6 +35,8 @@ nsDOMNotifyAudioAvailableEvent::nsDOMNotifyAudioAvailableEvent(EventTarget* aOwn
|
||||
NS_IMPL_ADDREF_INHERITED(nsDOMNotifyAudioAvailableEvent, nsDOMEvent)
|
||||
NS_IMPL_RELEASE_INHERITED(nsDOMNotifyAudioAvailableEvent, nsDOMEvent)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMNotifyAudioAvailableEvent)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsDOMNotifyAudioAvailableEvent, nsDOMEvent)
|
||||
if (tmp->mCachedArray) {
|
||||
tmp->mCachedArray = nullptr;
|
||||
|
@ -85,9 +85,8 @@ nsDOMTouchEvent::nsDOMTouchEvent(mozilla::dom::EventTarget* aOwner,
|
||||
mEventIsInternal = false;
|
||||
|
||||
for (uint32_t i = 0; i < aEvent->touches.Length(); ++i) {
|
||||
nsIDOMTouch *touch = aEvent->touches[i];
|
||||
dom::Touch *domtouch = static_cast<dom::Touch*>(touch);
|
||||
domtouch->InitializePoints(mPresContext, aEvent);
|
||||
Touch* touch = aEvent->touches[i];
|
||||
touch->InitializePoints(mPresContext, aEvent);
|
||||
}
|
||||
} else {
|
||||
mEventIsInternal = true;
|
||||
|
@ -102,7 +102,8 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMUIEvent)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
|
||||
|
||||
static nsIntPoint
|
||||
DevPixelsToCSSPixels(const nsIntPoint& aPoint, nsPresContext* aContext)
|
||||
DevPixelsToCSSPixels(const LayoutDeviceIntPoint& aPoint,
|
||||
nsPresContext* aContext)
|
||||
{
|
||||
return nsIntPoint(aContext->DevPixelsToIntCSSPixels(aPoint.x),
|
||||
aContext->DevPixelsToIntCSSPixels(aPoint.y));
|
||||
@ -375,7 +376,7 @@ nsDOMUIEvent::DuplicatePrivateData()
|
||||
mEvent->refPoint);
|
||||
nsresult rv = nsDOMEvent::DuplicatePrivateData();
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
mEvent->refPoint = screenPoint;
|
||||
mEvent->refPoint = LayoutDeviceIntPoint::FromUntyped(screenPoint);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
@ -34,8 +34,8 @@ public:
|
||||
NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) MOZ_OVERRIDE;
|
||||
NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter) MOZ_OVERRIDE;
|
||||
|
||||
static nsIntPoint CalculateScreenPoint(nsPresContext* aPresContext,
|
||||
nsEvent* aEvent)
|
||||
static nsIntPoint
|
||||
CalculateScreenPoint(nsPresContext* aPresContext, nsEvent* aEvent)
|
||||
{
|
||||
if (!aEvent ||
|
||||
(aEvent->eventStructType != NS_MOUSE_EVENT &&
|
||||
@ -46,12 +46,13 @@ public:
|
||||
return nsIntPoint(0, 0);
|
||||
}
|
||||
|
||||
if (!((nsGUIEvent*)aEvent)->widget ) {
|
||||
return aEvent->refPoint;
|
||||
nsGUIEvent* event = static_cast<nsGUIEvent*>(aEvent);
|
||||
if (!event->widget) {
|
||||
return mozilla::LayoutDeviceIntPoint::ToUntyped(aEvent->refPoint);
|
||||
}
|
||||
|
||||
nsIntPoint offset = aEvent->refPoint +
|
||||
((nsGUIEvent*)aEvent)->widget->WidgetToScreenOffset();
|
||||
mozilla::LayoutDeviceIntPoint offset = aEvent->refPoint +
|
||||
mozilla::LayoutDeviceIntPoint::FromUntyped(event->widget->WidgetToScreenOffset());
|
||||
nscoord factor = aPresContext->DeviceContext()->UnscaledAppUnitsPerDevPixel();
|
||||
return nsIntPoint(nsPresContext::AppUnitsToIntCSSPixels(offset.x * factor),
|
||||
nsPresContext::AppUnitsToIntCSSPixels(offset.y * factor));
|
||||
|
@ -181,6 +181,8 @@ ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsEventListenerManager)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsEventListenerManager)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mListeners)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
@ -109,7 +109,7 @@ using namespace mozilla::dom;
|
||||
|
||||
#define NS_USER_INTERACTION_INTERVAL 5000 // ms
|
||||
|
||||
static const nsIntPoint kInvalidRefPoint = nsIntPoint(-1,-1);
|
||||
static const LayoutDeviceIntPoint kInvalidRefPoint = LayoutDeviceIntPoint(-1,-1);
|
||||
|
||||
static bool sLeftClickOnly = true;
|
||||
static bool sKeyCausesActivation = true;
|
||||
@ -120,9 +120,9 @@ bool nsEventStateManager::sNormalLMouseEventInProcess = false;
|
||||
nsEventStateManager* nsEventStateManager::sActiveESM = nullptr;
|
||||
nsIDocument* nsEventStateManager::sMouseOverDocument = nullptr;
|
||||
nsWeakFrame nsEventStateManager::sLastDragOverFrame = nullptr;
|
||||
nsIntPoint nsEventStateManager::sLastRefPoint = kInvalidRefPoint;
|
||||
nsIntPoint nsEventStateManager::sLastScreenPoint = nsIntPoint(0,0);
|
||||
nsIntPoint nsEventStateManager::sSynthCenteringPoint = kInvalidRefPoint;
|
||||
LayoutDeviceIntPoint nsEventStateManager::sLastRefPoint = kInvalidRefPoint;
|
||||
nsIntPoint nsEventStateManager::sLastScreenPoint = nsIntPoint(0, 0);
|
||||
LayoutDeviceIntPoint nsEventStateManager::sSynthCenteringPoint = kInvalidRefPoint;
|
||||
CSSIntPoint nsEventStateManager::sLastClientPoint = CSSIntPoint(0, 0);
|
||||
bool nsEventStateManager::sIsPointerLocked = false;
|
||||
// Reference to the pointer locked element.
|
||||
@ -567,7 +567,8 @@ nsMouseWheelTransaction::GetScreenPoint(nsGUIEvent* aEvent)
|
||||
{
|
||||
NS_ASSERTION(aEvent, "aEvent is null");
|
||||
NS_ASSERTION(aEvent->widget, "aEvent-widget is null");
|
||||
return aEvent->refPoint + aEvent->widget->WidgetToScreenOffset();
|
||||
return LayoutDeviceIntPoint::ToUntyped(aEvent->refPoint) +
|
||||
aEvent->widget->WidgetToScreenOffset();
|
||||
}
|
||||
|
||||
uint32_t
|
||||
@ -1547,19 +1548,18 @@ nsEventStateManager::GetChildProcessOffset(nsFrameLoader* aFrameLoader,
|
||||
nsEventStateManager::MapEventCoordinatesForChildProcess(
|
||||
const LayoutDeviceIntPoint& aOffset, nsEvent* aEvent)
|
||||
{
|
||||
nsIntPoint aOffsetIntPoint(aOffset.x, aOffset.y);
|
||||
if (aEvent->eventStructType != NS_TOUCH_EVENT) {
|
||||
aEvent->refPoint = aOffsetIntPoint;
|
||||
aEvent->refPoint = aOffset;
|
||||
} else {
|
||||
aEvent->refPoint = nsIntPoint();
|
||||
aEvent->refPoint = LayoutDeviceIntPoint();
|
||||
nsTouchEvent* touchEvent = static_cast<nsTouchEvent*>(aEvent);
|
||||
// Then offset all the touch points by that distance, to put them
|
||||
// in the space where top-left is 0,0.
|
||||
const nsTArray< nsRefPtr<Touch> >& touches = touchEvent->touches;
|
||||
for (uint32_t i = 0; i < touches.Length(); ++i) {
|
||||
nsIDOMTouch* touch = touches[i];
|
||||
Touch* touch = touches[i];
|
||||
if (touch) {
|
||||
touch->mRefPoint += aOffsetIntPoint;
|
||||
touch->mRefPoint += LayoutDeviceIntPoint::ToUntyped(aOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1641,7 +1641,7 @@ nsEventStateManager::HandleCrossProcessEvent(nsEvent *aEvent,
|
||||
nsTouchEvent* touchEvent = static_cast<nsTouchEvent*>(aEvent);
|
||||
const nsTArray< nsRefPtr<Touch> >& touches = touchEvent->touches;
|
||||
for (uint32_t i = 0; i < touches.Length(); ++i) {
|
||||
nsIDOMTouch* touch = touches[i];
|
||||
Touch* touch = touches[i];
|
||||
// NB: the |mChanged| check is an optimization, subprocesses can
|
||||
// compute this for themselves. If the touch hasn't changed, we
|
||||
// may be able to avoid forwarding the event entirely (which is
|
||||
@ -1649,7 +1649,7 @@ nsEventStateManager::HandleCrossProcessEvent(nsEvent *aEvent,
|
||||
if (!touch || !touch->mChanged) {
|
||||
continue;
|
||||
}
|
||||
nsCOMPtr<EventTarget> targetPtr = touch->GetTarget();
|
||||
nsCOMPtr<EventTarget> targetPtr = touch->mTarget;
|
||||
if (!targetPtr) {
|
||||
continue;
|
||||
}
|
||||
@ -1921,7 +1921,7 @@ nsEventStateManager::BeginTrackingDragGesture(nsPresContext* aPresContext,
|
||||
// Note that |inDownEvent| could be either a mouse down event or a
|
||||
// synthesized mouse move event.
|
||||
mGestureDownPoint = inDownEvent->refPoint +
|
||||
inDownEvent->widget->WidgetToScreenOffset();
|
||||
LayoutDeviceIntPoint::FromUntyped(inDownEvent->widget->WidgetToScreenOffset());
|
||||
|
||||
inDownFrame->GetContentForEvent(inDownEvent,
|
||||
getter_AddRefs(mGestureDownContent));
|
||||
@ -1959,8 +1959,8 @@ nsEventStateManager::FillInEventFromGestureDown(nsMouseEvent* aEvent)
|
||||
// Set the coordinates in the new event to the coordinates of
|
||||
// the old event, adjusted for the fact that the widget might be
|
||||
// different
|
||||
nsIntPoint tmpPoint = aEvent->widget->WidgetToScreenOffset();
|
||||
aEvent->refPoint = mGestureDownPoint - tmpPoint;
|
||||
aEvent->refPoint = mGestureDownPoint -
|
||||
LayoutDeviceIntPoint::FromUntyped(aEvent->widget->WidgetToScreenOffset());
|
||||
aEvent->modifiers = mGestureModifiers;
|
||||
aEvent->buttons = mGestureDownButtons;
|
||||
}
|
||||
@ -2016,7 +2016,8 @@ nsEventStateManager::GenerateDragGesture(nsPresContext* aPresContext,
|
||||
}
|
||||
|
||||
// fire drag gesture if mouse has moved enough
|
||||
nsIntPoint pt = aEvent->refPoint + aEvent->widget->WidgetToScreenOffset();
|
||||
LayoutDeviceIntPoint pt = aEvent->refPoint +
|
||||
LayoutDeviceIntPoint::FromUntyped(aEvent->widget->WidgetToScreenOffset());
|
||||
if (DeprecatedAbs(pt.x - mGestureDownPoint.x) > pixelThresholdX ||
|
||||
DeprecatedAbs(pt.y - mGestureDownPoint.y) > pixelThresholdY) {
|
||||
if (mClickHoldContextMenu) {
|
||||
@ -3486,9 +3487,9 @@ nsEventStateManager::PostHandleEvent(nsPresContext* aPresContext,
|
||||
nsMouseEvent* mouseEvent = static_cast<nsMouseEvent*>(aEvent);
|
||||
event.refPoint = mouseEvent->refPoint;
|
||||
if (mouseEvent->widget) {
|
||||
event.refPoint += mouseEvent->widget->WidgetToScreenOffset();
|
||||
event.refPoint += LayoutDeviceIntPoint::FromUntyped(mouseEvent->widget->WidgetToScreenOffset());
|
||||
}
|
||||
event.refPoint -= widget->WidgetToScreenOffset();
|
||||
event.refPoint -= LayoutDeviceIntPoint::FromUntyped(widget->WidgetToScreenOffset());
|
||||
event.modifiers = mouseEvent->modifiers;
|
||||
event.buttons = mouseEvent->buttons;
|
||||
event.inputSource = mouseEvent->inputSource;
|
||||
@ -4145,12 +4146,12 @@ nsEventStateManager::NotifyMouseOver(nsGUIEvent* aEvent, nsIContent* aContent)
|
||||
// mode (see bug 799523 comment 35, and bug 729011). Using integer CSS pix
|
||||
// makes us throw away the fractional error that results, rather than having
|
||||
// it manifest as a potential one-device-pix discrepancy.
|
||||
static nsIntPoint
|
||||
static LayoutDeviceIntPoint
|
||||
GetWindowInnerRectCenter(nsPIDOMWindow* aWindow,
|
||||
nsIWidget* aWidget,
|
||||
nsPresContext* aContext)
|
||||
{
|
||||
NS_ENSURE_TRUE(aWindow && aWidget && aContext, nsIntPoint(0,0));
|
||||
NS_ENSURE_TRUE(aWindow && aWidget && aContext, LayoutDeviceIntPoint(0, 0));
|
||||
|
||||
float cssInnerX = 0.0;
|
||||
aWindow->GetMozInnerScreenX(&cssInnerX);
|
||||
@ -4172,7 +4173,7 @@ GetWindowInnerRectCenter(nsPIDOMWindow* aWindow,
|
||||
int32_t cssScreenX = aContext->DevPixelsToIntCSSPixels(screen.x);
|
||||
int32_t cssScreenY = aContext->DevPixelsToIntCSSPixels(screen.y);
|
||||
|
||||
return nsIntPoint(
|
||||
return LayoutDeviceIntPoint(
|
||||
aContext->CSSPixelsToDevPixels(innerX - cssScreenX + innerWidth / 2),
|
||||
aContext->CSSPixelsToDevPixels(innerY - cssScreenY + innerHeight / 2));
|
||||
}
|
||||
@ -4200,9 +4201,9 @@ nsEventStateManager::GenerateMouseEnterExit(nsGUIEvent* aEvent)
|
||||
// (locked) pointer can continue moving and won't stop at the screen
|
||||
// boundary. We cancel the synthetic event so that we don't end up
|
||||
// dispatching the centering move event to content.
|
||||
nsIntPoint center = GetWindowInnerRectCenter(mDocument->GetWindow(),
|
||||
aEvent->widget,
|
||||
mPresContext);
|
||||
LayoutDeviceIntPoint center =
|
||||
GetWindowInnerRectCenter(mDocument->GetWindow(), aEvent->widget,
|
||||
mPresContext);
|
||||
aEvent->lastRefPoint = center;
|
||||
if (aEvent->refPoint != center) {
|
||||
// Mouse move doesn't finish at the center of the window. Dispatch a
|
||||
@ -4212,7 +4213,7 @@ nsEventStateManager::GenerateMouseEnterExit(nsGUIEvent* aEvent)
|
||||
// in the other branch here.
|
||||
sSynthCenteringPoint = center;
|
||||
aEvent->widget->SynthesizeNativeMouseMove(
|
||||
center + aEvent->widget->WidgetToScreenOffset());
|
||||
LayoutDeviceIntPoint::ToUntyped(center) + aEvent->widget->WidgetToScreenOffset());
|
||||
} else if (aEvent->refPoint == sSynthCenteringPoint) {
|
||||
// This is the "synthetic native" event we dispatched to re-center the
|
||||
// pointer. Cancel it so we don't expose the centering move to content.
|
||||
@ -4302,7 +4303,7 @@ nsEventStateManager::SetPointerLock(nsIWidget* aWidget,
|
||||
aWidget,
|
||||
mPresContext);
|
||||
aWidget->SynthesizeNativeMouseMove(
|
||||
sLastRefPoint + aWidget->WidgetToScreenOffset());
|
||||
LayoutDeviceIntPoint::ToUntyped(sLastRefPoint) + aWidget->WidgetToScreenOffset());
|
||||
|
||||
// Retarget all events to this element via capture.
|
||||
nsIPresShell::SetCapturingContent(aElement, CAPTURE_POINTERLOCK);
|
||||
@ -4318,7 +4319,7 @@ nsEventStateManager::SetPointerLock(nsIWidget* aWidget,
|
||||
// no movement.
|
||||
sLastRefPoint = mPreLockPoint;
|
||||
aWidget->SynthesizeNativeMouseMove(
|
||||
mPreLockPoint + aWidget->WidgetToScreenOffset());
|
||||
LayoutDeviceIntPoint::ToUntyped(mPreLockPoint) + aWidget->WidgetToScreenOffset());
|
||||
|
||||
// Don't retarget events to this element any more.
|
||||
nsIPresShell::SetCapturingContent(nullptr, CAPTURE_POINTERLOCK);
|
||||
|
@ -713,14 +713,14 @@ private:
|
||||
// Last mouse event refPoint (the offset from the widget's origin in
|
||||
// device pixels) when mouse was locked, used to restore mouse position
|
||||
// after unlocking.
|
||||
nsIntPoint mPreLockPoint;
|
||||
mozilla::LayoutDeviceIntPoint mPreLockPoint;
|
||||
|
||||
// Stores the refPoint of the last synthetic mouse move we dispatched
|
||||
// to re-center the mouse when we were pointer locked. If this is (-1,-1) it
|
||||
// means we've not recently dispatched a centering event. We use this to
|
||||
// detect when we receive the synth event, so we can cancel and not send it
|
||||
// to content.
|
||||
static nsIntPoint sSynthCenteringPoint;
|
||||
static mozilla::LayoutDeviceIntPoint sSynthCenteringPoint;
|
||||
|
||||
nsWeakFrame mCurrentTarget;
|
||||
nsCOMPtr<nsIContent> mCurrentTargetContent;
|
||||
@ -730,10 +730,10 @@ private:
|
||||
|
||||
// Stores the refPoint (the offset from the widget's origin in device
|
||||
// pixels) of the last mouse event.
|
||||
static nsIntPoint sLastRefPoint;
|
||||
static mozilla::LayoutDeviceIntPoint sLastRefPoint;
|
||||
|
||||
// member variables for the d&d gesture state machine
|
||||
nsIntPoint mGestureDownPoint; // screen coordinates
|
||||
mozilla::LayoutDeviceIntPoint mGestureDownPoint; // screen coordinates
|
||||
// The content to use as target if we start a d&d (what we drag).
|
||||
nsCOMPtr<nsIContent> mGestureDownContent;
|
||||
// The content of the frame where the mouse-down event occurred. It's the same
|
||||
|
@ -54,7 +54,7 @@ static const nsAttrValue::EnumTable* kButtonDefaultType = &kButtonTypeTable[2];
|
||||
// Construction, destruction
|
||||
HTMLButtonElement::HTMLButtonElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
FromParser aFromParser)
|
||||
: nsGenericHTMLFormElement(aNodeInfo),
|
||||
: nsGenericHTMLFormElementWithState(aNodeInfo),
|
||||
mType(kButtonDefaultType->value),
|
||||
mDisabledChanged(false),
|
||||
mInInternalActivate(false),
|
||||
@ -73,7 +73,8 @@ HTMLButtonElement::~HTMLButtonElement()
|
||||
|
||||
// nsISupports
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_INHERITED_1(HTMLButtonElement, nsGenericHTMLFormElement,
|
||||
NS_IMPL_CYCLE_COLLECTION_INHERITED_1(HTMLButtonElement,
|
||||
nsGenericHTMLFormElementWithState,
|
||||
mValidity)
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(HTMLButtonElement, Element)
|
||||
@ -82,7 +83,7 @@ NS_IMPL_RELEASE_INHERITED(HTMLButtonElement, Element)
|
||||
|
||||
// QueryInterface implementation for HTMLButtonElement
|
||||
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLButtonElement)
|
||||
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLFormElement)
|
||||
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLFormElementWithState)
|
||||
NS_INTERFACE_TABLE_INHERITED2(HTMLButtonElement,
|
||||
nsIDOMHTMLButtonElement,
|
||||
nsIConstraintValidation)
|
||||
@ -103,7 +104,7 @@ NS_IMPL_ELEMENT_CLONE(HTMLButtonElement)
|
||||
NS_IMETHODIMP
|
||||
HTMLButtonElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
||||
{
|
||||
return nsGenericHTMLFormElement::GetForm(aForm);
|
||||
return nsGenericHTMLFormElementWithState::GetForm(aForm);
|
||||
}
|
||||
|
||||
NS_IMPL_BOOL_ATTR(HTMLButtonElement, Autofocus, autofocus)
|
||||
@ -129,7 +130,7 @@ HTMLButtonElement::TabIndexDefault()
|
||||
bool
|
||||
HTMLButtonElement::IsHTMLFocusable(bool aWithMouse, bool *aIsFocusable, int32_t *aTabIndex)
|
||||
{
|
||||
if (nsGenericHTMLFormElement::IsHTMLFocusable(aWithMouse, aIsFocusable, aTabIndex)) {
|
||||
if (nsGenericHTMLFormElementWithState::IsHTMLFocusable(aWithMouse, aIsFocusable, aTabIndex)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -392,9 +393,9 @@ HTMLButtonElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
nsIContent* aBindingParent,
|
||||
bool aCompileEventHandlers)
|
||||
{
|
||||
nsresult rv = nsGenericHTMLFormElement::BindToTree(aDocument, aParent,
|
||||
aBindingParent,
|
||||
aCompileEventHandlers);
|
||||
nsresult rv =
|
||||
nsGenericHTMLFormElementWithState::BindToTree(aDocument, aParent, aBindingParent,
|
||||
aCompileEventHandlers);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Update our state; we may now be the default submit element
|
||||
@ -406,7 +407,7 @@ HTMLButtonElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
void
|
||||
HTMLButtonElement::UnbindFromTree(bool aDeep, bool aNullParent)
|
||||
{
|
||||
nsGenericHTMLFormElement::UnbindFromTree(aDeep, aNullParent);
|
||||
nsGenericHTMLFormElementWithState::UnbindFromTree(aDeep, aNullParent);
|
||||
|
||||
// Update our state; we may no longer be the default submit element
|
||||
UpdateState(false);
|
||||
@ -461,8 +462,10 @@ void
|
||||
HTMLButtonElement::DoneCreatingElement()
|
||||
{
|
||||
if (!mInhibitStateRestoration) {
|
||||
// Restore state as needed.
|
||||
RestoreFormControlState(this, this);
|
||||
nsresult rv = GenerateStateKey();
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
RestoreFormControlState();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -476,8 +479,8 @@ HTMLButtonElement::BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||
mDisabledChanged = true;
|
||||
}
|
||||
|
||||
return nsGenericHTMLFormElement::BeforeSetAttr(aNameSpaceID, aName,
|
||||
aValue, aNotify);
|
||||
return nsGenericHTMLFormElementWithState::BeforeSetAttr(aNameSpaceID, aName,
|
||||
aValue, aNotify);
|
||||
}
|
||||
|
||||
nsresult
|
||||
@ -494,8 +497,8 @@ HTMLButtonElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||
}
|
||||
}
|
||||
|
||||
return nsGenericHTMLFormElement::AfterSetAttr(aNameSpaceID, aName,
|
||||
aValue, aNotify);
|
||||
return nsGenericHTMLFormElementWithState::AfterSetAttr(aNameSpaceID, aName,
|
||||
aValue, aNotify);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
@ -528,7 +531,7 @@ HTMLButtonElement::RestoreState(nsPresState* aState)
|
||||
nsEventStates
|
||||
HTMLButtonElement::IntrinsicState() const
|
||||
{
|
||||
nsEventStates state = nsGenericHTMLFormElement::IntrinsicState();
|
||||
nsEventStates state = nsGenericHTMLFormElementWithState::IntrinsicState();
|
||||
|
||||
if (mForm && !mForm->GetValidity() && IsSubmitControl()) {
|
||||
state |= NS_EVENT_STATE_MOZ_SUBMITINVALID;
|
||||
|
@ -14,7 +14,7 @@
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class HTMLButtonElement MOZ_FINAL : public nsGenericHTMLFormElement,
|
||||
class HTMLButtonElement MOZ_FINAL : public nsGenericHTMLFormElementWithState,
|
||||
public nsIDOMHTMLButtonElement,
|
||||
public nsIConstraintValidation
|
||||
{
|
||||
@ -26,7 +26,7 @@ public:
|
||||
virtual ~HTMLButtonElement();
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLButtonElement,
|
||||
nsGenericHTMLFormElement)
|
||||
nsGenericHTMLFormElementWithState)
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
@ -27,11 +27,8 @@ NS_IMPL_CYCLE_COLLECTION_INHERITED_1(HTMLDataListElement, nsGenericHTMLElement,
|
||||
NS_IMPL_ADDREF_INHERITED(HTMLDataListElement, Element)
|
||||
NS_IMPL_RELEASE_INHERITED(HTMLDataListElement, Element)
|
||||
|
||||
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLDataListElement)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(HTMLDataListElement)
|
||||
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
|
||||
NS_INTERFACE_TABLE_INHERITED1(HTMLDataListElement,
|
||||
nsIDOMHTMLDataListElement)
|
||||
NS_INTERFACE_TABLE_TO_MAP_SEGUE
|
||||
NS_ELEMENT_INTERFACE_MAP_END
|
||||
|
||||
|
||||
@ -45,13 +42,5 @@ HTMLDataListElement::MatchOptions(nsIContent* aContent, int32_t aNamespaceID,
|
||||
!aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::disabled);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLDataListElement::GetOptions(nsIDOMHTMLCollection** aOptions)
|
||||
{
|
||||
NS_ADDREF(*aOptions = Options());
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
@ -7,14 +7,13 @@
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsIDOMHTMLDataListElement.h"
|
||||
#include "nsContentList.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class HTMLDataListElement MOZ_FINAL : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLDataListElement
|
||||
public nsIDOMHTMLElement
|
||||
{
|
||||
public:
|
||||
HTMLDataListElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
@ -35,9 +34,6 @@ public:
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
|
||||
|
||||
// nsIDOMHTMLDataListElement
|
||||
NS_DECL_NSIDOMHTMLDATALISTELEMENT
|
||||
|
||||
nsContentList* Options()
|
||||
{
|
||||
if (!mOptions) {
|
||||
|
@ -31,66 +31,13 @@ NS_IMPL_ADDREF_INHERITED(HTMLFontElement, Element)
|
||||
NS_IMPL_RELEASE_INHERITED(HTMLFontElement, Element)
|
||||
|
||||
// QueryInterface implementation for HTMLFontElement
|
||||
NS_INTERFACE_TABLE_HEAD(HTMLFontElement)
|
||||
NS_INTERFACE_MAP_BEGIN(HTMLFontElement)
|
||||
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
|
||||
NS_INTERFACE_TABLE_INHERITED1(HTMLFontElement, nsIDOMHTMLFontElement)
|
||||
NS_INTERFACE_TABLE_TO_MAP_SEGUE
|
||||
NS_ELEMENT_INTERFACE_MAP_END
|
||||
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE(HTMLFontElement)
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLFontElement::GetColor(nsAString& aColor)
|
||||
{
|
||||
nsString color;
|
||||
GetColor(color);
|
||||
aColor = color;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLFontElement::SetColor(const nsAString& aColor)
|
||||
{
|
||||
ErrorResult rv;
|
||||
SetColor(aColor, rv);
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLFontElement::GetFace(nsAString& aFace)
|
||||
{
|
||||
nsString face;
|
||||
GetFace(face);
|
||||
aFace = face;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLFontElement::SetFace(const nsAString& aFace)
|
||||
{
|
||||
ErrorResult rv;
|
||||
SetFace(aFace, rv);
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLFontElement::GetSize(nsAString& aSize)
|
||||
{
|
||||
nsString size;
|
||||
GetSize(size);
|
||||
aSize = size;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLFontElement::SetSize(const nsAString& aSize)
|
||||
{
|
||||
ErrorResult rv;
|
||||
SetSize(aSize, rv);
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
bool
|
||||
HTMLFontElement::ParseAttribute(int32_t aNamespaceID,
|
||||
nsIAtom* aAttribute,
|
||||
|
@ -7,13 +7,12 @@
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsIDOMHTMLFontElement.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class HTMLFontElement MOZ_FINAL : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLFontElement
|
||||
public nsIDOMHTMLElement
|
||||
{
|
||||
public:
|
||||
HTMLFontElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
@ -34,9 +33,6 @@ public:
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
|
||||
|
||||
// nsIDOMHTMLFontElement
|
||||
NS_DECL_NSIDOMHTMLFONTELEMENT
|
||||
|
||||
void GetColor(nsString& aColor)
|
||||
{
|
||||
GetHTMLAttr(nsGkAtoms::color, aColor);
|
||||
|
@ -299,6 +299,8 @@ ElementTraverser(const nsAString& key, nsIDOMHTMLInputElement* element,
|
||||
return PL_DHASH_NEXT;
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(HTMLFormElement)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLFormElement,
|
||||
nsGenericHTMLElement)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mControls)
|
||||
@ -2415,6 +2417,8 @@ nsFormControlList::FlushPendingNotifications()
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsFormControlList)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsFormControlList)
|
||||
tmp->Clear();
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
|
||||
|
@ -770,7 +770,7 @@ static nsresult FireEventForAccessibility(nsIDOMHTMLInputElement* aTarget,
|
||||
|
||||
HTMLInputElement::HTMLInputElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
FromParser aFromParser)
|
||||
: nsGenericHTMLFormElement(aNodeInfo)
|
||||
: nsGenericHTMLFormElementWithState(aNodeInfo)
|
||||
, mType(kInputDefaultType->value)
|
||||
, mDisabledChanged(false)
|
||||
, mValueChanged(false)
|
||||
@ -842,8 +842,10 @@ HTMLInputElement::GetEditorState() const
|
||||
|
||||
// nsISupports
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(HTMLInputElement)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLInputElement,
|
||||
nsGenericHTMLFormElement)
|
||||
nsGenericHTMLFormElementWithState)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mValidity)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mControllers)
|
||||
if (tmp->IsSingleLineTextControl(false)) {
|
||||
@ -854,7 +856,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLInputElement,
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLInputElement,
|
||||
nsGenericHTMLFormElement)
|
||||
nsGenericHTMLFormElementWithState)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mValidity)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mControllers)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mFiles)
|
||||
@ -873,7 +875,7 @@ NS_IMPL_RELEASE_INHERITED(HTMLInputElement, Element)
|
||||
|
||||
// QueryInterface implementation for HTMLInputElement
|
||||
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLInputElement)
|
||||
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLFormElement)
|
||||
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLFormElementWithState)
|
||||
NS_INTERFACE_TABLE_INHERITED8(HTMLInputElement,
|
||||
nsIDOMHTMLInputElement,
|
||||
nsITextControlElement,
|
||||
@ -975,8 +977,8 @@ HTMLInputElement::BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||
}
|
||||
}
|
||||
|
||||
return nsGenericHTMLFormElement::BeforeSetAttr(aNameSpaceID, aName,
|
||||
aValue, aNotify);
|
||||
return nsGenericHTMLFormElementWithState::BeforeSetAttr(aNameSpaceID, aName,
|
||||
aValue, aNotify);
|
||||
}
|
||||
|
||||
nsresult
|
||||
@ -1120,8 +1122,8 @@ HTMLInputElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||
UpdateState(aNotify);
|
||||
}
|
||||
|
||||
return nsGenericHTMLFormElement::AfterSetAttr(aNameSpaceID, aName,
|
||||
aValue, aNotify);
|
||||
return nsGenericHTMLFormElementWithState::AfterSetAttr(aNameSpaceID, aName,
|
||||
aValue, aNotify);
|
||||
}
|
||||
|
||||
// nsIDOMHTMLInputElement
|
||||
@ -1129,7 +1131,7 @@ HTMLInputElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||
NS_IMETHODIMP
|
||||
HTMLInputElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
||||
{
|
||||
return nsGenericHTMLFormElement::GetForm(aForm);
|
||||
return nsGenericHTMLFormElementWithState::GetForm(aForm);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(HTMLInputElement, DefaultValue, value)
|
||||
@ -2254,9 +2256,9 @@ HTMLInputElement::SetValueInternal(const nsAString& aValue,
|
||||
}
|
||||
|
||||
// Treat value == defaultValue for other input elements.
|
||||
return nsGenericHTMLFormElement::SetAttr(kNameSpaceID_None,
|
||||
nsGkAtoms::value, aValue,
|
||||
true);
|
||||
return nsGenericHTMLFormElementWithState::SetAttr(kNameSpaceID_None,
|
||||
nsGkAtoms::value, aValue,
|
||||
true);
|
||||
|
||||
case VALUE_MODE_FILENAME:
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
@ -2765,7 +2767,7 @@ HTMLInputElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
if (mType == NS_FORM_INPUT_RANGE &&
|
||||
(aVisitor.mEvent->message == NS_FOCUS_CONTENT ||
|
||||
aVisitor.mEvent->message == NS_BLUR_CONTENT)) {
|
||||
// Just as nsGenericHTMLFormElement::PreHandleEvent calls
|
||||
// Just as nsGenericHTMLFormElementWithState::PreHandleEvent calls
|
||||
// nsIFormControlFrame::SetFocus, we handle focus here.
|
||||
nsIFrame* frame = GetPrimaryFrame();
|
||||
if (frame) {
|
||||
@ -2773,7 +2775,7 @@ HTMLInputElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
}
|
||||
}
|
||||
|
||||
return nsGenericHTMLFormElement::PreHandleEvent(aVisitor);
|
||||
return nsGenericHTMLFormElementWithState::PreHandleEvent(aVisitor);
|
||||
}
|
||||
|
||||
void
|
||||
@ -3451,9 +3453,9 @@ HTMLInputElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
nsIContent* aBindingParent,
|
||||
bool aCompileEventHandlers)
|
||||
{
|
||||
nsresult rv = nsGenericHTMLFormElement::BindToTree(aDocument, aParent,
|
||||
aBindingParent,
|
||||
aCompileEventHandlers);
|
||||
nsresult rv = nsGenericHTMLFormElementWithState::BindToTree(aDocument, aParent,
|
||||
aBindingParent,
|
||||
aCompileEventHandlers);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsImageLoadingContent::BindToTree(aDocument, aParent, aBindingParent,
|
||||
@ -3500,7 +3502,7 @@ void
|
||||
HTMLInputElement::UnbindFromTree(bool aDeep, bool aNullParent)
|
||||
{
|
||||
// If we have a form and are unbound from it,
|
||||
// nsGenericHTMLFormElement::UnbindFromTree() will unset the form and
|
||||
// nsGenericHTMLFormElementWithState::UnbindFromTree() will unset the form and
|
||||
// that takes care of form's WillRemove so we just have to take care
|
||||
// of the case where we're removing from the document and we don't
|
||||
// have a form
|
||||
@ -3509,7 +3511,7 @@ HTMLInputElement::UnbindFromTree(bool aDeep, bool aNullParent)
|
||||
}
|
||||
|
||||
nsImageLoadingContent::UnbindFromTree(aDeep, aNullParent);
|
||||
nsGenericHTMLFormElement::UnbindFromTree(aDeep, aNullParent);
|
||||
nsGenericHTMLFormElementWithState::UnbindFromTree(aDeep, aNullParent);
|
||||
|
||||
// GetCurrentDoc is returning nullptr so we can update the value
|
||||
// missing validity state to reflect we are no longer into a doc.
|
||||
@ -4025,14 +4027,14 @@ MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
||||
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::type);
|
||||
if (value && value->Type() == nsAttrValue::eEnum &&
|
||||
value->GetEnumValue() == NS_FORM_INPUT_IMAGE) {
|
||||
nsGenericHTMLFormElement::MapImageBorderAttributeInto(aAttributes, aData);
|
||||
nsGenericHTMLFormElement::MapImageMarginAttributeInto(aAttributes, aData);
|
||||
nsGenericHTMLFormElement::MapImageSizeAttributesInto(aAttributes, aData);
|
||||
nsGenericHTMLFormElementWithState::MapImageBorderAttributeInto(aAttributes, aData);
|
||||
nsGenericHTMLFormElementWithState::MapImageMarginAttributeInto(aAttributes, aData);
|
||||
nsGenericHTMLFormElementWithState::MapImageSizeAttributesInto(aAttributes, aData);
|
||||
// Images treat align as "float"
|
||||
nsGenericHTMLFormElement::MapImageAlignAttributeInto(aAttributes, aData);
|
||||
nsGenericHTMLFormElementWithState::MapImageAlignAttributeInto(aAttributes, aData);
|
||||
}
|
||||
|
||||
nsGenericHTMLFormElement::MapCommonAttributesInto(aAttributes, aData);
|
||||
nsGenericHTMLFormElementWithState::MapCommonAttributesInto(aAttributes, aData);
|
||||
}
|
||||
|
||||
nsChangeHint
|
||||
@ -4040,7 +4042,7 @@ HTMLInputElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
|
||||
int32_t aModType) const
|
||||
{
|
||||
nsChangeHint retval =
|
||||
nsGenericHTMLFormElement::GetAttributeChangeHint(aAttribute, aModType);
|
||||
nsGenericHTMLFormElementWithState::GetAttributeChangeHint(aAttribute, aModType);
|
||||
if (aAttribute == nsGkAtoms::type) {
|
||||
NS_UpdateHint(retval, NS_STYLE_HINT_FRAMECHANGE);
|
||||
} else if (mType == NS_FORM_INPUT_IMAGE &&
|
||||
@ -4699,7 +4701,7 @@ HTMLInputElement::DoneCreatingElement()
|
||||
// types.
|
||||
//
|
||||
bool restoredCheckedState =
|
||||
!mInhibitRestoration && RestoreFormControlState(this, this);
|
||||
!mInhibitRestoration && NS_SUCCEEDED(GenerateStateKey()) && RestoreFormControlState();
|
||||
|
||||
//
|
||||
// If restore does not occur, we initialize .checked using the CHECKED
|
||||
@ -4726,7 +4728,7 @@ HTMLInputElement::IntrinsicState() const
|
||||
// If you add states here, and they're type-dependent, you need to add them
|
||||
// to the type case in AfterSetAttr.
|
||||
|
||||
nsEventStates state = nsGenericHTMLFormElement::IntrinsicState();
|
||||
nsEventStates state = nsGenericHTMLFormElementWithState::IntrinsicState();
|
||||
if (mType == NS_FORM_INPUT_CHECKBOX || mType == NS_FORM_INPUT_RADIO) {
|
||||
// Check current checked state (:checked)
|
||||
if (mChecked) {
|
||||
@ -4933,7 +4935,9 @@ HTMLInputElement::WillRemoveFromRadioGroup()
|
||||
bool
|
||||
HTMLInputElement::IsHTMLFocusable(bool aWithMouse, bool* aIsFocusable, int32_t* aTabIndex)
|
||||
{
|
||||
if (nsGenericHTMLFormElement::IsHTMLFocusable(aWithMouse, aIsFocusable, aTabIndex)) {
|
||||
if (nsGenericHTMLFormElementWithState::IsHTMLFocusable(aWithMouse, aIsFocusable,
|
||||
aTabIndex))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -5972,7 +5976,7 @@ HTMLInputElement::FieldSetDisabledChanged(bool aNotify)
|
||||
UpdateValueMissingValidityState();
|
||||
UpdateBarredFromConstraintValidation();
|
||||
|
||||
nsGenericHTMLFormElement::FieldSetDisabledChanged(aNotify);
|
||||
nsGenericHTMLFormElementWithState::FieldSetDisabledChanged(aNotify);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -77,7 +77,7 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class HTMLInputElement MOZ_FINAL : public nsGenericHTMLFormElement,
|
||||
class HTMLInputElement MOZ_FINAL : public nsGenericHTMLFormElementWithState,
|
||||
public nsImageLoadingContent,
|
||||
public nsIDOMHTMLInputElement,
|
||||
public nsITextControlElement,
|
||||
@ -90,7 +90,7 @@ public:
|
||||
using nsIConstraintValidation::CheckValidity;
|
||||
using nsIConstraintValidation::WillValidate;
|
||||
using nsIConstraintValidation::Validity;
|
||||
using nsGenericHTMLFormElement::GetForm;
|
||||
using nsGenericHTMLFormElementWithState::GetForm;
|
||||
|
||||
HTMLInputElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
mozilla::dom::FromParser aFromParser);
|
||||
@ -226,7 +226,7 @@ public:
|
||||
NS_IMETHOD FireAsyncClickHandler();
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLInputElement,
|
||||
nsGenericHTMLFormElement)
|
||||
nsGenericHTMLFormElementWithState)
|
||||
|
||||
static UploadLastDir* gUploadLastDir;
|
||||
// create and destroy the static UploadLastDir object for remembering
|
||||
@ -665,7 +665,7 @@ protected:
|
||||
|
||||
// Pull IsSingleLineTextControl into our scope, otherwise it'd be hidden
|
||||
// by the nsITextControlElement version.
|
||||
using nsGenericHTMLFormElement::IsSingleLineTextControl;
|
||||
using nsGenericHTMLFormElementWithState::IsSingleLineTextControl;
|
||||
|
||||
/**
|
||||
* The ValueModeType specifies how the value IDL attribute should behave.
|
||||
|
@ -115,7 +115,7 @@ DestroyMouseDownPoint(void * /*aObject*/,
|
||||
void * aPropertyValue,
|
||||
void * /*aData*/)
|
||||
{
|
||||
nsIntPoint* pt = static_cast<nsIntPoint*>(aPropertyValue);
|
||||
LayoutDeviceIntPoint* pt = static_cast<LayoutDeviceIntPoint*>(aPropertyValue);
|
||||
delete pt;
|
||||
}
|
||||
|
||||
@ -145,9 +145,10 @@ HTMLLabelElement::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
|
||||
nsMouseEvent::eLeftButton) {
|
||||
// We reset the mouse-down point on every event because there is
|
||||
// no guarantee we will reach the NS_MOUSE_CLICK code below.
|
||||
nsIntPoint *curPoint = new nsIntPoint(aVisitor.mEvent->refPoint);
|
||||
LayoutDeviceIntPoint* curPoint =
|
||||
new LayoutDeviceIntPoint(aVisitor.mEvent->refPoint);
|
||||
SetProperty(nsGkAtoms::labelMouseDownPtProperty,
|
||||
static_cast<void *>(curPoint),
|
||||
static_cast<void*>(curPoint),
|
||||
DestroyMouseDownPoint);
|
||||
}
|
||||
break;
|
||||
@ -156,12 +157,13 @@ HTMLLabelElement::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
|
||||
if (NS_IS_MOUSE_LEFT_CLICK(aVisitor.mEvent)) {
|
||||
const nsMouseEvent* event =
|
||||
static_cast<const nsMouseEvent*>(aVisitor.mEvent);
|
||||
nsIntPoint *mouseDownPoint = static_cast<nsIntPoint *>
|
||||
(GetProperty(nsGkAtoms::labelMouseDownPtProperty));
|
||||
LayoutDeviceIntPoint* mouseDownPoint =
|
||||
static_cast<LayoutDeviceIntPoint*>(
|
||||
GetProperty(nsGkAtoms::labelMouseDownPtProperty));
|
||||
|
||||
bool dragSelect = false;
|
||||
if (mouseDownPoint) {
|
||||
nsIntPoint dragDistance = *mouseDownPoint;
|
||||
LayoutDeviceIntPoint dragDistance = *mouseDownPoint;
|
||||
DeleteProperty(nsGkAtoms::labelMouseDownPtProperty);
|
||||
|
||||
dragDistance -= aVisitor.mEvent->refPoint;
|
||||
|
@ -25,30 +25,13 @@ NS_IMPL_RELEASE_INHERITED(HTMLLegendElement, Element)
|
||||
|
||||
|
||||
// QueryInterface implementation for HTMLLegendElement
|
||||
NS_INTERFACE_TABLE_HEAD(HTMLLegendElement)
|
||||
NS_INTERFACE_MAP_BEGIN(HTMLLegendElement)
|
||||
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
|
||||
NS_INTERFACE_TABLE_INHERITED1(HTMLLegendElement, nsIDOMHTMLLegendElement)
|
||||
NS_INTERFACE_TABLE_TO_MAP_SEGUE
|
||||
NS_ELEMENT_INTERFACE_MAP_END
|
||||
|
||||
|
||||
// nsIDOMHTMLLegendElement
|
||||
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE(HTMLLegendElement)
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLLegendElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
||||
{
|
||||
Element* form = GetFormElement();
|
||||
|
||||
return form ? CallQueryInterface(form, aForm) : NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMPL_STRING_ATTR(HTMLLegendElement, Align, align)
|
||||
|
||||
// this contains center, because IE4 does
|
||||
static const nsAttrValue::EnumTable kAlignTable[] = {
|
||||
{ "left", NS_STYLE_TEXT_ALIGN_LEFT },
|
||||
|
@ -7,7 +7,6 @@
|
||||
#define mozilla_dom_HTMLLegendElement_h
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsIDOMHTMLLegendElement.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "mozilla/dom/HTMLFormElement.h"
|
||||
|
||||
@ -15,7 +14,7 @@ namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class HTMLLegendElement MOZ_FINAL : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLLegendElement
|
||||
public nsIDOMHTMLElement
|
||||
{
|
||||
public:
|
||||
HTMLLegendElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
@ -35,9 +34,6 @@ public:
|
||||
// nsIDOMElement
|
||||
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
|
||||
|
||||
// nsIDOMHTMLLegendElement
|
||||
NS_DECL_NSIDOMHTMLLEGENDELEMENT
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
|
||||
|
||||
@ -86,7 +82,11 @@ public:
|
||||
|
||||
already_AddRefed<HTMLFormElement> GetForm();
|
||||
|
||||
// The XPCOM GetAlign is OK for us
|
||||
void GetAlign(nsAString& aAlign)
|
||||
{
|
||||
GetHTMLAttr(nsGkAtoms::align, aAlign);
|
||||
}
|
||||
|
||||
void SetAlign(const nsAString& aAlign, ErrorResult& aError)
|
||||
{
|
||||
SetHTMLAttr(nsGkAtoms::align, aAlign, aError);
|
||||
|
@ -40,10 +40,13 @@ HTMLLinkElement::~HTMLLinkElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(HTMLLinkElement)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLLinkElement,
|
||||
nsGenericHTMLElement)
|
||||
tmp->nsStyleLinkElement::Traverse(cb);
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLLinkElement,
|
||||
nsGenericHTMLElement)
|
||||
tmp->nsStyleLinkElement::Unlink();
|
||||
|
@ -20,6 +20,8 @@ HTMLMapElement::HTMLMapElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(HTMLMapElement)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLMapElement,
|
||||
nsGenericHTMLElement)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAreas)
|
||||
|
@ -402,6 +402,8 @@ NS_IMETHODIMP HTMLMediaElement::MediaLoadListener::GetInterface(const nsIID & aI
|
||||
NS_IMPL_ADDREF_INHERITED(HTMLMediaElement, nsGenericHTMLElement)
|
||||
NS_IMPL_RELEASE_INHERITED(HTMLMediaElement, nsGenericHTMLElement)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(HTMLMediaElement)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLMediaElement, nsGenericHTMLElement)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMediaSource)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSrcStream)
|
||||
|
@ -29,11 +29,8 @@ NS_IMPL_ADDREF_INHERITED(HTMLMeterElement, Element)
|
||||
NS_IMPL_RELEASE_INHERITED(HTMLMeterElement, Element)
|
||||
|
||||
|
||||
NS_INTERFACE_TABLE_HEAD(HTMLMeterElement)
|
||||
NS_INTERFACE_MAP_BEGIN(HTMLMeterElement)
|
||||
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
|
||||
NS_INTERFACE_TABLE_INHERITED1(HTMLMeterElement,
|
||||
nsIDOMHTMLMeterElement)
|
||||
NS_INTERFACE_TABLE_TO_MAP_SEGUE
|
||||
NS_ELEMENT_INTERFACE_MAP_END
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE(HTMLMeterElement)
|
||||
@ -223,88 +220,6 @@ HTMLMeterElement::Optimum() const
|
||||
return std::min(optimum, max);
|
||||
}
|
||||
|
||||
/*
|
||||
* XPCOM methods
|
||||
*/
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLMeterElement::GetMin(double* aValue)
|
||||
{
|
||||
*aValue = Min();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLMeterElement::SetMin(double aValue)
|
||||
{
|
||||
return SetDoubleAttr(nsGkAtoms::min, aValue);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLMeterElement::GetMax(double* aValue)
|
||||
{
|
||||
*aValue = Max();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLMeterElement::SetMax(double aValue)
|
||||
{
|
||||
return SetDoubleAttr(nsGkAtoms::max, aValue);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLMeterElement::GetValue(double* aValue)
|
||||
{
|
||||
*aValue = Value();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLMeterElement::SetValue(double aValue)
|
||||
{
|
||||
return SetDoubleAttr(nsGkAtoms::value, aValue);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLMeterElement::GetLow(double* aValue)
|
||||
{
|
||||
*aValue = Low();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLMeterElement::SetLow(double aValue)
|
||||
{
|
||||
return SetDoubleAttr(nsGkAtoms::low, aValue);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLMeterElement::GetHigh(double* aValue)
|
||||
{
|
||||
*aValue = High();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLMeterElement::SetHigh(double aValue)
|
||||
{
|
||||
return SetDoubleAttr(nsGkAtoms::high, aValue);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLMeterElement::GetOptimum(double* aValue)
|
||||
{
|
||||
*aValue = Optimum();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLMeterElement::SetOptimum(double aValue)
|
||||
{
|
||||
return SetDoubleAttr(nsGkAtoms::optimum, aValue);
|
||||
}
|
||||
|
||||
nsEventStates
|
||||
HTMLMeterElement::GetOptimumState() const
|
||||
{
|
||||
|
@ -7,7 +7,6 @@
|
||||
#define mozilla_dom_HTMLMeterElement_h
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsIDOMHTMLMeterElement.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsAttrValue.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
@ -19,7 +18,7 @@ namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class HTMLMeterElement MOZ_FINAL : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLMeterElement
|
||||
public nsIDOMHTMLElement
|
||||
{
|
||||
public:
|
||||
HTMLMeterElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
@ -37,9 +36,6 @@ public:
|
||||
/* nsIDOMHTMLElement */
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
|
||||
|
||||
/* nsIDOMHTMLMeterElement */
|
||||
NS_DECL_NSIDOMHTMLMETERELEMENT
|
||||
|
||||
virtual nsEventStates IntrinsicState() const MOZ_OVERRIDE;
|
||||
|
||||
nsresult Clone(nsINodeInfo* aNodeInfo, nsINode** aResult) const MOZ_OVERRIDE;
|
||||
@ -55,42 +51,42 @@ public:
|
||||
double Value() const;
|
||||
void SetValue(double aValue, ErrorResult& aRv)
|
||||
{
|
||||
aRv = SetValue(aValue);
|
||||
aRv = SetDoubleAttr(nsGkAtoms::value, aValue);
|
||||
}
|
||||
|
||||
/* @return the minimum value */
|
||||
double Min() const;
|
||||
void SetMin(double aValue, ErrorResult& aRv)
|
||||
{
|
||||
aRv = SetMin(aValue);
|
||||
aRv = SetDoubleAttr(nsGkAtoms::min, aValue);
|
||||
}
|
||||
|
||||
/* @return the maximum value */
|
||||
double Max() const;
|
||||
void SetMax(double aValue, ErrorResult& aRv)
|
||||
{
|
||||
aRv = SetMax(aValue);
|
||||
aRv = SetDoubleAttr(nsGkAtoms::max, aValue);
|
||||
}
|
||||
|
||||
/* @return the low value */
|
||||
double Low() const;
|
||||
void SetLow(double aValue, ErrorResult& aRv)
|
||||
{
|
||||
aRv = SetLow(aValue);
|
||||
aRv = SetDoubleAttr(nsGkAtoms::low, aValue);
|
||||
}
|
||||
|
||||
/* @return the high value */
|
||||
double High() const;
|
||||
void SetHigh(double aValue, ErrorResult& aRv)
|
||||
{
|
||||
aRv = SetHigh(aValue);
|
||||
aRv = SetDoubleAttr(nsGkAtoms::high, aValue);
|
||||
}
|
||||
|
||||
/* @return the optimum value */
|
||||
double Optimum() const;
|
||||
void SetOptimum(double aValue, ErrorResult& aRv)
|
||||
{
|
||||
aRv = SetOptimum(aValue);
|
||||
aRv = SetDoubleAttr(nsGkAtoms::optimum, aValue);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
@ -26,20 +26,13 @@ NS_IMPL_ADDREF_INHERITED(HTMLModElement, Element)
|
||||
NS_IMPL_RELEASE_INHERITED(HTMLModElement, Element)
|
||||
|
||||
// QueryInterface implementation for HTMLModElement
|
||||
NS_INTERFACE_TABLE_HEAD(HTMLModElement)
|
||||
NS_INTERFACE_MAP_BEGIN(HTMLModElement)
|
||||
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
|
||||
NS_INTERFACE_TABLE_INHERITED1(HTMLModElement,
|
||||
nsIDOMHTMLModElement)
|
||||
NS_INTERFACE_TABLE_TO_MAP_SEGUE
|
||||
NS_ELEMENT_INTERFACE_MAP_END
|
||||
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE(HTMLModElement)
|
||||
|
||||
|
||||
NS_IMPL_URI_ATTR(HTMLModElement, Cite, cite)
|
||||
NS_IMPL_STRING_ATTR(HTMLModElement, DateTime, datetime)
|
||||
|
||||
JSObject*
|
||||
HTMLModElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aScope)
|
||||
{
|
||||
|
@ -8,14 +8,13 @@
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsIDOMHTMLModElement.h"
|
||||
#include "nsGkAtoms.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class HTMLModElement MOZ_FINAL : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLModElement
|
||||
public nsIDOMHTMLElement
|
||||
{
|
||||
public:
|
||||
HTMLModElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
@ -33,9 +32,6 @@ public:
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
|
||||
|
||||
// nsIDOMHTMLModElement
|
||||
NS_DECL_NSIDOMHTMLMODELEMENT
|
||||
|
||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
|
||||
|
||||
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
|
||||
@ -48,7 +44,10 @@ public:
|
||||
{
|
||||
SetHTMLAttr(nsGkAtoms::cite, aCite, aRv);
|
||||
}
|
||||
// XPCOM GetDateTime is fine.
|
||||
void GetDateTime(nsAString& aDateTime)
|
||||
{
|
||||
GetHTMLAttr(nsGkAtoms::datetime, aDateTime);
|
||||
}
|
||||
void SetDateTime(const nsAString& aDateTime, ErrorResult& aRv)
|
||||
{
|
||||
SetHTMLAttr(nsGkAtoms::datetime, aDateTime, aRv);
|
||||
|
@ -63,11 +63,14 @@ HTMLObjectElement::DoneAddingChildren(bool aHaveNotified)
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(HTMLObjectElement)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLObjectElement,
|
||||
nsGenericHTMLFormElement)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mValidity)
|
||||
nsObjectLoadingContent::Traverse(tmp, cb);
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLObjectElement,
|
||||
nsGenericHTMLFormElement)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mValidity)
|
||||
|
@ -34,6 +34,8 @@ HTMLOutputElement::~HTMLOutputElement()
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(HTMLOutputElement)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLOutputElement,
|
||||
nsGenericHTMLFormElement)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mValidity)
|
||||
@ -53,8 +55,7 @@ NS_IMPL_RELEASE_INHERITED(HTMLOutputElement, Element)
|
||||
|
||||
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLOutputElement)
|
||||
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLFormElement)
|
||||
NS_INTERFACE_TABLE_INHERITED3(HTMLOutputElement,
|
||||
nsIDOMHTMLOutputElement,
|
||||
NS_INTERFACE_TABLE_INHERITED2(HTMLOutputElement,
|
||||
nsIMutationObserver,
|
||||
nsIConstraintValidation)
|
||||
NS_INTERFACE_TABLE_TO_MAP_SEGUE
|
||||
@ -62,20 +63,12 @@ NS_ELEMENT_INTERFACE_MAP_END
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE(HTMLOutputElement)
|
||||
|
||||
|
||||
NS_IMPL_STRING_ATTR(HTMLOutputElement, Name, name)
|
||||
|
||||
// nsIConstraintValidation
|
||||
NS_IMPL_NSICONSTRAINTVALIDATION_EXCEPT_SETCUSTOMVALIDITY(HTMLOutputElement)
|
||||
|
||||
NS_IMETHODIMP
|
||||
void
|
||||
HTMLOutputElement::SetCustomValidity(const nsAString& aError)
|
||||
{
|
||||
nsIConstraintValidation::SetCustomValidity(aError);
|
||||
|
||||
UpdateState(true);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
@ -149,49 +142,20 @@ HTMLOutputElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLOutputElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
||||
{
|
||||
return nsGenericHTMLFormElement::GetForm(aForm);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLOutputElement::GetType(nsAString& aType)
|
||||
{
|
||||
aType.AssignLiteral("output");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLOutputElement::GetValue(nsAString& aValue)
|
||||
{
|
||||
nsContentUtils::GetNodeTextContent(this, true, aValue);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLOutputElement::SetValue(const nsAString& aValue)
|
||||
void
|
||||
HTMLOutputElement::SetValue(const nsAString& aValue, ErrorResult& aRv)
|
||||
{
|
||||
mValueModeFlag = eModeValue;
|
||||
return nsContentUtils::SetNodeTextContent(this, aValue, true);
|
||||
aRv = nsContentUtils::SetNodeTextContent(this, aValue, true);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLOutputElement::GetDefaultValue(nsAString& aDefaultValue)
|
||||
{
|
||||
aDefaultValue = mDefaultValue;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLOutputElement::SetDefaultValue(const nsAString& aDefaultValue)
|
||||
void
|
||||
HTMLOutputElement::SetDefaultValue(const nsAString& aDefaultValue, ErrorResult& aRv)
|
||||
{
|
||||
mDefaultValue = aDefaultValue;
|
||||
if (mValueModeFlag == eModeDefault) {
|
||||
return nsContentUtils::SetNodeTextContent(this, mDefaultValue, true);
|
||||
aRv = nsContentUtils::SetNodeTextContent(this, mDefaultValue, true);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsDOMSettableTokenList*
|
||||
@ -203,13 +167,6 @@ HTMLOutputElement::HtmlFor()
|
||||
return mTokenList;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLOutputElement::GetHtmlFor(nsISupports** aResult)
|
||||
{
|
||||
NS_ADDREF(*aResult = HtmlFor());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void HTMLOutputElement::DescendantsChanged()
|
||||
{
|
||||
if (mValueModeFlag == eModeDefault) {
|
||||
|
@ -8,7 +8,6 @@
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsIDOMHTMLOutputElement.h"
|
||||
#include "nsStubMutationObserver.h"
|
||||
#include "nsIConstraintValidation.h"
|
||||
|
||||
@ -16,7 +15,7 @@ namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class HTMLOutputElement MOZ_FINAL : public nsGenericHTMLFormElement,
|
||||
public nsIDOMHTMLOutputElement,
|
||||
public nsIDOMHTMLElement,
|
||||
public nsStubMutationObserver,
|
||||
public nsIConstraintValidation
|
||||
{
|
||||
@ -38,9 +37,6 @@ public:
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
|
||||
|
||||
// nsIDOMHTMLOutputElement
|
||||
NS_DECL_NSIDOMHTMLOUTPUTELEMENT
|
||||
|
||||
// nsIFormControl
|
||||
NS_IMETHOD_(uint32_t) GetType() const { return NS_FORM_OUTPUT; }
|
||||
NS_IMETHOD Reset() MOZ_OVERRIDE;
|
||||
@ -79,31 +75,40 @@ public:
|
||||
// WebIDL
|
||||
nsDOMSettableTokenList* HtmlFor();
|
||||
// nsGenericHTMLFormElement::GetForm is fine.
|
||||
using nsGenericHTMLFormElement::GetForm;
|
||||
// XPCOM GetName is fine.
|
||||
void GetName(nsAString& aName)
|
||||
{
|
||||
GetHTMLAttr(nsGkAtoms::name, aName);
|
||||
}
|
||||
|
||||
void SetName(const nsAString& aName, ErrorResult& aRv)
|
||||
{
|
||||
SetHTMLAttr(nsGkAtoms::name, aName, aRv);
|
||||
}
|
||||
|
||||
// XPCOM GetType is fine.
|
||||
// XPCOM GetDefaultValue is fine.
|
||||
void SetDefaultValue(const nsAString& aDefaultValue, ErrorResult& aRv)
|
||||
void GetType(nsAString& aType)
|
||||
{
|
||||
aRv = SetDefaultValue(aDefaultValue);
|
||||
aType.AssignLiteral("output");
|
||||
}
|
||||
// XPCOM GetValue is fine.
|
||||
void SetValue(const nsAString& aValue, ErrorResult& aRv)
|
||||
|
||||
void GetDefaultValue(nsAString& aDefaultValue)
|
||||
{
|
||||
aRv = SetValue(aValue);
|
||||
aDefaultValue = mDefaultValue;
|
||||
}
|
||||
|
||||
void SetDefaultValue(const nsAString& aDefaultValue, ErrorResult& aRv);
|
||||
|
||||
void GetValue(nsAString& aValue)
|
||||
{
|
||||
nsContentUtils::GetNodeTextContent(this, true, aValue);
|
||||
}
|
||||
|
||||
void SetValue(const nsAString& aValue, ErrorResult& aRv);
|
||||
|
||||
// nsIConstraintValidation::WillValidate is fine.
|
||||
// nsIConstraintValidation::Validity() is fine.
|
||||
// nsIConstraintValidation::GetValidationMessage() is fine.
|
||||
// nsIConstraintValidation::CheckValidity() is fine.
|
||||
using nsIConstraintValidation::CheckValidity;
|
||||
// nsIConstraintValidation::SetCustomValidity() is fine.
|
||||
void SetCustomValidity(const nsAString& aError);
|
||||
|
||||
protected:
|
||||
enum ValueModeFlag {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user