Merge mozilla-central to tracemonkey.
|
@ -105,6 +105,9 @@ export::
|
|||
ifdef ENABLE_TESTS
|
||||
# Additional makefile targets to call automated test suites
|
||||
include $(topsrcdir)/testing/testsuite-targets.mk
|
||||
else
|
||||
# OS X Universal builds will want to call this, so stub it out
|
||||
package-tests:
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -1453,7 +1453,7 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
|
|||
return InitAccessible(newAcc, aAccessible, nsnull);
|
||||
}
|
||||
|
||||
PRBool isHTML = content->IsNodeOfType(nsINode::eHTML);
|
||||
PRBool isHTML = content->IsHTML();
|
||||
if (isHTML && content->Tag() == nsAccessibilityAtoms::map) {
|
||||
// Create hyper text accessible for HTML map if it is used to group links
|
||||
// (see http://www.w3.org/TR/WCAG10-HTML-TECHS/#group-bypass). If the HTML
|
||||
|
|
|
@ -298,9 +298,9 @@ nsAccessible::GetName(nsAString& aName)
|
|||
|
||||
nsIAtom *tooltipAttr = nsnull;
|
||||
|
||||
if (content->IsNodeOfType(nsINode::eHTML))
|
||||
if (content->IsHTML())
|
||||
tooltipAttr = nsAccessibilityAtoms::title;
|
||||
else if (content->IsNodeOfType(nsINode::eXUL))
|
||||
else if (content->IsXUL())
|
||||
tooltipAttr = nsAccessibilityAtoms::tooltiptext;
|
||||
else
|
||||
return NS_OK;
|
||||
|
@ -342,7 +342,7 @@ NS_IMETHODIMP nsAccessible::GetDescription(nsAString& aDescription)
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (description.IsEmpty()) {
|
||||
PRBool isXUL = content->IsNodeOfType(nsINode::eXUL);
|
||||
PRBool isXUL = content->IsXUL();
|
||||
if (isXUL) {
|
||||
// Try XUL <description control="[id]">description text</description>
|
||||
nsIContent *descriptionContent =
|
||||
|
@ -1009,7 +1009,7 @@ nsAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
|
|||
// if someone sets it on another attribute,
|
||||
// it seems reasonable to consider it unavailable
|
||||
PRBool isDisabled;
|
||||
if (content->IsNodeOfType(nsINode::eHTML)) {
|
||||
if (content->IsHTML()) {
|
||||
// In HTML, just the presence of the disabled attribute means it is disabled,
|
||||
// therefore disabled="false" indicates disabled!
|
||||
isDisabled = content->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::disabled);
|
||||
|
@ -1049,7 +1049,7 @@ nsAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
|
|||
*aState |= nsIAccessibleStates::STATE_FLOATING;
|
||||
|
||||
// Check if a XUL element has the popup attribute (an attached popup menu).
|
||||
if (content->IsNodeOfType(nsINode::eXUL))
|
||||
if (content->IsXUL())
|
||||
if (content->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::popup))
|
||||
*aState |= nsIAccessibleStates::STATE_HASPOPUP;
|
||||
|
||||
|
@ -2413,7 +2413,7 @@ nsAccessible::GetRelationByType(PRUint32 aRelationType,
|
|||
case nsIAccessibleRelation::RELATION_LABEL_FOR:
|
||||
{
|
||||
if (content->Tag() == nsAccessibilityAtoms::label) {
|
||||
nsIAtom *IDAttr = content->IsNodeOfType(nsINode::eHTML) ?
|
||||
nsIAtom *IDAttr = content->IsHTML() ?
|
||||
nsAccessibilityAtoms::_for : nsAccessibilityAtoms::control;
|
||||
rv = nsRelUtils::
|
||||
AddTargetFromIDRefAttr(aRelationType, aRelation, content, IDAttr);
|
||||
|
@ -2470,7 +2470,7 @@ nsAccessible::GetRelationByType(PRUint32 aRelationType,
|
|||
return NS_OK; // XXX bug 381599, avoid performance problems
|
||||
|
||||
if (content->Tag() == nsAccessibilityAtoms::description &&
|
||||
content->IsNodeOfType(nsINode::eXUL)) {
|
||||
content->IsXUL()) {
|
||||
// This affectively adds an optional control attribute to xul:description,
|
||||
// which only affects accessibility, by allowing the description to be
|
||||
// tied to a control.
|
||||
|
@ -2554,7 +2554,7 @@ nsAccessible::GetRelationByType(PRUint32 aRelationType,
|
|||
|
||||
case nsIAccessibleRelation::RELATION_DEFAULT_BUTTON:
|
||||
{
|
||||
if (content->IsNodeOfType(nsINode::eHTML)) {
|
||||
if (content->IsHTML()) {
|
||||
// HTML form controls implements nsIFormControl interface.
|
||||
nsCOMPtr<nsIFormControl> control(do_QueryInterface(content));
|
||||
if (control) {
|
||||
|
@ -3101,10 +3101,10 @@ nsAccessible::GetNameInternal(nsAString& aName)
|
|||
if (!content)
|
||||
return NS_OK;
|
||||
|
||||
if (content->IsNodeOfType(nsINode::eHTML))
|
||||
if (content->IsHTML())
|
||||
return GetHTMLName(aName);
|
||||
|
||||
if (content->IsNodeOfType(nsINode::eXUL))
|
||||
if (content->IsXUL())
|
||||
return GetXULName(aName);
|
||||
|
||||
return NS_OK;
|
||||
|
@ -3231,7 +3231,7 @@ nsAccessible::GetActionRule(PRUint32 aStates)
|
|||
return eJumpAction;
|
||||
|
||||
// Return "click" action on elements that have an attached popup menu.
|
||||
if (content->IsNodeOfType(nsINode::eXUL))
|
||||
if (content->IsXUL())
|
||||
if (content->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::popup))
|
||||
return eClickAction;
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ nsAccessibleTreeWalker::~nsAccessibleTreeWalker()
|
|||
void nsAccessibleTreeWalker::GetKids(nsIDOMNode *aParentNode)
|
||||
{
|
||||
nsCOMPtr<nsIContent> parentContent(do_QueryInterface(aParentNode));
|
||||
if (!parentContent || !parentContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
if (!parentContent || !parentContent->IsHTML()) {
|
||||
mState.frame = nsnull; // Don't walk frames in non-HTML content, just walk the DOM.
|
||||
}
|
||||
|
||||
|
|
|
@ -760,7 +760,7 @@ nsCoreUtils::FindDescendantPointingToIDImpl(nsCString& aIdWithSpaces,
|
|||
nsIContent*
|
||||
nsCoreUtils::GetLabelContent(nsIContent *aForNode)
|
||||
{
|
||||
if (aForNode->IsNodeOfType(nsINode::eXUL))
|
||||
if (aForNode->IsXUL())
|
||||
return FindNeighbourPointingToNode(aForNode, nsAccessibilityAtoms::control,
|
||||
nsAccessibilityAtoms::label);
|
||||
|
||||
|
|
|
@ -219,7 +219,7 @@ nsTextEquivUtils::AppendTextEquivFromTextContent(nsIContent *aContent,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
if (aContent->IsNodeOfType(nsINode::eHTML) &&
|
||||
if (aContent->IsHTML() &&
|
||||
aContent->NodeInfo()->Equals(nsAccessibilityAtoms::br)) {
|
||||
aString->AppendLiteral("\r\n");
|
||||
return NS_OK;
|
||||
|
@ -393,7 +393,7 @@ nsTextEquivUtils::AppendFromDOMNode(nsIContent *aContent, nsAString *aString)
|
|||
if (rv != NS_OK_NO_NAME_CLAUSE_HANDLED)
|
||||
return NS_OK;
|
||||
|
||||
if (aContent->IsNodeOfType(nsINode::eXUL)) {
|
||||
if (aContent->IsXUL()) {
|
||||
nsAutoString textEquivalent;
|
||||
nsCOMPtr<nsIDOMXULLabeledControlElement> labeledEl =
|
||||
do_QueryInterface(aContent);
|
||||
|
|
|
@ -408,7 +408,7 @@ nsHTMLSelectListAccessible::CacheOptSiblings(nsIAccessibilityService *aAccServic
|
|||
|
||||
for (PRUint32 count = 0; count < numChildren; count ++) {
|
||||
nsIContent *childContent = aParentContent->GetChildAt(count);
|
||||
if (!childContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
if (!childContent->IsHTML()) {
|
||||
continue;
|
||||
}
|
||||
nsCOMPtr<nsIAtom> tag = childContent->Tag();
|
||||
|
@ -835,7 +835,7 @@ nsresult nsHTMLSelectOptionAccessible::GetFocusedOptionNode(nsIDOMNode *aListNod
|
|||
void nsHTMLSelectOptionAccessible::SelectionChangedIfOption(nsIContent *aPossibleOption)
|
||||
{
|
||||
if (!aPossibleOption || aPossibleOption->Tag() != nsAccessibilityAtoms::option ||
|
||||
!aPossibleOption->IsNodeOfType(nsINode::eHTML)) {
|
||||
!aPossibleOption->IsHTML()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -633,7 +633,7 @@ nsresult nsHyperTextAccessible::DOMPointToHypertextOffset(nsIDOMNode* aNode, PRI
|
|||
nsCOMPtr<nsIAccessible> descendantAccessible;
|
||||
if (findNode) {
|
||||
nsCOMPtr<nsIContent> findContent = do_QueryInterface(findNode);
|
||||
if (findContent->IsNodeOfType(nsINode::eHTML) &&
|
||||
if (findContent->IsHTML() &&
|
||||
findContent->NodeInfo()->Equals(nsAccessibilityAtoms::br)) {
|
||||
nsIContent *parent = findContent->GetParent();
|
||||
if (parent &&
|
||||
|
|
|
@ -343,8 +343,10 @@ else
|
|||
rm -f $(DIST)/$(APP_NAME).app/Contents/MacOS/$(PROGRAM)
|
||||
rsync -aL $(PROGRAM) $(DIST)/$(APP_NAME).app/Contents/MacOS
|
||||
endif
|
||||
ifndef MOZ_COCOA_PRINTING
|
||||
mkdir -p $(DIST)/$(APP_NAME).app/Contents/Plug-Ins
|
||||
rsync -a --copy-unsafe-links $(LIBXUL_DIST)/package/PrintPDE.plugin $(DIST)/$(APP_NAME).app/Contents/Plug-Ins
|
||||
endif
|
||||
-cp -L $(DIST)/bin/mangle $(DIST)/bin/shlibsign $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)
|
||||
cp -RL $(DIST)/branding/firefox.icns $(DIST)/$(APP_NAME).app/Contents/Resources/firefox.icns
|
||||
cp -RL $(DIST)/branding/document.icns $(DIST)/$(APP_NAME).app/Contents/Resources/document.icns
|
||||
|
|
|
@ -110,8 +110,8 @@
|
|||
#endif
|
||||
<menuseparator id="aboutSeparator"/>
|
||||
<menuitem id="aboutName"
|
||||
accesskey="&aboutCmd.accesskey;"
|
||||
label="&aboutCmd.label;"
|
||||
accesskey="&aboutProduct.accesskey;"
|
||||
label="&aboutProduct.label;"
|
||||
oncommand="openAboutDialog();"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
|
|
@ -102,6 +102,10 @@
|
|||
label="&mediaHideControls.label;"
|
||||
accesskey="&mediaHideControls.accesskey;"
|
||||
oncommand="gContextMenu.mediaCommand('hidecontrols');"/>
|
||||
<menuitem id="context-video-fullscreen"
|
||||
accesskey="&videoFullScreen.accesskey;"
|
||||
label="&videoFullScreen.label;"
|
||||
oncommand="gContextMenu.fullScreenVideo();"/>
|
||||
<menuseparator id="context-media-sep-commands"/>
|
||||
<menuitem id="context-reloadimage"
|
||||
label="&reloadImageCmd.label;"
|
||||
|
|
|
@ -71,6 +71,8 @@ toolbarpaletteitem[place="palette"] > toolbaritem > hbox[type="places"] {
|
|||
}
|
||||
|
||||
/* ::::: Unified Back-/Forward Button ::::: */
|
||||
#back-button > dropmarker,
|
||||
#forward-button > dropmarker,
|
||||
#back-forward-dropmarker > image ,
|
||||
#back-forward-dropmarker > label {
|
||||
display: none;
|
||||
|
|
|
@ -83,10 +83,6 @@ var gContextMenu = null;
|
|||
var gAutoHideTabbarPrefListener = null;
|
||||
var gBookmarkAllTabsHandler = null;
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
var gClickAndHoldTimer = null;
|
||||
#endif
|
||||
|
||||
#ifndef XP_MACOSX
|
||||
var gEditUIVisible = true;
|
||||
#endif
|
||||
|
@ -195,50 +191,47 @@ function UpdateBackForwardCommands(aWebNavigation) {
|
|||
* Click-and-Hold implementation for the Back and Forward buttons
|
||||
* XXXmano: should this live in toolbarbutton.xml?
|
||||
*/
|
||||
function ClickAndHoldMouseDownCallback(aButton) {
|
||||
aButton.open = true;
|
||||
gClickAndHoldTimer = null;
|
||||
}
|
||||
|
||||
function ClickAndHoldMouseDown(aEvent) {
|
||||
/**
|
||||
* 1. Only left click starts the click and hold timer.
|
||||
* 2. Exclude the dropmarker area. This is done by excluding
|
||||
* elements which target their events directly to the toolbarbutton
|
||||
* element, i.e. when the nearest-parent-element which allows-events
|
||||
* is the toolbarbutton element itself.
|
||||
* 3. Do not start the click-and-hold timer if the toolbarbutton is disabled.
|
||||
*/
|
||||
if (aEvent.button != 0 ||
|
||||
aEvent.originalTarget == aEvent.currentTarget ||
|
||||
aEvent.currentTarget.disabled)
|
||||
return;
|
||||
|
||||
gClickAndHoldTimer =
|
||||
setTimeout(ClickAndHoldMouseDownCallback, 500, aEvent.currentTarget);
|
||||
}
|
||||
|
||||
function MayStopClickAndHoldTimer(aEvent) {
|
||||
// Note passing null here is a no-op
|
||||
clearTimeout(gClickAndHoldTimer);
|
||||
}
|
||||
|
||||
function ClickAndHoldStopEvent(aEvent) {
|
||||
if (aEvent.originalTarget.localName != "menuitem" &&
|
||||
aEvent.currentTarget.open)
|
||||
aEvent.stopPropagation();
|
||||
}
|
||||
|
||||
function SetClickAndHoldHandlers() {
|
||||
function _addClickAndHoldListenersOnElement(aElm) {
|
||||
aElm.addEventListener("mousedown", ClickAndHoldMouseDown, false);
|
||||
aElm.addEventListener("mouseup", MayStopClickAndHoldTimer, false);
|
||||
aElm.addEventListener("mouseout", MayStopClickAndHoldTimer, false);
|
||||
var timer;
|
||||
|
||||
// don't propagate onclick and oncommand events after
|
||||
// click-and-hold opened the drop-down menu
|
||||
aElm.addEventListener("command", ClickAndHoldStopEvent, true);
|
||||
aElm.addEventListener("click", ClickAndHoldStopEvent, true);
|
||||
function timerCallback(aButton) {
|
||||
aButton.firstChild.hidden = false;
|
||||
aButton.open = true;
|
||||
timer = null;
|
||||
}
|
||||
|
||||
function mousedownHandler(aEvent) {
|
||||
if (aEvent.button != 0 ||
|
||||
aEvent.currentTarget.open ||
|
||||
aEvent.currentTarget.disabled)
|
||||
return;
|
||||
|
||||
// Prevent the menupopup from opening immediately
|
||||
aEvent.currentTarget.firstChild.hidden = true;
|
||||
|
||||
timer = setTimeout(timerCallback, 500, aEvent.currentTarget);
|
||||
}
|
||||
|
||||
function clickHandler(aEvent) {
|
||||
if (aEvent.button == 0 &&
|
||||
aEvent.target == aEvent.currentTarget &&
|
||||
!aEvent.currentTarget.open &&
|
||||
!aEvent.currentTarget.disabled)
|
||||
aEvent.currentTarget.doCommand();
|
||||
}
|
||||
|
||||
function stopTimer(aEvent) {
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
timer = null;
|
||||
}
|
||||
}
|
||||
|
||||
function _addClickAndHoldListenersOnElement(aElm) {
|
||||
aElm.addEventListener("mousedown", mousedownHandler, true);
|
||||
aElm.addEventListener("mouseup", stopTimer, false);
|
||||
aElm.addEventListener("mouseout", stopTimer, false);
|
||||
aElm.addEventListener("click", clickHandler, true);
|
||||
}
|
||||
|
||||
// Bug 414797: Clone the dropmarker's menu into both the back and
|
||||
|
@ -248,12 +241,12 @@ function SetClickAndHoldHandlers() {
|
|||
var popup = document.getElementById("back-forward-dropmarker")
|
||||
.firstChild.cloneNode(true);
|
||||
var backButton = document.getElementById("back-button");
|
||||
backButton.setAttribute("type", "menu-button");
|
||||
backButton.setAttribute("type", "menu");
|
||||
backButton.appendChild(popup);
|
||||
_addClickAndHoldListenersOnElement(backButton);
|
||||
var forwardButton = document.getElementById("forward-button");
|
||||
popup = popup.cloneNode(true);
|
||||
forwardButton.setAttribute("type", "menu-button");
|
||||
forwardButton.setAttribute("type", "menu");
|
||||
forwardButton.appendChild(popup);
|
||||
_addClickAndHoldListenersOnElement(forwardButton);
|
||||
unifiedButton._clickHandlersAttached = true;
|
||||
|
|
|
@ -0,0 +1,203 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is the Mozilla Foundation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2008
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Dão Gottwald <dao@mozilla.com>
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<style type="text/css"><![CDATA[
|
||||
|
||||
html,
|
||||
body,
|
||||
video {
|
||||
height: 100%;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
background: black;
|
||||
overflow: -moz-hidden-unscrollable;
|
||||
}
|
||||
body.userIdle {
|
||||
cursor: none;
|
||||
}
|
||||
video {
|
||||
width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
body.loadingdata > video,
|
||||
body.loadingdata > #close,
|
||||
body.userIdle > #close {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
]]></style>
|
||||
<link href="chrome://browser/skin/fullscreen-video.css"
|
||||
rel="stylesheet" type="text/css"/>
|
||||
<script type="application/javascript"><![CDATA[
|
||||
|
||||
var contentVideo = window.arguments[0];
|
||||
var video;
|
||||
|
||||
var title = (contentVideo.currentSrc || contentVideo.src).replace(/^.*\//, "");
|
||||
try {
|
||||
title = decodeURI(title);
|
||||
} catch (e) {}
|
||||
document.title = title;
|
||||
|
||||
window.addEventListener("focus", function () {
|
||||
window.removeEventListener("focus", arguments.callee, false);
|
||||
|
||||
window.fullScreen = true;
|
||||
|
||||
video = document.querySelector("video");
|
||||
|
||||
video.addEventListener("loadeddata", function () {
|
||||
video.removeEventListener("loadeddata", arguments.callee, false);
|
||||
video.volume = contentVideo.volume;
|
||||
video.muted = contentVideo.muted;
|
||||
video.poster = contentVideo.poster;
|
||||
|
||||
if (contentVideo.currentTime && !contentVideo.ended) {
|
||||
video.addEventListener("seeked", function () {
|
||||
video.removeEventListener("seeked", arguments.callee, false);
|
||||
playbackStarts();
|
||||
}, false);
|
||||
|
||||
video.currentTime = contentVideo.currentTime;
|
||||
} else {
|
||||
playbackStarts();
|
||||
}
|
||||
|
||||
video.controls = true;
|
||||
video.play();
|
||||
}, false);
|
||||
|
||||
// Automatically close this window when the playback ended, unless the user
|
||||
// interacted with it.
|
||||
video.addEventListener("ended", autoClose, false);
|
||||
window.addEventListener("click", cancelAutoClose, false);
|
||||
window.addEventListener("keypress", cancelAutoClose, false);
|
||||
|
||||
video.addEventListener("playing", hideUI, false);
|
||||
video.addEventListener("seeked", hideUI, false);
|
||||
video.addEventListener("seeking", showUI, false);
|
||||
video.addEventListener("pause", showUI, false);
|
||||
video.addEventListener("ended", showUI, false);
|
||||
|
||||
window.addEventListener("mousemove", function () {
|
||||
showUI();
|
||||
resetIdleTimer();
|
||||
}, false);
|
||||
|
||||
video.mozLoadFrom(contentVideo);
|
||||
}, false);
|
||||
|
||||
window.addEventListener("unload", function () {
|
||||
if (video.currentSrc) {
|
||||
contentVideo.currentTime = video.currentTime;
|
||||
contentVideo.volume = video.volume;
|
||||
contentVideo.muted = video.muted;
|
||||
if (!video.paused && !video.ended) {
|
||||
video.pause();
|
||||
contentVideo.play();
|
||||
}
|
||||
}
|
||||
}, false);
|
||||
|
||||
window.addEventListener("keypress", function (event) {
|
||||
if (event.keyCode == event.DOM_VK_ESCAPE) {
|
||||
window.close();
|
||||
return;
|
||||
}
|
||||
|
||||
resetIdleTimer();
|
||||
|
||||
if (!video.controls &&
|
||||
String.fromCharCode(event.charCode) == " ")
|
||||
video.pause();
|
||||
}, false);
|
||||
|
||||
function playbackStarts() {
|
||||
// Loading the data from the content video may take a second or two. We hide
|
||||
// the video during that period.
|
||||
document.body.classList.remove("loadingdata");
|
||||
video.focus();
|
||||
}
|
||||
|
||||
function autoClose() {
|
||||
window.close();
|
||||
}
|
||||
|
||||
function cancelAutoClose() {
|
||||
video.removeEventListener("ended", autoClose, false);
|
||||
window.removeEventListener("click", cancelAutoClose, false);
|
||||
window.removeEventListener("keypress", cancelAutoClose, false);
|
||||
}
|
||||
|
||||
var idleTimer;
|
||||
function resetIdleTimer() {
|
||||
if (idleTimer) {
|
||||
clearTimeout(idleTimer);
|
||||
idleTimer = 0;
|
||||
}
|
||||
idleTimer = setTimeout(function () {
|
||||
idleTimer = 0;
|
||||
hideUI();
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
function showUI() {
|
||||
if (!video.controls) {
|
||||
document.body.classList.remove("userIdle");
|
||||
video.controls = true;
|
||||
}
|
||||
}
|
||||
|
||||
function hideUI() {
|
||||
if (!video.paused && !video.ended && !video.seeking && !video.error) {
|
||||
document.body.classList.add("userIdle");
|
||||
video.controls = false;
|
||||
}
|
||||
}
|
||||
|
||||
]]></script>
|
||||
</head>
|
||||
<body class="loadingdata">
|
||||
<span id="close" onclick="window.close();"/>
|
||||
<video/>
|
||||
</body>
|
||||
</html>
|
|
@ -414,8 +414,9 @@ nsContextMenu.prototype = {
|
|||
this.showItem("context-media-pause", onMedia && !this.target.paused && !this.target.ended);
|
||||
this.showItem("context-media-mute", onMedia && !this.target.muted);
|
||||
this.showItem("context-media-unmute", onMedia && this.target.muted);
|
||||
this.showItem("context-media-showcontrols", onMedia && !this.target.controls)
|
||||
this.showItem("context-media-hidecontrols", onMedia && this.target.controls)
|
||||
this.showItem("context-media-showcontrols", onMedia && !this.target.controls);
|
||||
this.showItem("context-media-hidecontrols", onMedia && this.target.controls);
|
||||
this.showItem("context-video-fullscreen", this.onVideo);
|
||||
// Disable them when there isn't a valid media source loaded.
|
||||
if (onMedia) {
|
||||
var hasError = (this.target.error != null);
|
||||
|
@ -425,6 +426,8 @@ nsContextMenu.prototype = {
|
|||
this.setItemAttr("context-media-unmute", "disabled", hasError);
|
||||
this.setItemAttr("context-media-showcontrols", "disabled", hasError);
|
||||
this.setItemAttr("context-media-hidecontrols", "disabled", hasError);
|
||||
if (this.onVideo)
|
||||
this.setItemAttr("context-video-fullscreen", "disabled", hasError);
|
||||
}
|
||||
this.showItem("context-media-sep-commands", onMedia);
|
||||
},
|
||||
|
@ -803,6 +806,13 @@ nsContextMenu.prototype = {
|
|||
openUILink(viewURL, e, null, null, null, null, doc.documentURIObject );
|
||||
},
|
||||
|
||||
fullScreenVideo: function () {
|
||||
this.target.pause();
|
||||
|
||||
openDialog("chrome://browser/content/fullscreen-video.xhtml",
|
||||
"", "chrome,dialog=no", this.target);
|
||||
},
|
||||
|
||||
// Change current window to the URL of the background image.
|
||||
viewBGImage: function(e) {
|
||||
urlSecurityCheck(this.bgImageURL,
|
||||
|
@ -1370,17 +1380,11 @@ nsContextMenu.prototype = {
|
|||
if (itemId == -1) {
|
||||
var title = doc.title;
|
||||
var description = PlacesUIUtils.getDescriptionFromDocument(doc);
|
||||
|
||||
var descAnno = { name: DESCRIPTION_ANNO, value: description };
|
||||
var txn = PlacesUIUtils.ptm.createItem(uri,
|
||||
PlacesUtils.bookmarksMenuFolderId,
|
||||
-1, title, null, [descAnno]);
|
||||
PlacesUIUtils.ptm.doTransaction(txn);
|
||||
itemId = PlacesUtils.getMostRecentBookmarkForURI(uri);
|
||||
StarUI.beginBatch();
|
||||
PlacesUIUtils.showMinimalAddBookmarkUI(uri, title, description);
|
||||
}
|
||||
|
||||
window.top.StarUI.showEditBookmarkPopup(itemId, this.browser, "overlap");
|
||||
else
|
||||
PlacesUIUtils.showItemProperties(itemId,
|
||||
PlacesUtils.bookmarks.TYPE_BOOKMARK);
|
||||
},
|
||||
|
||||
savePageAs: function CM_savePageAs() {
|
||||
|
|
|
@ -305,6 +305,14 @@
|
|||
// count of open requests (should always be 0 or 1)
|
||||
mRequestCount: 0,
|
||||
|
||||
destroy: function () {
|
||||
this._cancelStalledTimer();
|
||||
this.mTab.removeAttribute("stalled");
|
||||
delete this.mTab;
|
||||
delete this.mBrowser;
|
||||
delete this.mTabBrowser;
|
||||
},
|
||||
|
||||
onProgressChange : function (aWebProgress, aRequest,
|
||||
aCurSelfProgress, aMaxSelfProgress,
|
||||
aCurTotalProgress, aMaxTotalProgress)
|
||||
|
@ -314,6 +322,16 @@
|
|||
if (this.mBlank)
|
||||
return;
|
||||
|
||||
if (this.mTotalProgress) {
|
||||
const STATES = 8;
|
||||
let state = Math.ceil(STATES * this.mTotalProgress);
|
||||
if (state != this.mTab.getAttribute("progress")) {
|
||||
this.mTab.setAttribute("progress", state);
|
||||
this.mTab.removeAttribute("stalled");
|
||||
this._startStalledTimer();
|
||||
}
|
||||
}
|
||||
|
||||
if (this.mTabBrowser.mCurrentTab == this.mTab) {
|
||||
for (let i = 0; i < this.mTabBrowser.mProgressListeners.length; i++) {
|
||||
let p = this.mTabBrowser.mProgressListeners[i];
|
||||
|
@ -393,6 +411,7 @@
|
|||
if (!this.mBlank) {
|
||||
if (!(aStateFlags & nsIWebProgressListener.STATE_RESTORING)) {
|
||||
this.mTab.setAttribute("busy", "true");
|
||||
this._startStalledTimer();
|
||||
this.mTabBrowser.updateIcon(this.mTab);
|
||||
this.mTabBrowser.setTabTitleLoading(this.mTab);
|
||||
}
|
||||
|
@ -419,6 +438,9 @@
|
|||
this.mBlank = false;
|
||||
|
||||
this.mTab.removeAttribute("busy");
|
||||
this.mTab.removeAttribute("progress");
|
||||
this.mTab.removeAttribute("stalled");
|
||||
this._cancelStalledTimer();
|
||||
this.mTabBrowser.updateIcon(this.mTab);
|
||||
|
||||
var location = aRequest.QueryInterface(nsIChannel).URI;
|
||||
|
@ -613,6 +635,20 @@
|
|||
aIID.equals(Components.interfaces.nsISupports))
|
||||
return this;
|
||||
throw Components.results.NS_NOINTERFACE;
|
||||
},
|
||||
|
||||
_startStalledTimer: function () {
|
||||
this._cancelStalledTimer();
|
||||
this._stalledTimer = setTimeout(function (self) {
|
||||
self.mTab.setAttribute("stalled", "true");
|
||||
}, 700, this);
|
||||
},
|
||||
|
||||
_cancelStalledTimer: function () {
|
||||
if (this._stalledTimer) {
|
||||
clearTimeout(this._stalledTimer);
|
||||
this._stalledTimer = 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
]]>
|
||||
|
@ -1496,6 +1532,7 @@
|
|||
const filter = this.mTabFilters[aTab._tPos];
|
||||
browser.webProgress.removeProgressListener(filter);
|
||||
filter.removeProgressListener(this.mTabListeners[aTab._tPos]);
|
||||
this.mTabListeners[aTab._tPos].destroy();
|
||||
|
||||
// Remove our title change and blocking listeners
|
||||
browser.removeEventListener("DOMTitleChanged", this.onTitleChanged, true);
|
||||
|
@ -2736,6 +2773,7 @@
|
|||
this.getBrowserAtIndex(i).webProgress.removeProgressListener(this.mTabFilters[i]);
|
||||
this.mTabFilters[i].removeProgressListener(this.mTabListeners[i]);
|
||||
this.mTabFilters[i] = null;
|
||||
this.mTabListeners[i].destroy();
|
||||
this.mTabListeners[i] = null;
|
||||
this.getBrowserAtIndex(i).removeEventListener("DOMTitleChanged", this.onTitleChanged, true);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ function openContextMenuFor(element) {
|
|||
// Context menu should be closed before we open it again.
|
||||
is(contextMenu.state, "closed", "checking if popup is closed");
|
||||
|
||||
var eventDetails = { type : "contextmenu", button : 2 }
|
||||
var eventDetails = { type : "contextmenu", button : 2 };
|
||||
synthesizeMouse(element, 2, 2, eventDetails, element.ownerDocument.defaultView);
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ function getVisibleMenuItems(aMenu) {
|
|||
if (accessKeys[key])
|
||||
ok(false, "menuitem " + item.id + " has same accesskey as " + accessKeys[key]);
|
||||
else
|
||||
accessKeys[key] = item.id
|
||||
accessKeys[key] = item.id;
|
||||
items.push(item.id);
|
||||
items.push(!item.disabled);
|
||||
} else if (item.nodeName == "menuseparator") {
|
||||
|
@ -67,7 +67,7 @@ function getVisibleMenuItems(aMenu) {
|
|||
if (accessKeys[key])
|
||||
ok(false, "menu " + item.id + " has same accesskey as " + accessKeys[key]);
|
||||
else
|
||||
accessKeys[key] = item.id
|
||||
accessKeys[key] = item.id;
|
||||
items.push(item.id);
|
||||
items.push(!item.disabled);
|
||||
// Add a dummy item to that the indexes in checkMenu are the same
|
||||
|
@ -161,7 +161,7 @@ function runTest(testNum) {
|
|||
"---", null,
|
||||
"context-viewsource", true,
|
||||
"context-viewinfo", true]);
|
||||
closeContextMenu()
|
||||
closeContextMenu();
|
||||
openContextMenuFor(link); // Invoke context menu for next test.
|
||||
break;
|
||||
|
||||
|
@ -174,14 +174,14 @@ function runTest(testNum) {
|
|||
"context-savelink", true,
|
||||
"context-sendlink", true,
|
||||
"context-copylink", true]);
|
||||
closeContextMenu()
|
||||
closeContextMenu();
|
||||
openContextMenuFor(mailto); // Invoke context menu for next test.
|
||||
break;
|
||||
|
||||
case 4:
|
||||
// Context menu for text mailto-link
|
||||
checkContextMenu(["context-copyemail", true]);
|
||||
closeContextMenu()
|
||||
closeContextMenu();
|
||||
openContextMenuFor(input); // Invoke context menu for next test.
|
||||
break;
|
||||
|
||||
|
@ -197,7 +197,7 @@ function runTest(testNum) {
|
|||
"context-selectall", true,
|
||||
"---", null,
|
||||
"spell-check-enabled", true]);
|
||||
closeContextMenu()
|
||||
closeContextMenu();
|
||||
openContextMenuFor(img); // Invoke context menu for next test.
|
||||
break;
|
||||
|
||||
|
@ -230,6 +230,7 @@ function runTest(testNum) {
|
|||
checkContextMenu(["context-media-play", true,
|
||||
"context-media-mute", true,
|
||||
"context-media-showcontrols", true,
|
||||
"context-video-fullscreen", true,
|
||||
"---", null,
|
||||
"context-viewvideo", true,
|
||||
"context-copyvideourl", true,
|
||||
|
@ -245,6 +246,7 @@ function runTest(testNum) {
|
|||
checkContextMenu(["context-media-play", false,
|
||||
"context-media-mute", false,
|
||||
"context-media-showcontrols", false,
|
||||
"context-video-fullscreen", false,
|
||||
"---", null,
|
||||
"context-viewvideo", true,
|
||||
"context-copyvideourl", true,
|
||||
|
@ -260,6 +262,7 @@ function runTest(testNum) {
|
|||
checkContextMenu(["context-media-play", false,
|
||||
"context-media-mute", false,
|
||||
"context-media-showcontrols", false,
|
||||
"context-video-fullscreen", false,
|
||||
"---", null,
|
||||
"context-viewvideo", false,
|
||||
"context-copyvideourl", false,
|
||||
|
|
|
@ -24,6 +24,7 @@ browser.jar:
|
|||
* content/browser/browser.xul (content/browser.xul)
|
||||
* content/browser/browser-tabPreviews.xml (content/browser-tabPreviews.xml)
|
||||
* content/browser/credits.xhtml (content/credits.xhtml)
|
||||
* content/browser/fullscreen-video.xhtml (content/fullscreen-video.xhtml)
|
||||
* content/browser/pageinfo/pageInfo.xul (content/pageinfo/pageInfo.xul)
|
||||
* content/browser/pageinfo/pageInfo.js (content/pageinfo/pageInfo.js)
|
||||
* content/browser/pageinfo/pageInfo.css (content/pageinfo/pageInfo.css)
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
for the help button in the menubar but Gnome does not. -->
|
||||
<!ENTITY helpMenuWin.label "Help">
|
||||
<!ENTITY helpMenuWin.accesskey "H">
|
||||
<!ENTITY aboutCmd.label "About &brandFullName;">
|
||||
<!ENTITY aboutCmd.accesskey "A">
|
||||
<!ENTITY aboutProduct.label "About &brandShortName;">
|
||||
<!ENTITY aboutProduct.accesskey "A">
|
||||
<!ENTITY productHelp.label "&brandShortName; Help">
|
||||
<!ENTITY productHelp.accesskey "H">
|
||||
<!ENTITY helpForIEUsers.label "For Internet Explorer Users">
|
||||
|
|
|
@ -335,6 +335,8 @@
|
|||
<!ENTITY mediaShowControls.accesskey "C">
|
||||
<!ENTITY mediaHideControls.label "Hide Controls">
|
||||
<!ENTITY mediaHideControls.accesskey "C">
|
||||
<!ENTITY videoFullScreen.label "Full Screen">
|
||||
<!ENTITY videoFullScreen.accesskey "F">
|
||||
|
||||
|
||||
<!-- LOCALIZATION NOTE :
|
||||
|
|
|
@ -1127,7 +1127,35 @@ tabpanels {
|
|||
}
|
||||
|
||||
.tabbrowser-tab[busy] > .tab-icon-image {
|
||||
list-style-image: url("chrome://global/skin/icons/loading_16.png") !important;
|
||||
list-style-image: url("chrome://browser/skin/tabbrowser/progress.png") !important;
|
||||
-moz-image-region: rect(0, 16px, 16px, 0);
|
||||
}
|
||||
.tabbrowser-tab[busy][stalled] > .tab-icon-image {
|
||||
list-style-image: url("chrome://browser/skin/tabbrowser/progress-pulsing.png") !important;
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="1"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 32px, 16px, 16px);
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="2"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 48px, 16px, 32px);
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="3"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 64px, 16px, 48px);
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="4"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 80px, 16px, 64px);
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="5"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 96px, 16px, 80px);
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="6"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 112px, 16px, 96px);
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="7"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 128px, 16px, 112px);
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="8"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 144px, 16px, 128px);
|
||||
}
|
||||
|
||||
.tabs-bottom {
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
#close {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
background: url(KUI-close.png) center center no-repeat;
|
||||
}
|
|
@ -8,6 +8,7 @@ browser.jar:
|
|||
skin/classic/browser/aboutCertError.css (aboutCertError.css)
|
||||
* skin/classic/browser/browser.css (browser.css)
|
||||
* skin/classic/browser/engineManager.css (engineManager.css)
|
||||
skin/classic/browser/fullscreen-video.css
|
||||
skin/classic/browser/Geo.png
|
||||
skin/classic/browser/Go-arrow.png
|
||||
skin/classic/browser/identity.png
|
||||
|
@ -59,4 +60,6 @@ browser.jar:
|
|||
* skin/classic/browser/preferences/preferences.css (preferences/preferences.css)
|
||||
skin/classic/browser/preferences/applications.css (preferences/applications.css)
|
||||
skin/classic/browser/tabbrowser/alltabs.png (tabbrowser/alltabs.png)
|
||||
skin/classic/browser/tabbrowser/progress.png (tabbrowser/progress.png)
|
||||
skin/classic/browser/tabbrowser/progress-pulsing.png (tabbrowser/progress-pulsing.png)
|
||||
skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png)
|
||||
|
|
После Ширина: | Высота: | Размер: 10 KiB |
После Ширина: | Высота: | Размер: 2.0 KiB |
Двоичные данные
browser/themes/pinstripe/browser/Toolbar.png
До Ширина: | Высота: | Размер: 34 KiB После Ширина: | Высота: | Размер: 33 KiB |
|
@ -387,26 +387,6 @@ menubutton:not([disabled="true"]):hover:active {
|
|||
color: ButtonText !important;
|
||||
}
|
||||
|
||||
toolbar:not([mode="text"]) #back-button .toolbarbutton-menubutton-button,
|
||||
toolbar:not([mode="text"]) #forward-button .toolbarbutton-menubutton-button {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
toolbar:not([mode="text"]) #back-button .toolbarbutton-menubutton-dropmarker,
|
||||
toolbar:not([mode="text"]) #forward-button .toolbarbutton-menubutton-dropmarker {
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
||||
toolbar[mode="icons"] #back-button .toolbarbutton-text-box,
|
||||
toolbar[mode="icons"] #forward-button .toolbarbutton-text-box,
|
||||
#back-button > dropmarker,
|
||||
#forward-button > dropmarker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#back-button:-moz-locale-dir(rtl) > .toolbarbutton-icon,
|
||||
#forward-button:-moz-locale-dir(rtl) > .toolbarbutton-icon,
|
||||
#back-forward-dropmarker:-moz-locale-dir(rtl) > .toolbarbutton-icon {
|
||||
|
@ -1497,7 +1477,35 @@ tabbrowser > tabbox {
|
|||
}
|
||||
|
||||
.tabbrowser-tab[busy] > .tab-icon-image {
|
||||
list-style-image: url("chrome://global/skin/icons/loading_16.png") !important;
|
||||
list-style-image: url("chrome://browser/skin/tabbrowser/progress.png") !important;
|
||||
-moz-image-region: rect(0, 16px, 16px, 0);
|
||||
}
|
||||
.tabbrowser-tab[busy][stalled] > .tab-icon-image {
|
||||
list-style-image: url("chrome://browser/skin/tabbrowser/progress-pulsing.png") !important;
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="1"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 32px, 16px, 16px);
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="2"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 48px, 16px, 32px);
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="3"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 64px, 16px, 48px);
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="4"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 80px, 16px, 64px);
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="5"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 96px, 16px, 80px);
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="6"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 112px, 16px, 96px);
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="7"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 128px, 16px, 112px);
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="8"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 144px, 16px, 128px);
|
||||
}
|
||||
|
||||
.tabbrowser-tab:not(:hover):not([selected="true"]) > .tab-icon-image {
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
#close {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
background: url(KUI-close.png) center center no-repeat;
|
||||
}
|
|
@ -12,6 +12,7 @@ browser.jar:
|
|||
* skin/classic/browser/browser.css (browser.css)
|
||||
* skin/classic/browser/engineManager.css (engineManager.css)
|
||||
skin/classic/browser/feed-icons.png
|
||||
skin/classic/browser/fullscreen-video.css
|
||||
skin/classic/browser/Geo.png
|
||||
skin/classic/browser/Go-arrow.png
|
||||
skin/classic/browser/home.png
|
||||
|
@ -100,6 +101,8 @@ browser.jar:
|
|||
skin/classic/browser/tabbrowser/alltabs-box-bkgnd-icon.png (tabbrowser/alltabs-box-bkgnd-icon.png)
|
||||
skin/classic/browser/tabbrowser/alltabs-box-overflow-bkgnd-animate.png (tabbrowser/alltabs-box-overflow-bkgnd-animate.png)
|
||||
skin/classic/browser/tabbrowser/newtab.png (tabbrowser/newtab.png)
|
||||
skin/classic/browser/tabbrowser/progress.png (tabbrowser/progress.png)
|
||||
skin/classic/browser/tabbrowser/progress-pulsing.png (tabbrowser/progress-pulsing.png)
|
||||
skin/classic/browser/tabbrowser/tab-arrow-left.png (tabbrowser/tab-arrow-left.png)
|
||||
skin/classic/browser/tabbrowser/tab-arrow-right.png (tabbrowser/tab-arrow-right.png)
|
||||
skin/classic/browser/tabbrowser/tabbrowser-tabs-bkgnd.png (tabbrowser/tabbrowser-tabs-bkgnd.png)
|
||||
|
|
После Ширина: | Высота: | Размер: 10 KiB |
После Ширина: | Высота: | Размер: 2.0 KiB |
|
@ -1201,7 +1201,35 @@ statusbarpanel#statusbar-display {
|
|||
}
|
||||
|
||||
.tabbrowser-tab[busy] > .tab-icon-image {
|
||||
list-style-image: url("chrome://global/skin/icons/loading_16.png") !important;
|
||||
list-style-image: url("chrome://browser/skin/tabbrowser/progress.png") !important;
|
||||
-moz-image-region: rect(0, 16px, 16px, 0);
|
||||
}
|
||||
.tabbrowser-tab[busy][stalled] > .tab-icon-image {
|
||||
list-style-image: url("chrome://browser/skin/tabbrowser/progress-pulsing.png") !important;
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="1"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 32px, 16px, 16px);
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="2"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 48px, 16px, 32px);
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="3"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 64px, 16px, 48px);
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="4"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 80px, 16px, 64px);
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="5"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 96px, 16px, 80px);
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="6"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 112px, 16px, 96px);
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="7"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 128px, 16px, 112px);
|
||||
}
|
||||
.tabbrowser-tab[busy][progress="8"] > .tab-icon-image {
|
||||
-moz-image-region: rect(0, 144px, 16px, 128px);
|
||||
}
|
||||
|
||||
.tab-icon-image {
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
#close {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
background: url(KUI-close.png) center center no-repeat;
|
||||
}
|
|
@ -10,6 +10,7 @@ browser.jar:
|
|||
skin/classic/browser/aboutCertError.css (aboutCertError.css)
|
||||
* skin/classic/browser/browser.css (browser.css)
|
||||
* skin/classic/browser/engineManager.css (engineManager.css)
|
||||
skin/classic/browser/fullscreen-video.css
|
||||
skin/classic/browser/Geo.png (Geo.png)
|
||||
skin/classic/browser/Info.png (Info.png)
|
||||
skin/classic/browser/identity.png (identity.png)
|
||||
|
@ -82,6 +83,8 @@ browser.jar:
|
|||
skin/classic/browser/tabbrowser/alltabs-box-overflow-end-bkgnd-animate.png (tabbrowser/alltabs-box-overflow-end-bkgnd-animate.png)
|
||||
skin/classic/browser/tabbrowser/alltabs-box-overflow-start-bkgnd-animate.png (tabbrowser/alltabs-box-overflow-start-bkgnd-animate.png)
|
||||
skin/classic/browser/tabbrowser/newtab.png (tabbrowser/newtab.png)
|
||||
skin/classic/browser/tabbrowser/progress.png (tabbrowser/progress.png)
|
||||
skin/classic/browser/tabbrowser/progress-pulsing.png (tabbrowser/progress-pulsing.png)
|
||||
skin/classic/browser/tabbrowser/tab-arrow-left.png (tabbrowser/tab-arrow-left.png)
|
||||
skin/classic/browser/tabbrowser/tab-arrow-right.png (tabbrowser/tab-arrow-right.png)
|
||||
skin/classic/browser/tabbrowser/tabbrowser-tabs-bkgnd.png (tabbrowser/tabbrowser-tabs-bkgnd.png)
|
||||
|
@ -101,6 +104,7 @@ browser.jar:
|
|||
skin/classic/aero/browser/aboutCertError.css (aboutCertError.css)
|
||||
* skin/classic/aero/browser/browser.css (browser-aero.css)
|
||||
* skin/classic/aero/browser/engineManager.css (engineManager.css)
|
||||
skin/classic/aero/browser/fullscreen-video.css
|
||||
skin/classic/aero/browser/Geo.png (Geo-aero.png)
|
||||
skin/classic/aero/browser/Info.png (Info-aero.png)
|
||||
skin/classic/aero/browser/identity.png (identity-aero.png)
|
||||
|
@ -175,6 +179,8 @@ browser.jar:
|
|||
skin/classic/aero/browser/tabbrowser/alltabs-box-overflow-end-bkgnd-animate.png (tabbrowser/alltabs-box-overflow-end-bkgnd-animate.png)
|
||||
skin/classic/aero/browser/tabbrowser/alltabs-box-overflow-start-bkgnd-animate.png (tabbrowser/alltabs-box-overflow-start-bkgnd-animate.png)
|
||||
skin/classic/aero/browser/tabbrowser/newtab.png (tabbrowser/newtab-aero.png)
|
||||
skin/classic/aero/browser/tabbrowser/progress.png (tabbrowser/progress.png)
|
||||
skin/classic/aero/browser/tabbrowser/progress-pulsing.png (tabbrowser/progress-pulsing.png)
|
||||
skin/classic/aero/browser/tabbrowser/tab-arrow-left.png (tabbrowser/tab-arrow-left-aero.png)
|
||||
skin/classic/aero/browser/tabbrowser/tab-arrow-right.png (tabbrowser/tab-arrow-right-aero.png)
|
||||
skin/classic/aero/browser/tabbrowser/tabbrowser-tabs-bkgnd.png (tabbrowser/tabbrowser-tabs-bkgnd.png)
|
||||
|
|
После Ширина: | Высота: | Размер: 10 KiB |
После Ширина: | Высота: | Размер: 2.0 KiB |
|
@ -101,10 +101,47 @@ libs:: bloatcycle.html
|
|||
ifeq ($(OS_ARCH),Darwin)
|
||||
libs:: $(topsrcdir)/tools/rb/fix-macosx-stack.pl
|
||||
$(INSTALL) $< $(DIST)/bin
|
||||
|
||||
# Basic unit tests for some stuff in the unify script
|
||||
check::
|
||||
# build ppc/i386 binaries, and unify them
|
||||
rm -f unify-test-ppc unify-test-i386 unify-test-universal
|
||||
$(HOST_CC) -arch ppc $(srcdir)/unify-test.c -o unify-test-ppc
|
||||
$(HOST_CC) -arch i386 $(srcdir)/unify-test.c -o unify-test-i386
|
||||
@if ! $(srcdir)/macosx/universal/unify ./unify-test-ppc ./unify-test-i386 \
|
||||
./unify-test-universal; then \
|
||||
echo "TEST-UNEXPECTED-FAIL | build/ | unify failed to produce a universal binary!"; \
|
||||
false; \
|
||||
fi
|
||||
@if ! test -f ./unify-test-universal; then \
|
||||
echo "TEST-UNEXPECTED-FAIL | build/ | unify failed to produce a universal binary!"; \
|
||||
false; \
|
||||
fi
|
||||
@if ! file -b ./unify-test-universal | head -n1 | grep -q "^Mach-O universal binary"; then \
|
||||
echo "TEST-UNEXPECTED-FAIL | build/ | unify failed to produce a universal binary!"; \
|
||||
false; \
|
||||
fi
|
||||
# try unifying two identical Java class files
|
||||
rm -f unifytesta.class unifytestb.class unifytestc.class
|
||||
cp $(srcdir)/unifytest.class ./unifytesta.class
|
||||
cp $(srcdir)/unifytest.class ./unifytestb.class
|
||||
@if ! $(srcdir)/macosx/universal/unify ./unifytesta.class ./unifytestb.class \
|
||||
./unifytestc.class; then \
|
||||
echo "TEST-UNEXPECTED-FAIL | build/ | unify failed to unify a Java class file!"; \
|
||||
false; \
|
||||
fi
|
||||
@if ! test -f ./unifytestc.class; then \
|
||||
echo "TEST-UNEXPECTED-FAIL | build/ | unify failed to unify a Java class file!"; \
|
||||
false; \
|
||||
fi
|
||||
@if ! diff -q ./unifytesta.class ./unifytestc.class; then \
|
||||
echo "TEST-UNEXPECTED-FAIL | build/ | unify failed to unify a Java class file!"; \
|
||||
false; \
|
||||
fi
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),Linux)
|
||||
libs:: $(topsrcdir)/tools/rb/fix-linux-stack.pl
|
||||
$(INSTALL) $< $(DIST)/bin
|
||||
endif
|
||||
endif
|
||||
endif # ENABLE_TESTS
|
||||
|
|
|
@ -110,3 +110,19 @@ postflight_all:
|
|||
$(DIST_UNI)/$(MOZ_PKG_APPNAME)/$(APPNAME)
|
||||
# A universal .dmg can now be produced by making in either architecture's
|
||||
# INSTALLER_DIR.
|
||||
# Now, repeat the process for the test package.
|
||||
$(MAKE) -C $(OBJDIR_PPC) UNIVERSAL_BINARY= package-tests
|
||||
$(MAKE) -C $(OBJDIR_X86) UNIVERSAL_BINARY= package-tests
|
||||
# automation.py differs because it hardcodes a path to dist/bin.
|
||||
# It doesn't matter which one we use.
|
||||
cp $(DIST_PPC)/test-package-stage/mochitest/automation.py \
|
||||
$(DIST_X86)/test-package-stage/mochitest/
|
||||
cp $(DIST_PPC)/test-package-stage/reftest/automation.py \
|
||||
$(DIST_X86)/test-package-stage/reftest/
|
||||
rm -rf $(DIST_UNI)/test-package-stage
|
||||
if test -d $(DIST_PPC)/test-package-stage -a \
|
||||
-d $(DIST_X86)/test-package-stage; then \
|
||||
$(TOPSRCDIR)/build/macosx/universal/unify \
|
||||
$(DIST_PPC)/test-package-stage \
|
||||
$(DIST_X86)/test-package-stage \
|
||||
$(DIST_UNI)/test-package-stage; fi
|
||||
|
|
|
@ -214,6 +214,7 @@ sub readZipCRCs($);
|
|||
sub lstatMode($);
|
||||
sub lstatType($);
|
||||
sub magic($);
|
||||
sub magic2($);
|
||||
sub path($);
|
||||
sub stat($);
|
||||
sub statSize($);
|
||||
|
@ -1053,6 +1054,7 @@ sub readZipCRCs($) {
|
|||
'lstatErrno' => 0,
|
||||
'lstatInit' => 0,
|
||||
'magic' => undef,
|
||||
'magic2' => undef,
|
||||
'magicErrno' => 0,
|
||||
'magicErrMsg' => undef,
|
||||
'magicInit' => 0,
|
||||
|
@ -1069,7 +1071,7 @@ sub readZipCRCs($) {
|
|||
# Returns true if the file is a fat Mach-O file, false if it's not, and
|
||||
# undef if an error occurs. See /usr/include/mach-o/fat.h.
|
||||
sub isFat($) {
|
||||
my ($magic, $this);
|
||||
my ($magic, $magic2, $this);
|
||||
($this) = @_;
|
||||
|
||||
# magic() caches, there's no separate cache because isFat() doesn't hit
|
||||
|
@ -1078,8 +1080,16 @@ sub readZipCRCs($) {
|
|||
if (!defined($magic = $this->magic())) {
|
||||
return undef;
|
||||
}
|
||||
$magic2 = $this->magic2();
|
||||
|
||||
if ($magic == 0xcafebabe) {
|
||||
# We have to sanity check the second four bytes, because Java class
|
||||
# files use the same magic number as Mach-O fat binaries.
|
||||
# This logic is adapted from file(1), which says that Mach-O uses
|
||||
# these bytes to count the number of architectures within, while
|
||||
# Java uses it for a version number. Conveniently, there are only
|
||||
# 18 labelled Mach-O architectures, and Java's first released
|
||||
# class format used the version 43.0.
|
||||
if ($magic == 0xcafebabe && $magic2 < 20) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -1105,7 +1115,7 @@ sub readZipCRCs($) {
|
|||
# Accept Mach-O fat files or Mach-O thin files of either endianness.
|
||||
if ($magic == 0xfeedface ||
|
||||
$magic == 0xcefaedfe ||
|
||||
$magic == 0xcafebabe) {
|
||||
$this->isFat()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -1292,7 +1302,7 @@ sub readZipCRCs($) {
|
|||
}
|
||||
|
||||
$! = 0;
|
||||
my ($bytes, $magic);
|
||||
my ($bytes, $magic, $bytes2, $magic2);
|
||||
if (!defined($bytes = sysread($fh, $magic, 4))) {
|
||||
$$this{'magicErrno'} = $!;
|
||||
$$this{'magicErrMsg'} = 'read "'.$$this{'path'}.'": '.$!;
|
||||
|
@ -1301,6 +1311,9 @@ sub readZipCRCs($) {
|
|||
close($fh);
|
||||
return undef;
|
||||
}
|
||||
else {
|
||||
$bytes2 = sysread($fh, $magic2, 4);
|
||||
}
|
||||
|
||||
close($fh);
|
||||
|
||||
|
@ -1308,13 +1321,35 @@ sub readZipCRCs($) {
|
|||
# The file is too short, didn't read a magic number. This isn't really
|
||||
# an error. Return an unlikely value.
|
||||
$$this{'magic'} = -1;
|
||||
$$this{'magic2'} = -1;
|
||||
return -1;
|
||||
}
|
||||
if ($bytes2 != 4) {
|
||||
# File is too short to read a second 4 bytes.
|
||||
$magic2 = -1;
|
||||
}
|
||||
|
||||
$$this{'magic'} = unpack('N', $magic);
|
||||
$$this{'magic2'} = unpack('N', $magic2);
|
||||
return $$this{'magic'};
|
||||
}
|
||||
|
||||
# $FileAttrCache->magic2()
|
||||
#
|
||||
# Returns the second four bytes of the file as a 32-bit little endian number.
|
||||
# See magic(), above for more info.
|
||||
sub magic2($) {
|
||||
my ($this);
|
||||
($this) = @_;
|
||||
|
||||
# we do the actual work (and cache it) in magic().
|
||||
if (!$$this{'magicInit'}) {
|
||||
my $magic = $$this->magic();
|
||||
}
|
||||
|
||||
return $$this{'magic2'};
|
||||
}
|
||||
|
||||
# $FileAttrCache->path()
|
||||
#
|
||||
# Returns the file's pathname.
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
int main(int argc, char** argv)
|
||||
{
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
class unifytest {
|
||||
public static void main(String[] args) {
|
||||
return;
|
||||
}
|
||||
}
|
|
@ -41,7 +41,7 @@
|
|||
interface nsIURI;
|
||||
interface nsIChannel;
|
||||
|
||||
[scriptable, uuid(f8e350b9-9f31-451a-8c8f-d10fea26b780)]
|
||||
[scriptable, uuid(c0dbfd5e-b7ae-4c18-8674-82492f35d715)]
|
||||
interface nsIScriptSecurityManager : nsIXPCSecurityManager
|
||||
{
|
||||
///////////////// Security Checks //////////////////
|
||||
|
@ -319,6 +319,29 @@ interface nsIScriptSecurityManager : nsIXPCSecurityManager
|
|||
[noscript,notxpcom] nsIPrincipal getCxSubjectPrincipal(in JSContextPtr cx);
|
||||
[noscript,notxpcom] nsIPrincipal getCxSubjectPrincipalAndFrame(in JSContextPtr cx,
|
||||
out JSStackFramePtr fp);
|
||||
|
||||
/**
|
||||
* If no scripted code is running "above" (or called from) fp, then
|
||||
* instead of looking at cx->globalObject, we will return |principal|.
|
||||
* This function only affects |cx|. If someone pushes another context onto
|
||||
* the context stack, then it supercedes this call.
|
||||
* NOTE: If |fp| is non-null popContextPrincipal must be called before fp
|
||||
* has finished executing.
|
||||
*
|
||||
* @param cx The context to clamp.
|
||||
* @param fp The frame pointer to clamp at. May be 'null'.
|
||||
* @param principal The principal to clamp to.
|
||||
*/
|
||||
[noscript] void pushContextPrincipal(in JSContextPtr cx,
|
||||
in JSStackFramePtr fp,
|
||||
in nsIPrincipal principal);
|
||||
|
||||
/**
|
||||
* Removes a clamp set by pushContextPrincipal from cx. This must be
|
||||
* called in a stack-like fashion (e.g., given two contexts |a| and |b|,
|
||||
* it is not legal to do: push(a) push(b) pop(a)).
|
||||
*/
|
||||
[noscript] void popContextPrincipal(in JSContextPtr cx);
|
||||
};
|
||||
|
||||
%{C++
|
||||
|
|
|
@ -486,15 +486,15 @@ private:
|
|||
// Returns null if a principal cannot be found. Note that rv can be NS_OK
|
||||
// when this happens -- this means that there was no script for the
|
||||
// context. Callers MUST pass in a non-null rv here.
|
||||
static nsIPrincipal*
|
||||
nsIPrincipal*
|
||||
GetSubjectPrincipal(JSContext* cx, nsresult* rv);
|
||||
|
||||
// Returns null if a principal cannot be found. Note that rv can be NS_OK
|
||||
// when this happens -- this means that there was no script for the frame.
|
||||
// Callers MUST pass in a non-null rv here.
|
||||
static nsIPrincipal*
|
||||
nsIPrincipal*
|
||||
GetFramePrincipal(JSContext* cx, JSStackFrame* fp, nsresult* rv);
|
||||
|
||||
|
||||
// Returns null if a principal cannot be found. Note that rv can be NS_OK
|
||||
// when this happens -- this means that there was no script. Callers MUST
|
||||
// pass in a non-null rv here.
|
||||
|
@ -514,7 +514,7 @@ private:
|
|||
// Returns null if a principal cannot be found. Note that rv can be NS_OK
|
||||
// when this happens -- this means that there was no script
|
||||
// running. Callers MUST pass in a non-null rv here.
|
||||
static nsIPrincipal*
|
||||
nsIPrincipal*
|
||||
GetPrincipalAndFrame(JSContext *cx,
|
||||
JSStackFrame** frameResult,
|
||||
nsresult* rv);
|
||||
|
@ -601,6 +601,17 @@ private:
|
|||
PrintPolicyDB();
|
||||
#endif
|
||||
|
||||
struct ContextPrincipal {
|
||||
ContextPrincipal(ContextPrincipal *next, JSContext *cx,
|
||||
JSStackFrame *fp, nsIPrincipal *principal)
|
||||
: mNext(next), mCx(cx), mFp(fp), mPrincipal(principal) {}
|
||||
|
||||
ContextPrincipal *mNext;
|
||||
JSContext *mCx;
|
||||
JSStackFrame *mFp;
|
||||
nsCOMPtr<nsIPrincipal> mPrincipal;
|
||||
};
|
||||
|
||||
// JS strings we need to clean up on shutdown
|
||||
static jsval sEnabledID;
|
||||
|
||||
|
@ -618,6 +629,7 @@ private:
|
|||
nsCOMPtr<nsISecurityPref> mSecurityPref;
|
||||
nsCOMPtr<nsIPrincipal> mSystemPrincipal;
|
||||
nsCOMPtr<nsIPrincipal> mSystemCertificate;
|
||||
ContextPrincipal *mContextPrincipals;
|
||||
nsInterfaceHashtable<PrincipalKey, nsIPrincipal> mPrincipals;
|
||||
PRPackedBool mIsJavaScriptEnabled;
|
||||
PRPackedBool mIsWritingPrefs;
|
||||
|
|
|
@ -402,6 +402,32 @@ nsScriptSecurityManager::GetCxSubjectPrincipalAndFrame(JSContext *cx, JSStackFra
|
|||
return principal;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsScriptSecurityManager::PushContextPrincipal(JSContext *cx,
|
||||
JSStackFrame *fp,
|
||||
nsIPrincipal *principal)
|
||||
{
|
||||
ContextPrincipal *cp = new ContextPrincipal(mContextPrincipals, cx, fp,
|
||||
principal);
|
||||
if (!cp)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
mContextPrincipals = cp;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsScriptSecurityManager::PopContextPrincipal(JSContext *cx)
|
||||
{
|
||||
NS_ASSERTION(mContextPrincipals->mCx == cx, "Mismatched push/pop");
|
||||
|
||||
ContextPrincipal *next = mContextPrincipals->mNext;
|
||||
delete mContextPrincipals;
|
||||
mContextPrincipals = next;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// Policy Storage //
|
||||
////////////////////
|
||||
|
@ -2196,7 +2222,6 @@ nsScriptSecurityManager::GetFunctionObjectPrincipal(JSContext *cx,
|
|||
return GetScriptPrincipal(cx, script, rv);
|
||||
}
|
||||
|
||||
// static
|
||||
nsIPrincipal*
|
||||
nsScriptSecurityManager::GetFramePrincipal(JSContext *cx,
|
||||
JSStackFrame *fp,
|
||||
|
@ -2226,22 +2251,36 @@ nsScriptSecurityManager::GetFramePrincipal(JSContext *cx,
|
|||
return result;
|
||||
}
|
||||
|
||||
// static
|
||||
nsIPrincipal*
|
||||
nsScriptSecurityManager::GetPrincipalAndFrame(JSContext *cx,
|
||||
JSStackFrame **frameResult,
|
||||
nsresult* rv)
|
||||
{
|
||||
NS_PRECONDITION(rv, "Null out param");
|
||||
NS_PRECONDITION(rv, "Null out param");
|
||||
//-- If there's no principal on the stack, look at the global object
|
||||
// and return the innermost frame for annotations.
|
||||
*rv = NS_OK;
|
||||
|
||||
if (cx)
|
||||
{
|
||||
// Get principals from innermost frame of JavaScript or Java.
|
||||
JSStackFrame *target = nsnull;
|
||||
nsIPrincipal *targetPrincipal = nsnull;
|
||||
for (ContextPrincipal *cp = mContextPrincipals; cp; cp = cp->mNext)
|
||||
{
|
||||
if (cp->mCx == cx)
|
||||
{
|
||||
target = cp->mFp;
|
||||
targetPrincipal = cp->mPrincipal;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Get principals from innermost JavaScript frame.
|
||||
JSStackFrame *fp = nsnull; // tell JS_FrameIterator to start at innermost
|
||||
for (fp = JS_FrameIterator(cx, &fp); fp; fp = JS_FrameIterator(cx, &fp))
|
||||
{
|
||||
if (fp == target)
|
||||
break;
|
||||
nsIPrincipal* result = GetFramePrincipal(cx, fp, rv);
|
||||
if (result)
|
||||
{
|
||||
|
@ -2251,6 +2290,25 @@ nsScriptSecurityManager::GetPrincipalAndFrame(JSContext *cx,
|
|||
}
|
||||
}
|
||||
|
||||
// If targetPrincipal is non-null, then it means that someone wants to
|
||||
// clamp the principals on this context to this principal. Note that
|
||||
// fp might not equal target here (fp might be null) because someone
|
||||
// could have set aside the frame chain in the meantime.
|
||||
if (targetPrincipal)
|
||||
{
|
||||
if (fp && fp == target)
|
||||
{
|
||||
*frameResult = fp;
|
||||
}
|
||||
else
|
||||
{
|
||||
JSStackFrame *inner = nsnull;
|
||||
*frameResult = JS_FrameIterator(cx, &inner);
|
||||
}
|
||||
|
||||
return targetPrincipal;
|
||||
}
|
||||
|
||||
nsIScriptContext *scriptContext = GetScriptContext(cx);
|
||||
if (scriptContext)
|
||||
{
|
||||
|
@ -2277,7 +2335,6 @@ nsScriptSecurityManager::GetPrincipalAndFrame(JSContext *cx,
|
|||
return nsnull;
|
||||
}
|
||||
|
||||
// static
|
||||
nsIPrincipal*
|
||||
nsScriptSecurityManager::GetSubjectPrincipal(JSContext *cx,
|
||||
nsresult* rv)
|
||||
|
@ -3278,6 +3335,7 @@ nsScriptSecurityManager::nsScriptSecurityManager(void)
|
|||
: mOriginToPolicyMap(nsnull),
|
||||
mDefaultPolicy(nsnull),
|
||||
mCapabilities(nsnull),
|
||||
mContextPrincipals(nsnull),
|
||||
mIsJavaScriptEnabled(PR_FALSE),
|
||||
mIsWritingPrefs(PR_FALSE),
|
||||
mPolicyPrefsChanged(PR_TRUE)
|
||||
|
@ -3360,6 +3418,7 @@ jsval nsScriptSecurityManager::sEnabledID = JSVAL_VOID;
|
|||
|
||||
nsScriptSecurityManager::~nsScriptSecurityManager(void)
|
||||
{
|
||||
NS_ASSERTION(!mContextPrincipals, "Leaking mContextPrincipals");
|
||||
delete mOriginToPolicyMap;
|
||||
if(mDefaultPolicy)
|
||||
mDefaultPolicy->Drop();
|
||||
|
|
|
@ -89,6 +89,7 @@ MOZ_X11 = @MOZ_X11@
|
|||
MOZ_PANGO = @MOZ_PANGO@
|
||||
|
||||
MOZ_CORETEXT = @MOZ_CORETEXT@
|
||||
MOZ_COCOA_PRINTING = @MOZ_COCOA_PRINTING@
|
||||
|
||||
MOZ_JS_LIBS = @MOZ_JS_LIBS@
|
||||
|
||||
|
|
|
@ -734,6 +734,7 @@ sys/procfs.h
|
|||
sys/pstat.h
|
||||
sys/ptrace.h
|
||||
sys/queue.h
|
||||
sys/quota.h
|
||||
sys/reg.h
|
||||
sys/regset.h
|
||||
sys/resource.h
|
||||
|
|
41
configure.in
|
@ -131,7 +131,7 @@ LIBGNOME_VERSION=2.0
|
|||
GIO_VERSION=2.0
|
||||
STARTUP_NOTIFICATION_VERSION=0.8
|
||||
DBUS_VERSION=0.60
|
||||
SQLITE_VERSION=3.6.16
|
||||
SQLITE_VERSION=3.6.18
|
||||
LIBNOTIFY_VERSION=0.4
|
||||
|
||||
MSMANIFEST_TOOL=
|
||||
|
@ -182,7 +182,7 @@ then
|
|||
fi
|
||||
MOZ_BUILD_ROOT=`pwd`
|
||||
|
||||
dnl Default to MSVC for win32
|
||||
dnl Default to MSVC for win32 and gcc-4.2 for darwin
|
||||
dnl ==============================================================
|
||||
if test -z "$CROSS_COMPILE"; then
|
||||
case "$target" in
|
||||
|
@ -195,6 +195,10 @@ case "$target" in
|
|||
if test -z "$AS"; then AS=ml; fi
|
||||
if test -z "$MIDL"; then MIDL=midl; fi
|
||||
;;
|
||||
*-darwin*)
|
||||
if test -z "$CC"; then CC=gcc-4.2; fi
|
||||
if test -z "$CXX"; then CXX=g++-4.2; fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
|
@ -1623,7 +1627,7 @@ case "$host" in
|
|||
case "$host" in
|
||||
*mingw*)
|
||||
dnl MinGW/MSYS does not need CYGWIN_WRAPPER
|
||||
PERL="/bin/sh ${srcdir}/build/msys-perl-wrapper"
|
||||
PERL="/bin/sh ${_topsrcdir}/build/msys-perl-wrapper"
|
||||
;;
|
||||
*)
|
||||
CYGWIN_WRAPPER="${srcdir}/build/cygwin-wrapper"
|
||||
|
@ -3043,6 +3047,9 @@ AC_CHECK_HEADERS(io.h)
|
|||
dnl These are all the places some variant of statfs can be hiding.
|
||||
AC_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h)
|
||||
|
||||
dnl Quota support
|
||||
AC_CHECK_HEADERS(sys/quota.h)
|
||||
|
||||
dnl Try for MMX support
|
||||
dnl NB - later gcc versions require -mmmx for this header to be successfully
|
||||
dnl included (or another option which implies it, such as -march=pentium-mmx)
|
||||
|
@ -3135,7 +3142,8 @@ case $target in
|
|||
esac
|
||||
|
||||
dnl ========================================================
|
||||
dnl Check whether we can compile code for Core Text
|
||||
dnl Check whether we can compile code for Core Text and
|
||||
dnl Cocoa printing
|
||||
dnl (Mac OS X 10.5 or later)
|
||||
dnl ========================================================
|
||||
case "$target" in
|
||||
|
@ -3143,9 +3151,9 @@ case "$target" in
|
|||
AC_MSG_CHECKING([for Core Text])
|
||||
AC_TRY_COMPILE([#include <ApplicationServices/ApplicationServices.h>],
|
||||
[CTLineRef lineRef;],
|
||||
ac_cv_have_core_text="yes",
|
||||
ac_cv_have_core_text="no")
|
||||
AC_MSG_RESULT([$ac_cv_have_core_text])
|
||||
ac_cv_have_leopard="yes",
|
||||
ac_cv_have_leopard="no")
|
||||
AC_MSG_RESULT([$ac_cv_have_leopard])
|
||||
|
||||
MOZ_CORETEXT=1
|
||||
|
||||
|
@ -3155,15 +3163,30 @@ case "$target" in
|
|||
MOZ_CORETEXT=1)
|
||||
|
||||
if test -n "$MOZ_CORETEXT"; then
|
||||
if test "$ac_cv_have_core_text" = "no"; then
|
||||
if test "$ac_cv_have_leopard" = "no"; then
|
||||
AC_MSG_ERROR([--enable-coretext requires MacOS SDK 10.5 or newer])
|
||||
fi
|
||||
AC_DEFINE(MOZ_CORETEXT)
|
||||
fi
|
||||
|
||||
MOZ_COCOA_PRINTING=1
|
||||
|
||||
MOZ_ARG_DISABLE_BOOL(cocoa-printing,
|
||||
[ --disable-cocoa-printing
|
||||
Use a Carbon print dialog instead of a Cocoa one],
|
||||
MOZ_COCOA_PRINTING=,
|
||||
MOZ_COCOA_PRINTING=1)
|
||||
|
||||
if test -n "$MOZ_COCOA_PRINTING"; then
|
||||
if test "$ac_cv_have_leopard" = "no"; then
|
||||
AC_MSG_ERROR([--enable-cocoa-printing requires MacOS SDK 10.5 or newer])
|
||||
fi
|
||||
AC_DEFINE(MOZ_COCOA_PRINTING)
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(MOZ_CORETEXT)
|
||||
AC_SUBST(MOZ_COCOA_PRINTING)
|
||||
|
||||
XLDFLAGS="$X_LIBS"
|
||||
XLIBS="$X_EXTRA_LIBS"
|
||||
|
|
|
@ -249,6 +249,27 @@ public:
|
|||
return mNodeInfo;
|
||||
}
|
||||
|
||||
inline PRBool IsInNamespace(PRInt32 aNamespace) const {
|
||||
return mNodeInfo->NamespaceID() == aNamespace;
|
||||
}
|
||||
|
||||
inline PRBool IsHTML() const {
|
||||
return IsInNamespace(kNameSpaceID_XHTML);
|
||||
}
|
||||
|
||||
inline PRBool IsSVG() const {
|
||||
/* Some things in the SVG namespace are not in fact SVG elements */
|
||||
return IsNodeOfType(eSVG);
|
||||
}
|
||||
|
||||
inline PRBool IsXUL() const {
|
||||
return IsInNamespace(kNameSpaceID_XUL);
|
||||
}
|
||||
|
||||
inline PRBool IsMathML() const {
|
||||
return IsInNamespace(kNameSpaceID_MathML);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an atom holding the name of the attribute of type ID on
|
||||
* this content node (if applicable). Returns null for non-element
|
||||
|
|
|
@ -246,8 +246,8 @@ private:
|
|||
|
||||
// IID for the nsINode interface
|
||||
#define NS_INODE_IID \
|
||||
{ 0xfc22c6df, 0x3e8e, 0x47c3, \
|
||||
{ 0x96, 0xa6, 0xaf, 0x14, 0x3c, 0x05, 0x88, 0x68 } }
|
||||
{ 0xc6485d02, 0x7c8a, 0x42fd, \
|
||||
{ 0x97, 0x15, 0x0f, 0x67, 0xfd, 0x69, 0xd5, 0x3e } }
|
||||
|
||||
/**
|
||||
* An internal interface that abstracts some DOMNode-related parts that both
|
||||
|
@ -293,28 +293,22 @@ public:
|
|||
ePROCESSING_INSTRUCTION = 1 << 5,
|
||||
/** comment nodes */
|
||||
eCOMMENT = 1 << 6,
|
||||
/** html elements */
|
||||
eHTML = 1 << 7,
|
||||
/** form control elements */
|
||||
eHTML_FORM_CONTROL = 1 << 8,
|
||||
/** XUL elements */
|
||||
eXUL = 1 << 9,
|
||||
eHTML_FORM_CONTROL = 1 << 7,
|
||||
/** svg elements */
|
||||
eSVG = 1 << 10,
|
||||
eSVG = 1 << 8,
|
||||
/** document fragments */
|
||||
eDOCUMENT_FRAGMENT = 1 << 11,
|
||||
eDOCUMENT_FRAGMENT = 1 << 9,
|
||||
/** data nodes (comments, PIs, text). Nodes of this type always
|
||||
returns a non-null value for nsIContent::GetText() */
|
||||
eDATA_NODE = 1 << 12,
|
||||
/** nsMathMLElement */
|
||||
eMATHML = 1 << 13,
|
||||
eDATA_NODE = 1 << 10,
|
||||
/** nsHTMLMediaElement */
|
||||
eMEDIA = 1 << 14
|
||||
eMEDIA = 1 << 11
|
||||
};
|
||||
|
||||
/**
|
||||
* API for doing a quick check if a content is of a given
|
||||
* type, such as HTML, XUL, Text, ... Use this when you can instead of
|
||||
* type, such as Text, Document, Comment ... Use this when you can instead of
|
||||
* checking the tag.
|
||||
*
|
||||
* @param aFlags what types you want to test for (see above)
|
||||
|
|
|
@ -214,7 +214,7 @@ mozSanitizingHTMLSerializer::IsContainer(PRInt32 aId)
|
|||
PRInt32
|
||||
mozSanitizingHTMLSerializer::GetIdForContent(nsIContent* aContent)
|
||||
{
|
||||
if (!aContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
if (!aContent->IsHTML()) {
|
||||
return eHTMLTag_unknown;
|
||||
}
|
||||
|
||||
|
|
|
@ -2120,7 +2120,7 @@ nsContentUtils::BelongsInForm(nsIDOMHTMLFormElement *aForm,
|
|||
}
|
||||
|
||||
if (content->Tag() == nsGkAtoms::form &&
|
||||
content->IsNodeOfType(nsINode::eHTML)) {
|
||||
content->IsHTML()) {
|
||||
// The child is contained within a form, but not the right form
|
||||
// so we ignore it.
|
||||
|
||||
|
|
|
@ -349,7 +349,7 @@ nsresult nsCopySupport::IsPlainTextContext(nsISelection *aSel, nsIDocument *aDoc
|
|||
{
|
||||
// checking for selection inside a plaintext form widget
|
||||
|
||||
if (!selContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
if (!selContent->IsHTML()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -354,7 +354,7 @@ nsDOMAttributeMap::SetNamedItemInternal(nsIDOMNode *aNode,
|
|||
iAttribute->SetMap(this);
|
||||
|
||||
if (!aWithNS && ni->NamespaceID() == kNameSpaceID_None &&
|
||||
mContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
mContent->IsHTML()) {
|
||||
// Set via setAttribute(), which may do normalization on the
|
||||
// attribute name for HTML
|
||||
nsCOMPtr<nsIDOMElement> ourElement(do_QueryInterface(mContent));
|
||||
|
|
|
@ -4893,7 +4893,7 @@ nsDocument::GetHtmlContent()
|
|||
{
|
||||
nsIContent* rootContent = GetRootContent();
|
||||
if (rootContent && rootContent->Tag() == nsGkAtoms::html &&
|
||||
rootContent->IsNodeOfType(nsINode::eHTML))
|
||||
rootContent->IsHTML())
|
||||
return rootContent;
|
||||
return nsnull;
|
||||
}
|
||||
|
@ -4909,14 +4909,14 @@ nsDocument::GetHtmlChildContent(nsIAtom* aTag)
|
|||
// forwards to find the first such element.
|
||||
for (PRUint32 i = 0; i < html->GetChildCount(); ++i) {
|
||||
nsIContent* result = html->GetChildAt(i);
|
||||
if (result->Tag() == aTag && result->IsNodeOfType(nsINode::eHTML))
|
||||
if (result->Tag() == aTag && result->IsHTML())
|
||||
return result;
|
||||
}
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
nsIContent*
|
||||
nsDocument::GetTitleContent(PRUint32 aNodeType)
|
||||
nsDocument::GetTitleContent(PRUint32 aNamespace)
|
||||
{
|
||||
// mMayHaveTitleElement will have been set to true if any HTML or SVG
|
||||
// <title> element has been bound to this document. So if it's false,
|
||||
|
@ -4938,15 +4938,15 @@ nsDocument::GetTitleContent(PRUint32 aNodeType)
|
|||
nsIContent* elem = list->Item(i, PR_FALSE);
|
||||
if (!elem)
|
||||
return nsnull;
|
||||
if (elem->IsNodeOfType(aNodeType))
|
||||
if (elem->IsInNamespace(aNamespace))
|
||||
return elem;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsDocument::GetTitleFromElement(PRUint32 aNodeType, nsAString& aTitle)
|
||||
nsDocument::GetTitleFromElement(PRUint32 aNamespace, nsAString& aTitle)
|
||||
{
|
||||
nsIContent* title = GetTitleContent(aNodeType);
|
||||
nsIContent* title = GetTitleContent(aNamespace);
|
||||
if (!title)
|
||||
return;
|
||||
nsContentUtils::GetNodeTextContent(title, PR_FALSE, aTitle);
|
||||
|
@ -4972,12 +4972,12 @@ nsDocument::GetTitle(nsAString& aTitle)
|
|||
#ifdef MOZ_SVG
|
||||
case kNameSpaceID_SVG:
|
||||
if (rootContent->Tag() == nsGkAtoms::svg) {
|
||||
GetTitleFromElement(nsINode::eSVG, tmp);
|
||||
GetTitleFromElement(kNameSpaceID_SVG, tmp);
|
||||
break;
|
||||
} // else fall through
|
||||
#endif
|
||||
default:
|
||||
GetTitleFromElement(nsINode::eHTML, tmp);
|
||||
GetTitleFromElement(kNameSpaceID_XHTML, tmp);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -5009,7 +5009,7 @@ nsDocument::SetTitle(const nsAString& aTitle)
|
|||
// element" under us
|
||||
mozAutoDocUpdate updateBatch(this, UPDATE_CONTENT_MODEL, PR_TRUE);
|
||||
|
||||
nsIContent* title = GetTitleContent(nsINode::eHTML);
|
||||
nsIContent* title = GetTitleContent(kNameSpaceID_XHTML);
|
||||
if (!title) {
|
||||
nsIContent *head = GetHeadContent();
|
||||
if (!head)
|
||||
|
@ -5018,7 +5018,7 @@ nsDocument::SetTitle(const nsAString& aTitle)
|
|||
{
|
||||
nsCOMPtr<nsINodeInfo> titleInfo;
|
||||
titleInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::title, nsnull,
|
||||
kNameSpaceID_None);
|
||||
kNameSpaceID_XHTML);
|
||||
if (!titleInfo)
|
||||
return NS_OK;
|
||||
title = NS_NewHTMLTitleElement(titleInfo);
|
||||
|
@ -5088,7 +5088,7 @@ nsDocument::GetBoxObjectFor(nsIDOMElement* aElement, nsIBoxObject** aResult)
|
|||
nsIDocument* doc = content->GetOwnerDoc();
|
||||
NS_ENSURE_TRUE(doc == this, NS_ERROR_DOM_WRONG_DOCUMENT_ERR);
|
||||
|
||||
if (!mHasWarnedAboutBoxObjects && !content->IsNodeOfType(eXUL)) {
|
||||
if (!mHasWarnedAboutBoxObjects && !content->IsXUL()) {
|
||||
mHasWarnedAboutBoxObjects = PR_TRUE;
|
||||
nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
|
||||
"UseOfGetBoxObjectForWarning",
|
||||
|
|
|
@ -400,7 +400,7 @@ AddTreeItemToTreeOwner(nsIDocShellTreeItem* aItem, nsIContent* aOwningContent,
|
|||
nsAutoString value;
|
||||
PRBool isContent = PR_FALSE;
|
||||
|
||||
if (aOwningContent->IsNodeOfType(nsINode::eXUL)) {
|
||||
if (aOwningContent->IsXUL()) {
|
||||
aOwningContent->GetAttr(kNameSpaceID_None, nsGkAtoms::type, value);
|
||||
}
|
||||
|
||||
|
|
|
@ -340,7 +340,8 @@ nsINode::GetTextEditorRootContent(nsIEditor** aEditor)
|
|||
if (aEditor)
|
||||
*aEditor = nsnull;
|
||||
for (nsINode* node = this; node; node = node->GetNodeParent()) {
|
||||
if (!node->IsNodeOfType(eHTML))
|
||||
if (!node->IsNodeOfType(eELEMENT) ||
|
||||
!static_cast<nsIContent*>(node)->IsHTML())
|
||||
continue;
|
||||
|
||||
nsCOMPtr<nsIEditor> editor;
|
||||
|
@ -1168,7 +1169,7 @@ nsNSElementTearoff::GetScrollInfo(nsIScrollableView **aScrollableView,
|
|||
*aScrollableView = nsnull;
|
||||
|
||||
// it isn't clear what to return for SVG nodes, so just return nothing
|
||||
if (mContent->IsNodeOfType(nsINode::eSVG)) {
|
||||
if (mContent->IsSVG()) {
|
||||
if (aFrame)
|
||||
*aFrame = nsnull;
|
||||
return;
|
||||
|
@ -1320,7 +1321,7 @@ nsNSElementTearoff::GetScrollHeight(PRInt32* aScrollHeight)
|
|||
NS_ENSURE_ARG_POINTER(aScrollHeight);
|
||||
*aScrollHeight = 0;
|
||||
|
||||
if (mContent->IsNodeOfType(nsINode::eSVG))
|
||||
if (mContent->IsSVG())
|
||||
return NS_OK;
|
||||
|
||||
nsIScrollableView *scrollView;
|
||||
|
@ -1351,7 +1352,7 @@ nsNSElementTearoff::GetScrollWidth(PRInt32* aScrollWidth)
|
|||
NS_ENSURE_ARG_POINTER(aScrollWidth);
|
||||
*aScrollWidth = 0;
|
||||
|
||||
if (mContent->IsNodeOfType(nsINode::eSVG))
|
||||
if (mContent->IsSVG())
|
||||
return NS_OK;
|
||||
|
||||
nsIScrollableView *scrollView;
|
||||
|
@ -1382,7 +1383,7 @@ nsNSElementTearoff::GetClientAreaRect()
|
|||
nsIFrame *frame;
|
||||
|
||||
// it isn't clear what to return for SVG nodes, so just return 0
|
||||
if (mContent->IsNodeOfType(nsINode::eSVG))
|
||||
if (mContent->IsSVG())
|
||||
return nsRect(0, 0, 0, 0);
|
||||
|
||||
GetScrollInfo(&scrollView, &frame);
|
||||
|
@ -3988,7 +3989,7 @@ nsGenericElement::doReplaceOrInsertBefore(PRBool aReplace,
|
|||
}
|
||||
}
|
||||
|
||||
if (!newContent->IsNodeOfType(eXUL)) {
|
||||
if (!newContent->IsXUL()) {
|
||||
nsContentUtils::ReparentContentWrapper(newContent, aParent,
|
||||
container->GetOwnerDoc(),
|
||||
container->GetOwnerDoc());
|
||||
|
@ -4047,7 +4048,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGenericElement)
|
|||
NS_IMPL_CYCLE_COLLECTION_UNLINK_LISTENERMANAGER
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_USERDATA
|
||||
|
||||
if (tmp->HasProperties() && tmp->IsNodeOfType(nsINode::eXUL)) {
|
||||
if (tmp->HasProperties() && tmp->IsXUL()) {
|
||||
tmp->DeleteProperty(nsGkAtoms::contextmenulistener);
|
||||
tmp->DeleteProperty(nsGkAtoms::popuplistener);
|
||||
}
|
||||
|
@ -4080,7 +4081,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGenericElement)
|
|||
slots->mAttributeMap->DropReference();
|
||||
slots->mAttributeMap = nsnull;
|
||||
}
|
||||
if (tmp->IsNodeOfType(nsINode::eXUL))
|
||||
if (tmp->IsXUL())
|
||||
NS_IF_RELEASE(slots->mControllers);
|
||||
slots->mChildrenList = nsnull;
|
||||
}
|
||||
|
@ -4118,7 +4119,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsGenericElement)
|
|||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_LISTENERMANAGER
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_USERDATA
|
||||
|
||||
if (tmp->HasProperties() && tmp->IsNodeOfType(nsINode::eXUL)) {
|
||||
if (tmp->HasProperties() && tmp->IsXUL()) {
|
||||
nsISupports* property =
|
||||
static_cast<nsISupports*>
|
||||
(tmp->GetProperty(nsGkAtoms::contextmenulistener));
|
||||
|
@ -4165,7 +4166,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsGenericElement)
|
|||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "slots mAttributeMap");
|
||||
cb.NoteXPCOMChild(slots->mAttributeMap.get());
|
||||
|
||||
if (tmp->IsNodeOfType(nsINode::eXUL))
|
||||
if (tmp->IsXUL())
|
||||
cb.NoteXPCOMChild(slots->mControllers);
|
||||
cb.NoteXPCOMChild(
|
||||
static_cast<nsIDOMNodeList*>(slots->mChildrenList.get()));
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
#include "nsXULElement.h"
|
||||
#endif
|
||||
#include "nsBindingManager.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
|
||||
// This macro expects the ownerDocument of content_ to be in scope as
|
||||
// |nsIDocument* doc|
|
||||
|
@ -222,12 +223,23 @@ nsNodeUtils::LastRelease(nsINode* aNode)
|
|||
// the properties may want to use the owner document of the nsINode.
|
||||
static_cast<nsIDocument*>(aNode)->PropertyTable()->DeleteAllProperties();
|
||||
}
|
||||
else if (aNode->HasProperties()) {
|
||||
// Strong reference to the document so that deleting properties can't
|
||||
// delete the document.
|
||||
nsCOMPtr<nsIDocument> document = aNode->GetOwnerDoc();
|
||||
if (document) {
|
||||
document->PropertyTable()->DeleteAllPropertiesFor(aNode);
|
||||
else {
|
||||
if (aNode->HasProperties()) {
|
||||
// Strong reference to the document so that deleting properties can't
|
||||
// delete the document.
|
||||
nsCOMPtr<nsIDocument> document = aNode->GetOwnerDoc();
|
||||
if (document) {
|
||||
document->PropertyTable()->DeleteAllPropertiesFor(aNode);
|
||||
}
|
||||
}
|
||||
|
||||
// I wonder whether it's faster to do the HasFlag check first....
|
||||
if (aNode->IsNodeOfType(nsINode::eHTML_FORM_CONTROL) &&
|
||||
aNode->HasFlag(ADDED_TO_FORM)) {
|
||||
// Tell the form (if any) this node is going away. Don't
|
||||
// notify, since we're being destroyed in any case.
|
||||
static_cast<nsGenericHTMLFormElement*>(aNode)->ClearForm(PR_TRUE,
|
||||
PR_FALSE);
|
||||
}
|
||||
}
|
||||
aNode->UnsetFlags(NODE_HAS_PROPERTIES);
|
||||
|
@ -700,7 +712,7 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, PRBool aClone, PRBool aDeep,
|
|||
// cloning, so kids of the new node aren't confused about whether they're
|
||||
// in a document.
|
||||
#ifdef MOZ_XUL
|
||||
if (aClone && !aParent && aNode->IsNodeOfType(nsINode::eXUL)) {
|
||||
if (aClone && !aParent && aNode->IsNodeOfType(nsINode::eELEMENT) && static_cast<nsIContent*>(aNode)->IsXUL()) {
|
||||
nsXULElement *xulElem = static_cast<nsXULElement*>(elem);
|
||||
if (!xulElem->mPrototype || xulElem->IsInDoc()) {
|
||||
clone->SetFlags(NODE_FORCE_XBL_BINDINGS);
|
||||
|
|
|
@ -1788,7 +1788,7 @@ nsObjectLoadingContent::ShouldShowDefaultPlugin(nsIContent* aContent,
|
|||
nsObjectLoadingContent::GetPluginSupportState(nsIContent* aContent,
|
||||
const nsCString& aContentType)
|
||||
{
|
||||
if (!aContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
if (!aContent->IsHTML()) {
|
||||
return ePluginOtherState;
|
||||
}
|
||||
|
||||
|
@ -1805,7 +1805,7 @@ nsObjectLoadingContent::GetPluginSupportState(nsIContent* aContent,
|
|||
nsIContent* child = aContent->GetChildAt(i);
|
||||
NS_ASSERTION(child, "GetChildCount lied!");
|
||||
|
||||
if (child->IsNodeOfType(nsINode::eHTML) &&
|
||||
if (child->IsHTML() &&
|
||||
child->Tag() == nsGkAtoms::param) {
|
||||
if (child->AttrValueIs(kNameSpaceID_None, nsGkAtoms::name,
|
||||
NS_LITERAL_STRING("pluginurl"), eIgnoreCase)) {
|
||||
|
|
|
@ -414,10 +414,10 @@ class nsObjectLoadingContent : public nsImageLoadingContent
|
|||
* Whether we are about to call instantiate on our frame. If we aren't,
|
||||
* SetFrame needs to asynchronously call Instantiate.
|
||||
*/
|
||||
PRBool mInstantiating : 1;
|
||||
PRPackedBool mInstantiating : 1;
|
||||
// Blocking status from content policy
|
||||
PRBool mUserDisabled : 1;
|
||||
PRBool mSuppressed : 1;
|
||||
PRPackedBool mUserDisabled : 1;
|
||||
PRPackedBool mSuppressed : 1;
|
||||
// A specific state that caused us to fallback
|
||||
PluginSupportState mPluginState;
|
||||
|
||||
|
|
|
@ -1853,7 +1853,7 @@ nsPlainTextSerializer::IsCurrentNodeConverted(const nsIParserNode* aNode)
|
|||
PRInt32
|
||||
nsPlainTextSerializer::GetIdForContent(nsIContent* aContent)
|
||||
{
|
||||
if (!aContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
if (!aContent->IsHTML()) {
|
||||
return eHTMLTag_unknown;
|
||||
}
|
||||
|
||||
|
|
|
@ -145,23 +145,23 @@ nsScriptElement::ContentInserted(nsIDocument *aDocument,
|
|||
}
|
||||
|
||||
static PRBool
|
||||
InNonScriptingContainer(nsINode* aNode)
|
||||
InNonScriptingContainer(nsIContent* aNode)
|
||||
{
|
||||
aNode = aNode->GetNodeParent();
|
||||
aNode = aNode->GetParent();
|
||||
while (aNode) {
|
||||
// XXX noframes and noembed are currently unconditionally not
|
||||
// displayed and processed. This might change if we support either
|
||||
// prefs or per-document container settings for not allowing
|
||||
// frames or plugins.
|
||||
if (aNode->IsNodeOfType(nsINode::eHTML)) {
|
||||
nsIAtom *localName = static_cast<nsIContent*>(aNode)->Tag();
|
||||
if (aNode->IsHTML()) {
|
||||
nsIAtom *localName = aNode->Tag();
|
||||
if (localName == nsGkAtoms::iframe ||
|
||||
localName == nsGkAtoms::noframes ||
|
||||
localName == nsGkAtoms::noembed) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
aNode = aNode->GetNodeParent();
|
||||
aNode = aNode->GetParent();
|
||||
}
|
||||
|
||||
return PR_FALSE;
|
||||
|
|
|
@ -503,7 +503,7 @@ nsXHTMLContentSerializer::AfterElementStart(nsIContent * aContent,
|
|||
PRUint32 i, childCount = aContent->GetChildCount();
|
||||
for (i = 0; i < childCount; ++i) {
|
||||
nsIContent* child = aContent->GetChildAt(i);
|
||||
if (child->IsNodeOfType(nsINode::eHTML) &&
|
||||
if (child->IsHTML() &&
|
||||
child->Tag() == nsGkAtoms::meta &&
|
||||
child->HasAttr(kNameSpaceID_None, nsGkAtoms::content)) {
|
||||
nsAutoString header;
|
||||
|
|
|
@ -772,7 +772,7 @@ nsXMLContentSerializer::IsJavaScript(nsIContent * aContent, nsIAtom* aAttrNameAt
|
|||
PRInt32 aAttrNamespaceID, const nsAString& aValueString)
|
||||
{
|
||||
PRInt32 namespaceID = aContent->GetNameSpaceID();
|
||||
PRBool isHtml = aContent->IsNodeOfType(nsINode::eHTML);
|
||||
PRBool isHtml = aContent->IsHTML();
|
||||
|
||||
if (aAttrNamespaceID == kNameSpaceID_None &&
|
||||
(isHtml ||
|
||||
|
|
|
@ -141,7 +141,7 @@ nsContentEventHandler::Init(nsQueryContentEvent* aEvent)
|
|||
// we don't want to include the bogus BRs at the end.
|
||||
static PRBool IsContentBR(nsIContent* aContent)
|
||||
{
|
||||
return aContent->IsNodeOfType(nsINode::eHTML) &&
|
||||
return aContent->IsHTML() &&
|
||||
aContent->Tag() == nsGkAtoms::br &&
|
||||
!aContent->AttrValueIs(kNameSpaceID_None,
|
||||
nsGkAtoms::type,
|
||||
|
@ -857,12 +857,12 @@ static void AdjustRangeForSelection(nsIContent* aRoot,
|
|||
node = node->GetParent();
|
||||
offset = node->IndexOf(*aNode) + (offset ? 1 : 0);
|
||||
}
|
||||
nsINode* brNode = node->GetChildAt(offset - 1);
|
||||
while (brNode && brNode->IsNodeOfType(nsINode::eHTML)) {
|
||||
nsIContent* brContent = static_cast<nsIContent*>(brNode);
|
||||
|
||||
nsIContent* brContent = node->GetChildAt(offset - 1);
|
||||
while (brContent && brContent->IsHTML()) {
|
||||
if (brContent->Tag() != nsGkAtoms::br || IsContentBR(brContent))
|
||||
break;
|
||||
brNode = node->GetChildAt(--offset - 1);
|
||||
brContent = node->GetChildAt(--offset - 1);
|
||||
}
|
||||
*aNode = node;
|
||||
*aOffset = PR_MAX(offset, 0);
|
||||
|
|
|
@ -1383,7 +1383,7 @@ IsAccessKeyTarget(nsIContent* aContent, nsIFrame* aFrame, nsAString& aKey)
|
|||
|
||||
nsCOMPtr<nsIDOMXULDocument> xulDoc =
|
||||
do_QueryInterface(aContent->GetOwnerDoc());
|
||||
if (!xulDoc && !aContent->IsNodeOfType(nsINode::eXUL))
|
||||
if (!xulDoc && !aContent->IsXUL())
|
||||
return PR_TRUE;
|
||||
|
||||
// For XUL we do visibility checks.
|
||||
|
@ -1404,7 +1404,7 @@ IsAccessKeyTarget(nsIContent* aContent, nsIFrame* aFrame, nsAString& aKey)
|
|||
if (control)
|
||||
return PR_TRUE;
|
||||
|
||||
if (aContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
if (aContent->IsHTML()) {
|
||||
nsIAtom* tag = aContent->Tag();
|
||||
|
||||
// HTML area, label and legend elements are never focusable, so
|
||||
|
@ -1414,7 +1414,7 @@ IsAccessKeyTarget(nsIContent* aContent, nsIFrame* aFrame, nsAString& aKey)
|
|||
tag == nsGkAtoms::legend)
|
||||
return PR_TRUE;
|
||||
|
||||
} else if (aContent->IsNodeOfType(nsINode::eXUL)) {
|
||||
} else if (aContent->IsXUL()) {
|
||||
// XUL label elements are never focusable, so we need to check for them
|
||||
// explicitly before giving up.
|
||||
if (aContent->Tag() == nsGkAtoms::label)
|
||||
|
@ -1697,7 +1697,7 @@ nsEventStateManager::FireContextClick()
|
|||
nsIAtom *tag = mGestureDownContent->Tag();
|
||||
PRBool allowedToDispatch = PR_TRUE;
|
||||
|
||||
if (mGestureDownContent->IsNodeOfType(nsINode::eXUL)) {
|
||||
if (mGestureDownContent->IsXUL()) {
|
||||
if (tag == nsGkAtoms::scrollbar ||
|
||||
tag == nsGkAtoms::scrollbarbutton ||
|
||||
tag == nsGkAtoms::button)
|
||||
|
@ -1718,7 +1718,7 @@ nsEventStateManager::FireContextClick()
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (mGestureDownContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
else if (mGestureDownContent->IsHTML()) {
|
||||
nsCOMPtr<nsIFormControl> formCtrl(do_QueryInterface(mGestureDownContent));
|
||||
|
||||
if (formCtrl) {
|
||||
|
@ -2347,7 +2347,7 @@ nsEventStateManager::DoScrollZoom(nsIFrame *aTargetFrame,
|
|||
nsIContent *content = aTargetFrame->GetContent();
|
||||
if (content &&
|
||||
!content->IsNodeOfType(nsINode::eHTML_FORM_CONTROL) &&
|
||||
!content->IsNodeOfType(nsINode::eXUL))
|
||||
!content->IsXUL())
|
||||
{
|
||||
// positive adjustment to decrease zoom, negative to increase
|
||||
PRInt32 change = (adjustment > 0) ? -1 : 1;
|
||||
|
|
|
@ -435,8 +435,8 @@ nsGenericHTMLElement::SetClassName(const nsAString& aClassName)
|
|||
static PRBool
|
||||
IsBody(nsIContent *aContent)
|
||||
{
|
||||
return (aContent->NodeInfo()->Equals(nsGkAtoms::body) &&
|
||||
aContent->IsNodeOfType(nsINode::eHTML));
|
||||
return aContent->NodeInfo()->Equals(nsGkAtoms::body) &&
|
||||
aContent->IsHTML();
|
||||
}
|
||||
|
||||
static PRBool IS_TABLE_CELL(nsIAtom* frameType) {
|
||||
|
@ -751,14 +751,13 @@ nsGenericHTMLElement::GetSpellcheck(PRBool* aSpellcheck)
|
|||
*aSpellcheck = PR_FALSE; // Default answer is to not spellcheck
|
||||
|
||||
// Has the state has been explicitly set?
|
||||
nsINode* node;
|
||||
for (node = this; node; node = node->GetNodeParent()) {
|
||||
if (node->IsNodeOfType(nsINode::eHTML)) {
|
||||
nsIContent* node;
|
||||
for (node = this; node; node = node->GetParent()) {
|
||||
if (node->IsHTML()) {
|
||||
static nsIContent::AttrValuesArray strings[] =
|
||||
{&nsGkAtoms::_true, &nsGkAtoms::_false, nsnull};
|
||||
switch (static_cast<nsIContent*>(node)->
|
||||
FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::spellcheck,
|
||||
strings, eCaseMatters)) {
|
||||
switch (node->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::spellcheck,
|
||||
strings, eCaseMatters)) {
|
||||
case 0: // spellcheck = "true"
|
||||
*aSpellcheck = PR_TRUE;
|
||||
// Fall through
|
||||
|
@ -905,7 +904,7 @@ nsGenericHTMLElement::FindForm(nsIForm* aCurrentForm)
|
|||
while (content != bindingParent && content) {
|
||||
// If the current ancestor is a form, return it as our form
|
||||
if (content->Tag() == nsGkAtoms::form &&
|
||||
content->IsNodeOfType(nsINode::eHTML)) {
|
||||
content->IsHTML()) {
|
||||
#ifdef DEBUG
|
||||
if (!nsContentUtils::IsInSameAnonymousTree(this, content)) {
|
||||
// It's possible that we started unbinding at |content| or
|
||||
|
@ -958,7 +957,7 @@ static PRBool
|
|||
IsArea(nsIContent *aContent)
|
||||
{
|
||||
return (aContent->Tag() == nsGkAtoms::area &&
|
||||
aContent->IsNodeOfType(nsINode::eHTML));
|
||||
aContent->IsHTML());
|
||||
}
|
||||
|
||||
PRBool
|
||||
|
@ -1200,7 +1199,7 @@ nsGenericHTMLElement::GetBaseTarget(nsAString& aBaseTarget) const
|
|||
PRBool
|
||||
nsGenericHTMLElement::IsNodeOfType(PRUint32 aFlags) const
|
||||
{
|
||||
return !(aFlags & ~(eCONTENT | eELEMENT | eHTML));
|
||||
return !(aFlags & ~(eCONTENT | eELEMENT));
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -2269,14 +2268,8 @@ nsGenericHTMLFormElement::nsGenericHTMLFormElement(nsINodeInfo *aNodeInfo)
|
|||
|
||||
nsGenericHTMLFormElement::~nsGenericHTMLFormElement()
|
||||
{
|
||||
// Check that this element is not still the default content
|
||||
// of its parent form.
|
||||
NS_ASSERTION(!mForm || mForm->GetDefaultSubmitElement() != this,
|
||||
"Content being destroyed is the default content");
|
||||
|
||||
// Clean up. Set the form to nsnull so it knows we went away.
|
||||
// Do not notify as the content is being destroyed.
|
||||
ClearForm(PR_TRUE, PR_FALSE);
|
||||
// Check that this element doesn't know anything about its form at this point.
|
||||
NS_ASSERTION(!mForm, "How did we get here?");
|
||||
}
|
||||
|
||||
NS_IMPL_QUERY_INTERFACE_INHERITED1(nsGenericHTMLFormElement,
|
||||
|
@ -2286,7 +2279,7 @@ NS_IMPL_QUERY_INTERFACE_INHERITED1(nsGenericHTMLFormElement,
|
|||
PRBool
|
||||
nsGenericHTMLFormElement::IsNodeOfType(PRUint32 aFlags) const
|
||||
{
|
||||
return !(aFlags & ~(eCONTENT | eELEMENT | eHTML | eHTML_FORM_CONTROL));
|
||||
return !(aFlags & ~(eCONTENT | eELEMENT | eHTML_FORM_CONTROL));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -79,7 +79,7 @@ public:
|
|||
/** Typesafe, non-refcounting cast from nsIContent. Cheaper than QI. **/
|
||||
static nsGenericHTMLElement* FromContent(nsIContent *aContent)
|
||||
{
|
||||
if (aContent->IsNodeOfType(eHTML))
|
||||
if (aContent->IsHTML())
|
||||
return static_cast<nsGenericHTMLElement*>(aContent);
|
||||
return nsnull;
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ NS_NewHTMLAudioElement(nsINodeInfo *aNodeInfo, PRBool aFromParser)
|
|||
NS_ENSURE_TRUE(doc, nsnull);
|
||||
|
||||
nodeInfo = doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::audio, nsnull,
|
||||
kNameSpaceID_None);
|
||||
kNameSpaceID_XHTML);
|
||||
NS_ENSURE_TRUE(nodeInfo, nsnull);
|
||||
}
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ NS_NewHTMLImageElement(nsINodeInfo *aNodeInfo, PRBool aFromParser)
|
|||
NS_ENSURE_TRUE(doc, nsnull);
|
||||
|
||||
nodeInfo = doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::img, nsnull,
|
||||
kNameSpaceID_None);
|
||||
kNameSpaceID_XHTML);
|
||||
NS_ENSURE_TRUE(nodeInfo, nsnull);
|
||||
}
|
||||
|
||||
|
|
|
@ -436,7 +436,7 @@ static PRBool HasSourceChildren(nsIContent *aElement)
|
|||
NS_ASSERTION(child, "GetChildCount lied!");
|
||||
if (child &&
|
||||
child->Tag() == nsGkAtoms::source &&
|
||||
child->IsNodeOfType(nsINode::eHTML))
|
||||
child->IsHTML())
|
||||
{
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
@ -1704,7 +1704,7 @@ void nsHTMLMediaElement::Thaw()
|
|||
PRBool
|
||||
nsHTMLMediaElement::IsNodeOfType(PRUint32 aFlags) const
|
||||
{
|
||||
return !(aFlags & ~(eCONTENT | eELEMENT | eHTML | eMEDIA));
|
||||
return !(aFlags & ~(eCONTENT | eELEMENT | eMEDIA));
|
||||
}
|
||||
|
||||
void nsHTMLMediaElement::NotifyAddedSource()
|
||||
|
@ -1757,7 +1757,7 @@ already_AddRefed<nsIURI> nsHTMLMediaElement::GetNextSource()
|
|||
// If child is a <source> element, it may be the next candidate.
|
||||
if (child &&
|
||||
child->Tag() == nsGkAtoms::source &&
|
||||
child->IsNodeOfType(nsINode::eHTML))
|
||||
child->IsHTML())
|
||||
{
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsAutoString src,type;
|
||||
|
|
|
@ -158,8 +158,7 @@ nsIContent*
|
|||
nsHTMLOptGroupElement::GetSelect()
|
||||
{
|
||||
nsIContent* parent = this;
|
||||
while ((parent = parent->GetParent()) &&
|
||||
parent->IsNodeOfType(eHTML)) {
|
||||
while ((parent = parent->GetParent()) && parent->IsHTML()) {
|
||||
if (parent->Tag() == nsGkAtoms::select) {
|
||||
return parent;
|
||||
}
|
||||
|
|
|
@ -442,7 +442,7 @@ nsHTMLOptionElement::GetSelect()
|
|||
{
|
||||
nsIContent* parent = this;
|
||||
while ((parent = parent->GetParent()) &&
|
||||
parent->IsNodeOfType(eHTML)) {
|
||||
parent->IsHTML()) {
|
||||
if (parent->Tag() == nsGkAtoms::select) {
|
||||
return parent;
|
||||
}
|
||||
|
|
|
@ -331,7 +331,7 @@ nsHTMLSelectElement::RemoveOptionsFromList(nsIContent* aOptions,
|
|||
static PRBool IsOptGroup(nsIContent *aContent)
|
||||
{
|
||||
return (aContent->NodeInfo()->Equals(nsGkAtoms::optgroup) &&
|
||||
aContent->IsNodeOfType(nsINode::eHTML));
|
||||
aContent->IsHTML());
|
||||
}
|
||||
|
||||
// If the document is such that recursing over these options gets us
|
||||
|
|
|
@ -140,7 +140,7 @@ nsHTMLTableCellElement::GetTable()
|
|||
if (parent) { // GetParent() should be a row
|
||||
nsIContent* section = parent->GetParent();
|
||||
if (section) {
|
||||
if (section->IsNodeOfType(eHTML) &&
|
||||
if (section->IsHTML() &&
|
||||
section->NodeInfo()->Equals(nsGkAtoms::table)) {
|
||||
// XHTML, without a row group
|
||||
result = section;
|
||||
|
|
|
@ -237,7 +237,7 @@ IsCell(nsIContent *aContent, PRInt32 aNamespaceID,
|
|||
nsIAtom* tag = aContent->Tag();
|
||||
|
||||
return ((tag == nsGkAtoms::td || tag == nsGkAtoms::th) &&
|
||||
aContent->IsNodeOfType(nsINode::eHTML));
|
||||
aContent->IsHTML());
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -1583,7 +1583,7 @@ nsHTMLDocument::SetBody(nsIDOMHTMLElement* aBody)
|
|||
// body.
|
||||
if (!newBody || !(newBody->Tag() == nsGkAtoms::body ||
|
||||
newBody->Tag() == nsGkAtoms::frameset) ||
|
||||
!root || !root->IsNodeOfType(nsINode::eHTML) ||
|
||||
!root || !root->IsHTML() ||
|
||||
root->Tag() != nsGkAtoms::html) {
|
||||
return NS_ERROR_DOM_HIERARCHY_REQUEST_ERR;
|
||||
}
|
||||
|
@ -2744,7 +2744,7 @@ nsHTMLDocument::ResolveName(const nsAString& aName,
|
|||
|
||||
nsIContent *e = entry->GetIdContent();
|
||||
|
||||
if (e && e->IsNodeOfType(nsINode::eHTML)) {
|
||||
if (e && e->IsHTML()) {
|
||||
nsIAtom *tag = e->Tag();
|
||||
|
||||
if ((tag == nsGkAtoms::embed ||
|
||||
|
|
|
@ -410,7 +410,7 @@ nsMathMLElement::IntrinsicState() const
|
|||
PRBool
|
||||
nsMathMLElement::IsNodeOfType(PRUint32 aFlags) const
|
||||
{
|
||||
return !(aFlags & ~(eCONTENT | eELEMENT | eMATHML));
|
||||
return !(aFlags & ~(eCONTENT | eELEMENT));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -297,7 +297,7 @@ float
|
|||
nsSVGLength2::GetUnitScaleFactor(nsIFrame *aFrame, PRUint8 aUnitType) const
|
||||
{
|
||||
nsIContent* content = aFrame->GetContent();
|
||||
if (content->IsNodeOfType(nsINode::eSVG))
|
||||
if (content->IsSVG())
|
||||
return GetUnitScaleFactor(static_cast<nsSVGElement*>(content), aUnitType);
|
||||
|
||||
switch (aUnitType) {
|
||||
|
|
|
@ -899,7 +899,7 @@ nsresult
|
|||
nsXBLContentSink::AddAttributes(const PRUnichar** aAtts,
|
||||
nsIContent* aContent)
|
||||
{
|
||||
if (aContent->IsNodeOfType(nsINode::eXUL))
|
||||
if (aContent->IsXUL())
|
||||
return NS_OK; // Nothing to do, since the proto already has the attrs.
|
||||
|
||||
return nsXMLContentSink::AddAttributes(aAtts, aContent);
|
||||
|
|
|
@ -483,8 +483,7 @@ nsXBLPrototypeHandler::DispatchXBLCommand(nsPIDOMEventTarget* aTarget, nsIDOMEve
|
|||
// element is focused and has a parent.
|
||||
if (focusedContent && focusedContent->GetParent()) {
|
||||
while (content) {
|
||||
if (content->Tag() == nsGkAtoms::a &&
|
||||
content->IsNodeOfType(nsINode::eHTML)) {
|
||||
if (content->Tag() == nsGkAtoms::a && content->IsHTML()) {
|
||||
isLink = PR_TRUE;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1172,8 +1172,7 @@ nsXBLService::LoadBindingDocumentInfo(nsIContent* aBoundElement,
|
|||
ni->Equals(nsGkAtoms::thumb, kNameSpaceID_XUL) ||
|
||||
((ni->Equals(nsGkAtoms::input) ||
|
||||
ni->Equals(nsGkAtoms::select)) &&
|
||||
aBoundElement->IsNodeOfType(nsINode::eHTML)))) &&
|
||||
!aForceSyncLoad) {
|
||||
aBoundElement->IsHTML()))) && !aForceSyncLoad) {
|
||||
// The third line of defense is to investigate whether or not the
|
||||
// document is currently being loaded asynchronously. If so, there's no
|
||||
// document yet, but we need to glom on our request so that it will be
|
||||
|
|
|
@ -437,13 +437,6 @@ txXPathNodeUtils::getLocalName(const txXPathNode& aNode, nsAString& aLocalName)
|
|||
if (aNode.mNode->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
nsINodeInfo* nodeInfo = aNode.Content()->NodeInfo();
|
||||
nodeInfo->GetLocalName(aLocalName);
|
||||
|
||||
// Check for html
|
||||
if (nodeInfo->NamespaceEquals(kNameSpaceID_None) &&
|
||||
aNode.mNode->IsNodeOfType(nsINode::eHTML)) {
|
||||
ToUpperCase(aLocalName);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -465,7 +458,7 @@ txXPathNodeUtils::getLocalName(const txXPathNode& aNode, nsAString& aLocalName)
|
|||
|
||||
// Check for html
|
||||
if (aNode.Content()->NodeInfo()->NamespaceEquals(kNameSpaceID_None) &&
|
||||
aNode.Content()->IsNodeOfType(nsINode::eHTML)) {
|
||||
aNode.Content()->IsHTML()) {
|
||||
ToUpperCase(aLocalName);
|
||||
}
|
||||
}
|
||||
|
@ -486,11 +479,9 @@ txXPathNodeUtils::getNodeName(const txXPathNode& aNode, nsAString& aName)
|
|||
nodeInfo->GetQualifiedName(aName);
|
||||
|
||||
// Check for html
|
||||
if (nodeInfo->NamespaceEquals(kNameSpaceID_None) &&
|
||||
aNode.Content()->IsNodeOfType(nsINode::eHTML)) {
|
||||
if (aNode.Content()->IsHTML()) {
|
||||
ToUpperCase(aName);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -510,8 +501,7 @@ txXPathNodeUtils::getNodeName(const txXPathNode& aNode, nsAString& aName)
|
|||
aNode.Content()->GetAttrNameAt(aNode.mIndex)->GetQualifiedName(aName);
|
||||
|
||||
// Check for html
|
||||
if (aNode.Content()->NodeInfo()->NamespaceEquals(kNameSpaceID_None) &&
|
||||
aNode.Content()->IsNodeOfType(nsINode::eHTML)) {
|
||||
if (aNode.Content()->IsHTML()) {
|
||||
ToUpperCase(aName);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ public:
|
|||
return PR_FALSE;
|
||||
}
|
||||
nsIContent* content = aNode.Content();
|
||||
return content->IsNodeOfType(nsINode::eHTML) && content->IsInHTMLDocument();
|
||||
return content->IsHTML() && content->IsInHTMLDocument();
|
||||
}
|
||||
#else
|
||||
private:
|
||||
|
|
|
@ -308,14 +308,14 @@ txMozillaXMLOutput::endElement()
|
|||
|
||||
// Handle html-elements
|
||||
if (!mNoFixup) {
|
||||
if (element->IsNodeOfType(nsINode::eHTML)) {
|
||||
if (element->IsHTML()) {
|
||||
rv = endHTMLElement(element);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
// Handle script elements
|
||||
if (element->Tag() == nsGkAtoms::script &&
|
||||
(element->IsNodeOfType(nsINode::eHTML) ||
|
||||
(element->IsHTML() ||
|
||||
element->GetNameSpaceID() == kNameSpaceID_SVG)) {
|
||||
|
||||
rv = element->DoneAddingChildren(PR_TRUE);
|
||||
|
|
|
@ -2157,7 +2157,7 @@ nsXULElement::GetBindingParent() const
|
|||
PRBool
|
||||
nsXULElement::IsNodeOfType(PRUint32 aFlags) const
|
||||
{
|
||||
return !(aFlags & ~(eCONTENT | eELEMENT | eXUL));
|
||||
return !(aFlags & ~(eCONTENT | eELEMENT));
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -475,7 +475,7 @@ public:
|
|||
/** Typesafe, non-refcounting cast from nsIContent. Cheaper than QI. **/
|
||||
static nsXULElement* FromContent(nsIContent *aContent)
|
||||
{
|
||||
if (aContent->IsNodeOfType(eXUL))
|
||||
if (aContent->IsXUL())
|
||||
return static_cast<nsXULElement*>(aContent);
|
||||
return nsnull;
|
||||
}
|
||||
|
|
|
@ -1302,7 +1302,7 @@ PRBool
|
|||
nsXULContentBuilder::IsOpen(nsIContent* aElement)
|
||||
{
|
||||
// Determine if this is a <treeitem> or <menu> element
|
||||
if (!aElement->IsNodeOfType(nsINode::eXUL))
|
||||
if (!aElement->IsXUL())
|
||||
return PR_TRUE;
|
||||
|
||||
// XXXhyatt Use the XBL service to obtain a base tag.
|
||||
|
|
|
@ -112,7 +112,7 @@ XULSortServiceImpl::SetSortColumnHints(nsIContent *content,
|
|||
for (PRUint32 childIndex = 0; childIndex < numChildren; ++childIndex) {
|
||||
nsIContent *child = content->GetChildAt(childIndex);
|
||||
|
||||
if (child->IsNodeOfType(nsINode::eXUL)) {
|
||||
if (child->IsXUL()) {
|
||||
nsIAtom *tag = child->Tag();
|
||||
|
||||
if (tag == nsGkAtoms::treecols) {
|
||||
|
|
|
@ -1249,7 +1249,7 @@ nsXULTemplateBuilder::LoadDataSources(nsIDocument* aDocument,
|
|||
if (xuldoc)
|
||||
xuldoc->SetTemplateBuilderFor(mRoot, this);
|
||||
|
||||
if (!mRoot->IsNodeOfType(nsINode::eXUL)) {
|
||||
if (!mRoot->IsXUL()) {
|
||||
// Hmm. This must be an HTML element. Try to set it as a
|
||||
// JS property "by hand".
|
||||
InitHTMLTemplateRoot();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
This is sqlite 3.6.16
|
||||
This is SQLite 3.6.18.
|
||||
|
||||
-- Shawn Wilsher <me@shawnwilsher.com>, 8/2009
|
||||
-- Shawn Wilsher <me@shawnwilsher.com>, 10/2009
|
||||
|
||||
See http://www.sqlite.org/ for more info.
|
||||
|
||||
|
|
13097
db/sqlite3/src/sqlite3.c
|
@ -356,7 +356,7 @@ ForEachPing(nsIContent *content, ForEachPingCallback callback, void *closure)
|
|||
|
||||
// Make sure we are dealing with either an <A> or <AREA> element in the HTML
|
||||
// or XHTML namespace.
|
||||
if (!content->IsNodeOfType(nsINode::eHTML))
|
||||
if (!content->IsHTML())
|
||||
return;
|
||||
nsIAtom *nameAtom = content->Tag();
|
||||
if (!nameAtom->EqualsUTF8(NS_LITERAL_CSTRING("a")) &&
|
||||
|
|
|
@ -1906,6 +1906,35 @@ nsDOMClassInfo::RegisterExternalClasses()
|
|||
return nameSpaceManager->RegisterExternalInterfaces(PR_TRUE);
|
||||
}
|
||||
|
||||
// static
|
||||
inline nsresult
|
||||
nsDOMClassInfo::WrapNativeParent(JSContext *cx, JSObject *scope,
|
||||
nsISupports *native, JSObject **parentObj)
|
||||
{
|
||||
// In the common case, |native| is a wrapper cache with an existing wrapper
|
||||
nsWrapperCache* cache = nsnull;
|
||||
CallQueryInterface(native, &cache);
|
||||
if (cache) {
|
||||
JSObject* obj = cache->GetWrapper();
|
||||
if (obj) {
|
||||
#ifdef DEBUG
|
||||
jsval debugVal;
|
||||
nsresult rv = WrapNative(cx, scope, native, PR_FALSE, &debugVal);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv) && JSVAL_TO_OBJECT(debugVal) == obj,
|
||||
"Unexpected object in nsWrapperCache");
|
||||
#endif
|
||||
*parentObj = obj;
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
jsval v;
|
||||
nsresult rv = WrapNative(cx, scope, native, PR_FALSE, &v);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
*parentObj = JSVAL_TO_OBJECT(v);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#define _DOM_CLASSINFO_MAP_BEGIN(_class, _ifptr, _has_class_if) \
|
||||
{ \
|
||||
nsDOMClassInfoData &d = sClassInfoData[eDOMClassInfo_##_class##_id]; \
|
||||
|
@ -7077,7 +7106,8 @@ nsNodeSH::PreCreate(nsISupports *nativeObj, JSContext *cx, JSObject *globalObj,
|
|||
nsISupports *native_parent;
|
||||
|
||||
PRBool slimWrappers = PR_TRUE;
|
||||
if (node->IsNodeOfType(nsINode::eELEMENT | nsINode::eXUL)) {
|
||||
PRBool nodeIsElement = node->IsNodeOfType(nsINode::eELEMENT);
|
||||
if (nodeIsElement && static_cast<nsIContent*>(node)->IsXUL()) {
|
||||
// For XUL elements, use the parent, if any.
|
||||
native_parent = node->GetParent();
|
||||
|
||||
|
@ -7093,9 +7123,8 @@ nsNodeSH::PreCreate(nsISupports *nativeObj, JSContext *cx, JSObject *globalObj,
|
|||
native_parent = doc;
|
||||
|
||||
// But for HTML form controls, use the form as scope parent.
|
||||
if (node->IsNodeOfType(nsINode::eELEMENT |
|
||||
nsIContent::eHTML |
|
||||
nsIContent::eHTML_FORM_CONTROL)) {
|
||||
if (nodeIsElement &&
|
||||
node->IsNodeOfType(nsINode::eHTML_FORM_CONTROL)) {
|
||||
nsCOMPtr<nsIFormControl> form_control(do_QueryInterface(node));
|
||||
|
||||
if (form_control) {
|
||||
|
@ -7962,12 +7991,9 @@ nsNodeListSH::PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
jsval v;
|
||||
nsresult rv = WrapNative(cx, globalObj, native_parent, PR_FALSE, &v);
|
||||
nsresult rv = WrapNativeParent(cx, globalObj, native_parent, parentObj);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
*parentObj = JSVAL_TO_OBJECT(v);
|
||||
|
||||
return NS_SUCCESS_ALLOW_SLIM_WRAPPERS;
|
||||
}
|
||||
|
||||
|
@ -10061,12 +10087,9 @@ nsCSSStyleDeclSH::PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
jsval v;
|
||||
nsresult rv = WrapNative(cx, globalObj, native_parent, PR_FALSE, &v);
|
||||
nsresult rv = WrapNativeParent(cx, globalObj, native_parent, parentObj);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
*parentObj = JSVAL_TO_OBJECT(v);
|
||||
|
||||
return NS_SUCCESS_ALLOW_SLIM_WRAPPERS;
|
||||
}
|
||||
|
||||
|
|
|
@ -144,6 +144,12 @@ public:
|
|||
aAllowWrapping);
|
||||
}
|
||||
|
||||
// Used for cases where PreCreate needs to wrap the native parent,
|
||||
// and the native parent is likely to have been wrapped already.
|
||||
static inline nsresult WrapNativeParent(JSContext *cx, JSObject *scope,
|
||||
nsISupports *native,
|
||||
JSObject **parentObj);
|
||||
|
||||
// Same as the WrapNative above, but use this one if aIID is nsISupports' IID.
|
||||
static nsresult WrapNative(JSContext *cx, JSObject *scope,
|
||||
nsISupports *native, PRBool aAllowWrapping,
|
||||
|
|
|
@ -265,7 +265,7 @@ nsIContent*
|
|||
nsFocusManager::GetRedirectedFocus(nsIContent* aContent)
|
||||
{
|
||||
#ifdef MOZ_XUL
|
||||
if (aContent->IsNodeOfType(nsINode::eXUL)) {
|
||||
if (aContent->IsXUL()) {
|
||||
nsCOMPtr<nsIDOMNode> inputField;
|
||||
|
||||
nsCOMPtr<nsIDOMXULTextBoxElement> textbox = do_QueryInterface(aContent);
|
||||
|
@ -1262,7 +1262,7 @@ nsFocusManager::CheckIfFocusable(nsIContent* aContent, PRUint32 aFlags)
|
|||
if (!frame)
|
||||
return nsnull;
|
||||
|
||||
if (aContent->Tag() == nsGkAtoms::area && aContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
if (aContent->Tag() == nsGkAtoms::area && aContent->IsHTML()) {
|
||||
// HTML areas do not have their own frame, and the img frame we get from
|
||||
// GetPrimaryFrameFor() is not relevant as to whether it is focusable or
|
||||
// not, so we have to do all the relevant checks manually for them.
|
||||
|
@ -2083,7 +2083,7 @@ nsFocusManager::DetermineElementToMoveFocus(nsPIDOMWindow* aWindow,
|
|||
if (startContent) {
|
||||
nsIFrame* frame = presShell->GetPrimaryFrameFor(startContent);
|
||||
if (startContent->Tag() == nsGkAtoms::area &&
|
||||
startContent->IsNodeOfType(nsINode::eHTML))
|
||||
startContent->IsHTML())
|
||||
startContent->IsFocusable(&tabIndex);
|
||||
else if (frame)
|
||||
frame->IsFocusable(&tabIndex, 0);
|
||||
|
@ -2363,7 +2363,7 @@ nsFocusManager::GetNextTabbableContent(nsIPresShell* aPresShell,
|
|||
frameTraversal->Last();
|
||||
}
|
||||
else if (!aStartContent || aStartContent->Tag() != nsGkAtoms::area ||
|
||||
!aStartContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
!aStartContent->IsHTML()) {
|
||||
// Need to do special check in case we're in an imagemap which has multiple
|
||||
// content nodes per frame, so don't skip over the starting frame.
|
||||
if (aForward)
|
||||
|
@ -2647,7 +2647,7 @@ nsFocusManager::GetRootForFocus(nsPIDOMWindow* aWindow,
|
|||
for (PRUint32 i = 0; i < childCount; ++i) {
|
||||
nsIContent *childContent = rootContent->GetChildAt(i);
|
||||
nsINodeInfo *ni = childContent->NodeInfo();
|
||||
if (childContent->IsNodeOfType(nsINode::eHTML) &&
|
||||
if (childContent->IsHTML() &&
|
||||
ni->Equals(nsGkAtoms::frameset))
|
||||
return nsnull;
|
||||
}
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Netscape Communications Corporation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 1998
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
PrintFrames=Print Frames
|
||||
Aslaid=As &laid out on the screen
|
||||
selectedframe=The selected &frame
|
||||
Eachframe=&Each frame separately
|
||||
options=Options
|
|
@ -14,7 +14,6 @@
|
|||
locale/@AB_CD@/global/global-strres.properties (%chrome/global-strres.properties)
|
||||
locale/@AB_CD@/global/plugins.properties (%chrome/plugins.properties)
|
||||
locale/@AB_CD@/global/nsWebBrowserPersist.properties (%chrome/nsWebBrowserPersist.properties)
|
||||
locale/@AB_CD@/global/printdialog.properties (%chrome/printdialog.properties)
|
||||
locale/@AB_CD@/global/xslt/xslt.properties (%chrome/xslt/xslt.properties)
|
||||
locale/@AB_CD@/global/dom/dom.properties (%chrome/dom/dom.properties)
|
||||
#ifdef MOZ_SVG
|
||||
|
|
|
@ -789,7 +789,7 @@ nsFind::NextNode(nsIDOMRange* aSearchRange,
|
|||
|
||||
PRBool nsFind::IsBlockNode(nsIContent* aContent)
|
||||
{
|
||||
if (!aContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
if (!aContent->IsHTML()) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
@ -854,7 +854,7 @@ PRBool nsFind::SkipNode(nsIContent* aContent)
|
|||
// We may not need to skip comment nodes,
|
||||
// now that IsTextNode distinguishes them from real text nodes.
|
||||
return (aContent->IsNodeOfType(nsINode::eCOMMENT) ||
|
||||
(aContent->IsNodeOfType(nsINode::eHTML) &&
|
||||
(aContent->IsHTML() &&
|
||||
(atom == sScriptAtom ||
|
||||
atom == sNoframesAtom ||
|
||||
atom == sSelectAtom)));
|
||||
|
@ -871,7 +871,7 @@ PRBool nsFind::SkipNode(nsIContent* aContent)
|
|||
atom = content->Tag();
|
||||
|
||||
if (aContent->IsNodeOfType(nsINode::eCOMMENT) ||
|
||||
(content->IsNodeOfType(nsINode::eHTML) &&
|
||||
(content->IsHTML() &&
|
||||
(atom == sScriptAtom ||
|
||||
atom == sNoframesAtom ||
|
||||
atom == sSelectAtom)))
|
||||
|
|