Merge mozilla-central into mozilla-inbound.

This commit is contained in:
Mounir Lamouri 2011-07-11 16:19:00 +02:00
commit ff2eb8c7a3
70 changed files with 381 additions and 426 deletions

View File

@ -67,7 +67,7 @@
#include "nsIDocument.h"
#include "nsEventListenerManager.h"
#include "nsIFrame.h"
#include "nsIMenuFrame.h"
#include "nsMenuFrame.h"
#include "nsIHTMLDocument.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsISelectionPrivate.h"
@ -688,16 +688,13 @@ nsRootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
return; // Tree with nothing selected
}
#endif
nsIFrame* menuFrame = accessible->GetFrame();
if (!menuFrame)
return;
nsIMenuFrame* imenuFrame = do_QueryFrame(menuFrame);
if (imenuFrame)
nsMenuFrame* menuFrame = do_QueryFrame(accessible->GetFrame());
if (menuFrame)
fireFocus = PR_TRUE;
// QI failed for nsIMenuFrame means it's not on menu bar
if (imenuFrame && imenuFrame->IsOnMenuBar() &&
!imenuFrame->IsOnActiveMenuBar()) {
// QI failed for nsMenuFrame means it's not on menu bar
if (menuFrame && menuFrame->IsOnMenuBar() &&
!menuFrame->IsOnActiveMenuBar()) {
// It is a top level menuitem. Only fire a focus event when the menu bar
// is active.
return;

View File

@ -96,8 +96,9 @@ function open()
{
var url;
var postData = {};
var mayInheritPrincipal = {value: false};
if (browser)
url = browser.getShortcutOrURI(dialog.input.value, postData);
url = browser.getShortcutOrURI(dialog.input.value, postData, mayInheritPrincipal);
else
url = dialog.input.value;
@ -106,7 +107,11 @@ function open()
// fixup the URI
switch (dialog.openWhereList.value) {
case "0":
browser.loadURI(url, null, postData.value, true);
var webNav = Components.interfaces.nsIWebNavigation;
var flags = webNav.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP;
if (!mayInheritPrincipal.value)
flags |= webNav.LOAD_FLAGS_DISALLOW_INHERIT_OWNER;
browser.gBrowser.loadURIWithFlags(url, flags, null, null, postData.value);
break;
case "1":
window.opener.delayedOpenWindow(getBrowserURL(), "all,dialog=no",

View File

@ -220,6 +220,7 @@ _BROWSER_FILES = \
browser_tabfocus.js \
browser_tabs_isActive.js \
browser_tabs_owner.js \
browser_urlbarCopying.js \
browser_urlbarTrimURLs.js \
browser_urlHighlight.js \
browser_visibleFindSelection.js \

View File

@ -0,0 +1,165 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const trimPref = "browser.urlbar.trimURLs";
function test() {
gBrowser.selectedTab = gBrowser.addTab();
registerCleanupFunction(function () {
gBrowser.removeCurrentTab();
Services.prefs.clearUserPref(trimPref);
URLBarSetURI();
});
Services.prefs.setBoolPref(trimPref, true);
waitForExplicitFinish();
nextTest();
}
var tests = [
// pageproxystate="invalid"
{
setURL: "http://example.com/",
expectedURL: "example.com",
copyExpected: "example.com"
},
{
copyVal: "<e>xample.com",
copyExpected: "e"
},
// pageproxystate="valid" from this point on (due to the load)
{
loadURL: "http://example.com/",
expectedURL: "example.com",
copyExpected: "http://example.com/"
},
{
copyVal: "<example.co>m",
copyExpected: "http://example.co"
},
{
copyVal: "e<x>ample.com",
copyExpected: "x"
},
{
copyVal: "<e>xample.com",
copyExpected: "http://e"
},
// Test escaping
{
loadURL: "http://example.com/()%C3%A9",
expectedURL: "example.com/()\xe9",
copyExpected: "http://example.com/%28%29%C3%A9"
},
{
copyVal: "<example.com/(>)\xe9",
copyExpected: "http://example.com/("
},
{
copyVal: "e<xample.com/(>)\xe9",
copyExpected: "xample.com/("
},
{
loadURL: "http://example.com/%C3%A9%C3%A9",
expectedURL: "example.com/\xe9\xe9",
copyExpected: "http://example.com/%C3%A9%C3%A9"
},
{
copyVal: "e<xample.com/\xe9>\xe9",
copyExpected: "xample.com/\xe9"
},
{
copyVal: "<example.com/\xe9>\xe9",
copyExpected: "http://example.com/\xe9"
},
// data: and javsacript: URIs shouldn't be encoded
{
loadURL: "javascript:('%C3%A9')",
expectedURL: "javascript:('\xe9')",
copyExpected: "javascript:('\xe9')"
},
{
copyVal: "<javascript:(>'\xe9')",
copyExpected: "javascript:("
},
{
loadURL: "data:text/html,(%C3%A9)",
expectedURL: "data:text/html,(\xe9)",
copyExpected: "data:text/html,(\xe9)"
},
{
copyVal: "<data:text/html,(>\xe9)",
copyExpected: "data:text/html,("
},
{
copyVal: "data:<text/html,(\xe9>)",
copyExpected: "text/html,(\xe9"
}
];
function nextTest() {
let test = tests.shift();
if (tests.length == 0)
runTest(test, finish);
else
runTest(test, nextTest);
}
function runTest(test, cb) {
function doCheck() {
if (test.setURL || test.loadURL)
is(gURLBar.value, test.expectedURL, "url bar value set");
testCopy(test.copyVal, test.copyExpected, cb);
}
if (test.loadURL) {
loadURL(test.loadURL, doCheck);
} else {
if (test.setURL)
gURLBar.value = test.setURL;
doCheck();
}
}
function testCopy(copyVal, targetValue, cb) {
info("Expecting copy of: " + targetValue);
waitForClipboard(targetValue, function () {
gURLBar.focus();
if (copyVal) {
let startBracket = copyVal.indexOf("<");
let endBracket = copyVal.indexOf(">");
if (startBracket == -1 || endBracket == -1 ||
startBracket > endBracket ||
copyVal.replace("<", "").replace(">", "") != gURLBar.value) {
ok(false, "invalid copyVal: " + copyVal);
}
gURLBar.selectionStart = startBracket;
gURLBar.selectionEnd = endBracket - 1;
} else {
gURLBar.select();
}
goDoCommand("cmd_copy");
}, cb, cb);
}
function loadURL(aURL, aCB) {
gBrowser.selectedBrowser.addEventListener("load", function () {
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
is(gBrowser.currentURI.spec, aURL, "loaded expected URL");
aCB();
}, true);
gBrowser.loadURI(aURL);
}

View File

@ -4,7 +4,7 @@
function testVal(originalValue, targetValue) {
gURLBar.value = originalValue;
is(gURLBar.value, targetValue || originalValue, "original value: " + originalValue);
is(gURLBar.value, targetValue || originalValue, "url bar value set");
}
function test() {
@ -72,7 +72,7 @@ function test() {
function testCopy(originalValue, targetValue, cb) {
waitForClipboard(targetValue, function () {
is(gURLBar.value, originalValue);
is(gURLBar.value, originalValue, "url bar copy value set");
gURLBar.focus();
gURLBar.select();

View File

@ -505,23 +505,40 @@
<body><![CDATA[
// Grab the actual input field's value, not our value, which could include moz-action:
var inputVal = this.inputField.value;
var val = inputVal.substring(this.selectionStart, this.selectionEnd);
var selectedVal = inputVal.substring(this.selectionStart, this.selectionEnd);
// If the entire value is selected and it's a valid non-javascript,
// non-data URI, encode it.
if (val == inputVal &&
this.getAttribute("pageproxystate") == "valid") {
let uri = gBrowser.currentURI;
// If the selection doesn't start at the beginning or URL bar is
// modified, nothing else to do here.
if (this.getAttribute("pageproxystate") != "valid" || this.selectionStart > 0)
return selectedVal;
if (uri && !uri.schemeIs("javascript") && !uri.schemeIs("data")) {
val = uri.spec;
let uri = gBrowser.currentURI;
// If the entire URL is selected, just use the actual loaded URI.
if (inputVal == selectedVal) {
// ... but only if isn't a javascript: or data: URI, since those
// are hard to read when encoded
if (!uri.schemeIs("javascript") && !uri.schemeIs("data")) {
// Parentheses are known to confuse third-party applications (bug 458565).
val = val.replace(/[()]/g, function (c) escape(c));
selectedVal = uri.spec.replace(/[()]/g, function (c) escape(c));
}
return selectedVal;
}
return val;
// Just the beginning of the URL is selected, check for a trimmed
// value
let spec = uri.spec;
let trimmedSpec = this.trimValue(spec);
if (spec != trimmedSpec) {
// Prepend the portion that trimValue removed from the beginning.
// This assumes trimValue will only truncate the URL at
// the beginning or end (or both).
let trimmedSegments = spec.split(trimmedSpec);
selectedVal = trimmedSegments[0] + selectedVal;
}
return selectedVal;
]]></body>
</method>

View File

@ -67,7 +67,7 @@ def find_version(e):
return encode_ver(last_version)
if __name__ == '__main__':
cxx_env = os.environ.get('CXX', 'c++')
cxx_env = os.environ['CXX']
print 'MOZ_LIBSTDCXX_TARGET_VERSION=%s' % find_version(cxx_env)
host_cxx_env = os.environ.get('HOST_CXX', cxx_env)
print 'MOZ_LIBSTDCXX_HOST_VERSION=%s' % find_version(host_cxx_env)

View File

@ -763,7 +763,7 @@ user_pref("camino.use_system_proxy_settings", false); // Camino-only, harmless t
self.lastTestSeen = line.split("|")[1].strip()
if stackFixerFunction:
line = stackFixerFunction(line)
self.log.info(line.rstrip())
self.log.info(line.rstrip().decode("UTF-8", "ignore"))
if self.UNIXISH and not debuggerInfo and not self.haveDumpedScreen and "TEST-UNEXPECTED-FAIL" in line and "Test timed out" in line:
self.dumpScreen(utilityPath)

View File

@ -2053,7 +2053,6 @@ case "$target" in
else
MOZ_OPTIMIZE_FLAGS="-O3 -fno-omit-frame-pointer"
fi
MOZ_MEMORY=1
_PEDANTIC=
CFLAGS="$CFLAGS -fno-common"
CXXFLAGS="$CXXFLAGS -fno-common"
@ -7699,7 +7698,7 @@ MOZ_ARG_ENABLE_BOOL(stdcxx-compat,
AC_SUBST(STDCXX_COMPAT)
if test -n "$STDCXX_COMPAT"; then
eval $($PYTHON $_topsrcdir/build/autoconf/libstdcxx.py)
eval $(CXX="$CXX" $PYTHON $_topsrcdir/build/autoconf/libstdcxx.py)
AC_SUBST(MOZ_LIBSTDCXX_TARGET_VERSION)
AC_SUBST(MOZ_LIBSTDCXX_HOST_VERSION)
fi

View File

@ -79,7 +79,6 @@
#include "nsPIDOMWindow.h"
#include "nsIViewManager.h"
#include "nsDOMError.h"
#include "nsIMenuFrame.h"
using namespace mozilla;

View File

@ -98,6 +98,9 @@ RCFILE = nptest.rc
RESFILE = nptest.res
DEFFILE = $(win_srcdir)/nptest.def
OS_LIBS += $(call EXPAND_LIBNAME,msimg32)
# Windows opt builds without PGO break nptest.dll
MOZ_OPTIMIZE=
endif
include $(topsrcdir)/config/rules.mk

View File

@ -545,9 +545,10 @@ nsJSONListener::OnStopRequest(nsIRequest *aRequest, nsISupports *aContext,
{
nsresult rv;
// This can happen with short UTF-8 messages
// This can happen with short UTF-8 messages (<4 bytes)
if (!mSniffBuffer.IsEmpty()) {
rv = ProcessBytes(mSniffBuffer.get(), mSniffBuffer.Length());
// Just consume mSniffBuffer
rv = ProcessBytes(nsnull, 0);
NS_ENSURE_SUCCESS(rv, rv);
}
@ -617,6 +618,9 @@ nsJSONListener::ProcessBytes(const char* aBuffer, PRUint32 aByteLength)
buffer[2] != 0x00 && buffer[3] != 0x00) {
charset = "UTF-8";
}
} else {
// Not enough bytes to sniff, assume UTF-8
charset = "UTF-8";
}
}
@ -635,6 +639,9 @@ nsJSONListener::ProcessBytes(const char* aBuffer, PRUint32 aByteLength)
mSniffBuffer.Truncate();
}
if (!aBuffer)
return NS_OK;
if (mNeedsConverter) {
rv = ConsumeConverted(aBuffer, aByteLength);
} else {

View File

@ -0,0 +1 @@
{}

View File

@ -23,4 +23,7 @@ function run_test()
var x = read_file("decodeFromStream-01.json");
do_check_eq(x["JSON Test Pattern pass3"]["The outermost value"], "must be an object or array.");
do_check_eq(x["JSON Test Pattern pass3"]["In this test"], "It is an object.");
x = read_file("decodeFromStream-small.json");
do_check_eq(x.toSource(), "({})", "empty object parsed");
}

View File

@ -92,16 +92,25 @@
#define JSDOUBLE_SIGNBIT (((uint64) 1) << 63)
#define JSDOUBLE_EXPMASK (((uint64) 0x7ff) << 52)
#define JSDOUBLE_MANTMASK ((((uint64) 1) << 52) - 1)
#define JSDOUBLE_HI32_SIGNBIT 0x80000000
static JS_ALWAYS_INLINE JSBool
JSDOUBLE_IS_NEGZERO(jsdouble d)
{
if (d != 0)
return false;
union {
struct {
#if defined(IS_LITTLE_ENDIAN) && !defined(FPU_IS_ARM_FPA)
uint32 lo, hi;
#else
uint32 hi, lo;
#endif
} s;
jsdouble d;
uint64 bits;
} x;
x.d = d;
return x.bits == JSDOUBLE_SIGNBIT;
return (x.s.hi & JSDOUBLE_HI32_SIGNBIT) != 0;
}
static inline bool

View File

@ -107,7 +107,7 @@
#include "nsLayoutUtils.h"
#include "nsAutoPtr.h"
#include "nsBoxFrame.h"
#include "nsIBoxLayout.h"
#include "nsBoxLayout.h"
#include "nsImageFrame.h"
#include "nsIObjectLoadingContent.h"
#include "nsContentErrors.h"
@ -318,7 +318,7 @@ NS_NewTreeBodyFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
// grid
nsresult
NS_NewGridLayout2 ( nsIPresShell* aPresShell, nsIBoxLayout** aNewLayout );
NS_NewGridLayout2 ( nsIPresShell* aPresShell, nsBoxLayout** aNewLayout );
nsIFrame*
NS_NewGridRowLeafFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
@ -3947,7 +3947,7 @@ static
nsIFrame* NS_NewGridBoxFrame(nsIPresShell* aPresShell,
nsStyleContext* aStyleContext)
{
nsCOMPtr<nsIBoxLayout> layout;
nsCOMPtr<nsBoxLayout> layout;
NS_NewGridLayout2(aPresShell, getter_AddRefs(layout));
if (!layout) {
return nsnull;

View File

@ -56,7 +56,7 @@
#include "nsIDocument.h"
#include "nsBoxLayoutState.h"
#include "nsINodeInfo.h"
#include "nsIScrollbarFrame.h"
#include "nsScrollbarFrame.h"
#include "nsIScrollbarMediator.h"
#include "nsITextControlFrame.h"
#include "nsIDOMHTMLTextAreaElement.h"
@ -3559,10 +3559,7 @@ nsGfxScrollFrameInner::GetActualScrollbarSizes() const
void
nsGfxScrollFrameInner::SetScrollbarVisibility(nsIBox* aScrollbar, PRBool aVisible)
{
if (!aScrollbar)
return;
nsIScrollbarFrame* scrollbar = do_QueryFrame(aScrollbar);
nsScrollbarFrame* scrollbar = do_QueryFrame(aScrollbar);
if (scrollbar) {
// See if we have a mediator.
nsIScrollbarMediator* mediator = scrollbar->GetScrollbarMediator();

View File

@ -91,7 +91,7 @@ class nsIWidget;
class nsIDOMRange;
class nsISelectionController;
class nsBoxLayoutState;
class nsIBoxLayout;
class nsBoxLayout;
class nsILineIterator;
#ifdef ACCESSIBILITY
class nsAccessible;
@ -2594,8 +2594,8 @@ NS_PTR_TO_INT32(frame->Properties().Get(nsIFrame::EmbeddingLevelProperty()))
NS_IMETHOD GetBorder(nsMargin& aBorder)=0;
NS_IMETHOD GetPadding(nsMargin& aBorderAndPadding)=0;
NS_IMETHOD GetMargin(nsMargin& aMargin)=0;
virtual void SetLayoutManager(nsIBoxLayout* aLayout) { }
virtual nsIBoxLayout* GetLayoutManager() { return nsnull; }
virtual void SetLayoutManager(nsBoxLayout* aLayout) { }
virtual nsBoxLayout* GetLayoutManager() { return nsnull; }
NS_HIDDEN_(nsresult) GetClientRect(nsRect& aContentRect);
// For nsSprocketLayout

View File

@ -125,7 +125,6 @@ public:
nsISVGGlyphFragmentNode_id,
nsISVGSVGFrame_id,
nsIScrollableFrame_id,
nsIScrollbarFrame_id,
nsIScrollbarMediator_id,
nsISelectControlFrame_id,
nsIStatefulFrame_id,

View File

@ -48,7 +48,6 @@ GRE_MODULE = 1
EXPORTS = \
nsPIBoxObject.h \
nsIMenuFrame.h \
nsIScrollbarMediator.h \
nsXULPopupManager.h \
$(NULL)

View File

@ -1,65 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** 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 Communicator client 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 of 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 ***** */
#ifndef nsIMenuFrame_h___
#define nsIMenuFrame_h___
#include "nsQueryFrame.h"
enum nsMenuListType {
eNotMenuList,
eReadonlyMenuList,
eEditableMenuList
};
// this interface exists solely because native themes need to call into it.
// Only menu frames should implement it
class nsIMenuFrame
{
public:
NS_DECL_QUERYFRAME_TARGET(nsIMenuFrame)
virtual PRBool IsOpen() = 0;
virtual PRBool IsMenu() = 0;
virtual PRBool IsOnMenuBar() = 0;
virtual PRBool IsOnActiveMenuBar() = 0;
virtual nsMenuListType GetParentMenuListType() = 0;
};
#endif

View File

@ -42,19 +42,16 @@
#include "nsQueryFrame.h"
class nsIScrollbarFrame;
class nsScrollbarFrame;
class nsIScrollbarMediator
{
public:
NS_DECL_QUERYFRAME_TARGET(nsIScrollbarMediator)
// The nsIFrame aScrollbar argument below denotes the
// scrollbar that's firing the notification. It should be
// where the same object as where nsIScrollbarFrame is implemented
NS_IMETHOD PositionChanged(nsIScrollbarFrame* aScrollbar, PRInt32 aOldIndex, PRInt32& aNewIndex) = 0;
NS_IMETHOD ScrollbarButtonPressed(nsIScrollbarFrame* aScrollbar, PRInt32 aOldIndex, PRInt32 aNewIndex) = 0;
// The aScrollbar argument denotes the scrollbar that's firing the notification.
NS_IMETHOD PositionChanged(nsScrollbarFrame* aScrollbar, PRInt32 aOldIndex, PRInt32& aNewIndex) = 0;
NS_IMETHOD ScrollbarButtonPressed(nsScrollbarFrame* aScrollbar, PRInt32 aOldIndex, PRInt32 aNewIndex) = 0;
NS_IMETHOD VisibilityChanged(PRBool aVisible) = 0;
};

View File

@ -596,7 +596,7 @@ nsGrid::GetPartFromBox(nsIBox* aBox)
if (!aBox)
return nsnull;
nsIBoxLayout* layout = aBox->GetLayoutManager();
nsBoxLayout* layout = aBox->GetLayoutManager();
return layout ? layout->AsGridPart() : nsnull;
}

View File

@ -50,7 +50,7 @@
#include "nsSprocketLayout.h"
nsresult
NS_NewGridLayout2( nsIPresShell* aPresShell, nsIBoxLayout** aNewLayout)
NS_NewGridLayout2( nsIPresShell* aPresShell, nsBoxLayout** aNewLayout)
{
*aNewLayout = new nsGridLayout2(aPresShell);
NS_IF_ADDREF(*aNewLayout);

View File

@ -53,14 +53,14 @@ class nsBoxLayoutState;
class nsGridCell;
/**
* The nsIBoxLayout implementation for a grid.
* The nsBoxLayout implementation for a grid.
*/
class nsGridLayout2 : public nsStackLayout,
public nsIGridPart
{
public:
friend nsresult NS_NewGridLayout2(nsIPresShell* aPresShell, nsIBoxLayout** aNewLayout);
friend nsresult NS_NewGridLayout2(nsIPresShell* aPresShell, nsBoxLayout** aNewLayout);
NS_DECL_ISUPPORTS_INHERITED

View File

@ -48,13 +48,13 @@
#include "nsBoxLayoutState.h"
#include "nsGridLayout2.h"
already_AddRefed<nsIBoxLayout> NS_NewGridRowGroupLayout();
already_AddRefed<nsBoxLayout> NS_NewGridRowGroupLayout();
nsIFrame*
NS_NewGridRowGroupFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext)
{
nsCOMPtr<nsIBoxLayout> layout = NS_NewGridRowGroupLayout();
nsCOMPtr<nsBoxLayout> layout = NS_NewGridRowGroupLayout();
if (!layout) {
return nsnull;
}

View File

@ -68,7 +68,7 @@ public:
nsGridRowGroupFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
nsIBoxLayout* aLayoutManager):
nsBoxLayout* aLayoutManager):
nsBoxFrame(aPresShell, aContext, PR_FALSE, aLayoutManager) {}
virtual nscoord GetFlex(nsBoxLayoutState& aBoxLayoutState);

View File

@ -54,9 +54,9 @@
#include "nsGridLayout2.h"
#include "nsGridRow.h"
already_AddRefed<nsIBoxLayout> NS_NewGridRowGroupLayout()
already_AddRefed<nsBoxLayout> NS_NewGridRowGroupLayout()
{
nsIBoxLayout* layout = new nsGridRowGroupLayout();
nsBoxLayout* layout = new nsGridRowGroupLayout();
NS_IF_ADDREF(layout);
return layout;
}

View File

@ -48,13 +48,13 @@
#include "nsGridRowLayout.h"
/**
* The nsIBoxLayout implementation for nsGridRowGroupFrame.
* The nsBoxLayout implementation for nsGridRowGroupFrame.
*/
class nsGridRowGroupLayout : public nsGridRowLayout
{
public:
friend already_AddRefed<nsIBoxLayout> NS_NewGridRowGroupLayout();
friend already_AddRefed<nsBoxLayout> NS_NewGridRowGroupLayout();
virtual nsGridRowGroupLayout* CastToRowGroupLayout() { return this; }
virtual nsSize GetMinSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);

View File

@ -128,7 +128,7 @@ nsGridRowLayout::GetGrid(nsIBox* aBox, PRInt32* aIndex, nsGridRowLayout* aReques
// if there is a scrollframe walk inside it to its child
nsIBox* childBox = nsGrid::GetScrolledBox(child);
nsIBoxLayout* layout = childBox->GetLayoutManager();
nsBoxLayout* layout = childBox->GetLayoutManager();
nsIGridPart* gridRow = nsGrid::GetPartFromBox(childBox);
if (gridRow)
{

View File

@ -53,8 +53,8 @@ class nsBoxLayoutState;
class nsGrid;
/**
* A common base class for nsGridRowLeafLayout (the nsIBoxLayout object
* for a grid row or column) and nsGridRowGroupLayout (the nsIBoxLayout
* A common base class for nsGridRowLeafLayout (the nsBoxLayout object
* for a grid row or column) and nsGridRowGroupLayout (the nsBoxLayout
* object for a grid row group or column group).
*/
// XXXldb This needs a name that indicates that it's a base class for

View File

@ -48,13 +48,13 @@
#include "nsBoxLayoutState.h"
#include "nsGridLayout2.h"
already_AddRefed<nsIBoxLayout> NS_NewGridRowLeafLayout();
already_AddRefed<nsBoxLayout> NS_NewGridRowLeafLayout();
nsIFrame*
NS_NewGridRowLeafFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext)
{
nsCOMPtr<nsIBoxLayout> layout = NS_NewGridRowLeafLayout();
nsCOMPtr<nsBoxLayout> layout = NS_NewGridRowLeafLayout();
if (!layout) {
return nsnull;
}

View File

@ -73,7 +73,7 @@ public:
nsGridRowLeafFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager):
nsBoxLayout* aLayoutManager):
nsBoxFrame(aPresShell, aContext, aIsRoot, aLayoutManager) {}
NS_IMETHOD GetBorderAndPadding(nsMargin& aBorderAndPadding);

View File

@ -51,9 +51,9 @@
#include "nsBoxFrame.h"
#include "nsGridLayout2.h"
already_AddRefed<nsIBoxLayout> NS_NewGridRowLeafLayout()
already_AddRefed<nsBoxLayout> NS_NewGridRowLeafLayout()
{
nsIBoxLayout* layout = new nsGridRowLeafLayout();
nsBoxLayout* layout = new nsGridRowLeafLayout();
NS_IF_ADDREF(layout);
return layout;
}

View File

@ -49,7 +49,7 @@
#include "nsCOMPtr.h"
/**
* The nsIBoxLayout implementation for nsGridRowLeafFrame.
* The nsBoxLayout implementation for nsGridRowLeafFrame.
*/
// XXXldb This needs a better name that indicates that it's for any grid
// row.
@ -57,7 +57,7 @@ class nsGridRowLeafLayout : public nsGridRowLayout
{
public:
friend already_AddRefed<nsIBoxLayout> NS_NewGridRowLeafLayout();
friend already_AddRefed<nsBoxLayout> NS_NewGridRowLeafLayout();
virtual nsSize GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
virtual nsSize GetMinSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);

View File

@ -53,7 +53,7 @@ class nsGridLayout2;
{ 0xb3, 0x6c, 0x69, 0xf7, 0xc1, 0x95, 0x67, 0x7b } }
/**
* An additional interface implemented by nsIBoxLayout implementations
* An additional interface implemented by nsBoxLayout implementations
* for parts of a grid (excluding cells, which are not special).
*/
class nsIGridPart : public nsISupports {

View File

@ -53,7 +53,7 @@
#include "nsIDocument.h"
#include "nsITheme.h"
#include "nsIServiceManager.h"
#include "nsIBoxLayout.h"
#include "nsBoxLayout.h"
#include "FrameLayerBuilder.h"
using namespace mozilla;

View File

@ -78,7 +78,7 @@
#include "nsIPresShell.h"
#include "nsCSSRendering.h"
#include "nsIServiceManager.h"
#include "nsIBoxLayout.h"
#include "nsBoxLayout.h"
#include "nsSprocketLayout.h"
#include "nsIDocument.h"
#include "nsIScrollableFrame.h"
@ -120,7 +120,7 @@ nsIBox* nsBoxFrame::mDebugChild = nsnull;
#endif
nsIFrame*
NS_NewBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot, nsIBoxLayout* aLayoutManager)
NS_NewBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot, nsBoxLayout* aLayoutManager)
{
return new (aPresShell) nsBoxFrame(aPresShell, aContext, aIsRoot, aLayoutManager);
}
@ -136,7 +136,7 @@ NS_IMPL_FRAMEARENA_HELPERS(nsBoxFrame)
nsBoxFrame::nsBoxFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager) :
nsBoxLayout* aLayoutManager) :
nsContainerFrame(aContext)
{
mState |= NS_STATE_IS_HORIZONTAL;
@ -149,7 +149,7 @@ nsBoxFrame::nsBoxFrame(nsIPresShell* aPresShell,
mHalign = hAlign_Left;
// if no layout manager specified us the static sprocket layout
nsCOMPtr<nsIBoxLayout> layout = aLayoutManager;
nsCOMPtr<nsBoxLayout> layout = aLayoutManager;
if (layout == nsnull) {
NS_NewSprocketLayout(aPresShell, layout);

View File

@ -71,7 +71,7 @@ class nsBoxLayoutState;
nsIFrame* NS_NewBoxFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager);
nsBoxLayout* aLayoutManager);
nsIFrame* NS_NewBoxFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext);
@ -83,7 +83,7 @@ public:
friend nsIFrame* NS_NewBoxFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager);
nsBoxLayout* aLayoutManager);
friend nsIFrame* NS_NewBoxFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext);
@ -91,8 +91,8 @@ public:
// call this method to get the rect so you don't draw on the debug border or outer border.
// ------ nsIBox -------------
virtual void SetLayoutManager(nsIBoxLayout* aLayout) { mLayoutManager = aLayout; }
virtual nsIBoxLayout* GetLayoutManager() { return mLayoutManager; }
virtual void SetLayoutManager(nsBoxLayout* aLayout) { mLayoutManager = aLayout; }
virtual nsBoxLayout* GetLayoutManager() { return mLayoutManager; }
NS_IMETHOD RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIBox* aChild);
@ -181,7 +181,7 @@ public:
virtual ~nsBoxFrame();
nsBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot = PR_FALSE, nsIBoxLayout* aLayoutManager = nsnull);
nsBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot = PR_FALSE, nsBoxLayout* aLayoutManager = nsnull);
// virtual so nsStackFrame, nsButtonBoxFrame, nsSliderFrame and nsMenuFrame
// can override it
@ -240,7 +240,7 @@ protected:
nscoord mFlex;
nscoord mAscent;
nsCOMPtr<nsIBoxLayout> mLayoutManager;
nsCOMPtr<nsBoxLayout> mLayoutManager;
protected:
nsresult RegUnregAccessKey(PRBool aDoReg);

View File

@ -44,17 +44,10 @@
//
#include "nsBox.h"
#include "nsPresContext.h"
#include "nsCOMPtr.h"
#include "nsIContent.h"
#include "nsHTMLContainerFrame.h"
#include "nsIFrame.h"
#include "nsBoxLayout.h"
nsBoxLayout::nsBoxLayout()
{
}
void
nsBoxLayout::AddBorderAndPadding(nsIBox* aBox, nsSize& aSize)
{
@ -131,42 +124,4 @@ nsBoxLayout::AddSmallestSize(nsSize& aSize, const nsSize& aSize2)
aSize.height = aSize2.height;
}
void
nsBoxLayout::ChildrenInserted(nsIBox* aBox, nsBoxLayoutState& aState,
nsIBox* aPrevBox,
const nsFrameList::Slice& aNewChildren)
{
}
void
nsBoxLayout::ChildrenAppended(nsIBox* aBox, nsBoxLayoutState& aState,
const nsFrameList::Slice& aNewChildren)
{
}
void
nsBoxLayout::ChildrenRemoved(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList)
{
}
void
nsBoxLayout::ChildrenSet(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList)
{
}
void
nsBoxLayout::IntrinsicWidthsDirty(nsIBox* aBox, nsBoxLayoutState& aState)
{
}
// nsISupports
NS_IMPL_ADDREF(nsBoxLayout)
NS_IMPL_RELEASE(nsBoxLayout)
//
// QueryInterface
//
NS_INTERFACE_MAP_BEGIN(nsBoxLayout)
NS_INTERFACE_MAP_ENTRY(nsIBoxLayout)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
NS_IMPL_ISUPPORTS1(nsBoxLayout, nsBoxLayout)

View File

@ -38,17 +38,26 @@
#ifndef nsBoxLayout_h___
#define nsBoxLayout_h___
#include "nsIBoxLayout.h"
#include "nsISupports.h"
#include "nsIFrame.h"
class nsBoxLayout : public nsIBoxLayout {
#define NS_BOX_LAYOUT_IID \
{ 0x09d522a7, 0x304c, 0x4137, \
{ 0xaf, 0xc9, 0xe0, 0x80, 0x2e, 0x89, 0xb7, 0xe8 } }
class nsIGridPart;
class nsBoxLayout : public nsISupports {
public:
nsBoxLayout();
nsBoxLayout() {}
virtual ~nsBoxLayout() {}
NS_DECL_ISUPPORTS
NS_DECLARE_STATIC_IID_ACCESSOR(NS_BOX_LAYOUT_IID)
NS_IMETHOD Layout(nsIBox* aBox, nsBoxLayoutState& aState);
virtual nsSize GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
@ -57,12 +66,12 @@ public:
virtual nscoord GetAscent(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
virtual void ChildrenInserted(nsIBox* aBox, nsBoxLayoutState& aState,
nsIBox* aPrevBox,
const nsFrameList::Slice& aNewChildren);
const nsFrameList::Slice& aNewChildren) {}
virtual void ChildrenAppended(nsIBox* aBox, nsBoxLayoutState& aState,
const nsFrameList::Slice& aNewChildren);
virtual void ChildrenRemoved(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList);
virtual void ChildrenSet(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList);
virtual void IntrinsicWidthsDirty(nsIBox* aBox, nsBoxLayoutState& aState);
const nsFrameList::Slice& aNewChildren) {}
virtual void ChildrenRemoved(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList) {}
virtual void ChildrenSet(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList) {}
virtual void IntrinsicWidthsDirty(nsIBox* aBox, nsBoxLayoutState& aState) {}
virtual void AddBorderAndPadding(nsIBox* aBox, nsSize& aSize);
virtual void AddMargin(nsIBox* aChild, nsSize& aSize);
@ -74,5 +83,7 @@ public:
static void AddSmallestSize(nsSize& aSize, const nsSize& aToAdd);
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsBoxLayout, NS_BOX_LAYOUT_IID)
#endif

View File

@ -70,7 +70,7 @@ NS_IMPL_FRAMEARENA_HELPERS(nsDeckFrame)
nsDeckFrame::nsDeckFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
: nsBoxFrame(aPresShell, aContext), mIndex(0)
{
nsCOMPtr<nsIBoxLayout> layout;
nsCOMPtr<nsBoxLayout> layout;
NS_NewStackLayout(aPresShell, layout);
SetLayoutManager(layout);
}

View File

@ -1,85 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** 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 Communicator client 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 of 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 ***** */
#ifndef nsIBoxLayout_h___
#define nsIBoxLayout_h___
#include "nsISupports.h"
#include "nsIFrame.h"
class nsBoxLayout;
class nsBoxLayoutState;
class nsRenderingContext;
class nsIGridPart;
struct nsRect;
// 6a529924-c73d-4fae-af7a-0e8084e701d5
#define NS_IBOX_LAYOUT_IID \
{ 0x6a529924, 0xc73d, 0x4fae, \
{ 0xaf, 0x7a, 0x0e, 0x80, 0x84, 0xe7, 0x01, 0xd5 } }
class nsIBoxLayout : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IBOX_LAYOUT_IID)
NS_IMETHOD Layout(nsIBox* aBox, nsBoxLayoutState& aState)=0;
virtual nsSize GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)=0;
virtual nsSize GetMinSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)=0;
virtual nsSize GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)=0;
virtual nscoord GetAscent(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)=0;
// FIXME: Bug 507416. The Children* notifications don't actually
// use all those arguments. Can we just simplify the signatures?
virtual void ChildrenInserted(nsIBox* aBox, nsBoxLayoutState& aState,
nsIBox* aPrevBox,
const nsFrameList::Slice& aNewChildren)=0;
virtual void ChildrenAppended(nsIBox* aBox, nsBoxLayoutState& aState,
const nsFrameList::Slice& aNewChildren)=0;
virtual void ChildrenRemoved(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList)=0;
virtual void ChildrenSet(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList)=0;
virtual void IntrinsicWidthsDirty(nsIBox* aBox, nsBoxLayoutState& aState)=0;
// Returns this if it is an nsIGridPart, not refcounted
virtual nsIGridPart* AsGridPart() = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIBoxLayout, NS_IBOX_LAYOUT_IID)
#endif

View File

@ -1,59 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** 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 Communicator client 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):
* Original Author: David W. Hyatt (hyatt@netscape.com)
*
* Alternatively, the contents of this file may be used under the terms of
* either of 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 ***** */
#ifndef nsIScrollbarFrame_h___
#define nsIScrollbarFrame_h___
#include "nsQueryFrame.h"
class nsIScrollbarMediator;
class nsIScrollbarFrame : public nsQueryFrame
{
public:
NS_DECL_QUERYFRAME_TARGET(nsIScrollbarFrame)
// Sets the scrollbar mediator content. We will try to get its primary frame
// and then QI that to nsIScrollbarMediator as necessary.
virtual void SetScrollbarMediatorContent(nsIContent* aMediator) = 0;
// Do NOT hold on to this.
virtual nsIScrollbarMediator* GetScrollbarMediator() = 0;
};
#endif

View File

@ -54,7 +54,7 @@
#include "nsIDOMNodeList.h"
#include "nsCSSFrameConstructor.h"
#include "nsIScrollableFrame.h"
#include "nsIScrollbarFrame.h"
#include "nsScrollbarFrame.h"
#include "nsIView.h"
#include "nsIViewManager.h"
#include "nsStyleContext.h"
@ -164,7 +164,7 @@ NS_IMPL_ISUPPORTS1(nsListScrollSmoother, nsITimerCallback)
nsListBoxBodyFrame::nsListBoxBodyFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
nsIBoxLayout* aLayoutManager)
nsBoxLayout* aLayoutManager)
: nsBoxFrame(aPresShell, aContext, PR_FALSE, aLayoutManager),
mTopFrame(nsnull),
mBottomFrame(nsnull),
@ -214,8 +214,8 @@ nsListBoxBodyFrame::Init(nsIContent* aContent,
nsIScrollableFrame* scrollFrame = nsLayoutUtils::GetScrollableFrameFor(this);
if (scrollFrame) {
nsIBox* verticalScrollbar = scrollFrame->GetScrollbarBox(PR_TRUE);
if (verticalScrollbar) {
nsIScrollbarFrame* scrollbarFrame = do_QueryFrame(verticalScrollbar);
nsScrollbarFrame* scrollbarFrame = do_QueryFrame(verticalScrollbar);
if (scrollbarFrame) {
scrollbarFrame->SetScrollbarMediatorContent(GetContent());
}
}
@ -353,7 +353,7 @@ nsListBoxBodyFrame::GetPrefSize(nsBoxLayoutState& aBoxLayoutState)
///////////// nsIScrollbarMediator ///////////////
NS_IMETHODIMP
nsListBoxBodyFrame::PositionChanged(nsIScrollbarFrame* aScrollbar, PRInt32 aOldIndex, PRInt32& aNewIndex)
nsListBoxBodyFrame::PositionChanged(nsScrollbarFrame* aScrollbar, PRInt32 aOldIndex, PRInt32& aNewIndex)
{
if (mScrolling || mRowHeight == 0)
return NS_OK;
@ -423,7 +423,7 @@ nsListBoxBodyFrame::VisibilityChanged(PRBool aVisible)
}
NS_IMETHODIMP
nsListBoxBodyFrame::ScrollbarButtonPressed(nsIScrollbarFrame* aScrollbar, PRInt32 aOldIndex, PRInt32 aNewIndex)
nsListBoxBodyFrame::ScrollbarButtonPressed(nsScrollbarFrame* aScrollbar, PRInt32 aOldIndex, PRInt32 aNewIndex)
{
if (aOldIndex == aNewIndex)
return NS_OK;
@ -1508,12 +1508,12 @@ nsListBoxBodyFrame::RemoveChildFrame(nsBoxLayoutState &aState,
// Creation Routines ///////////////////////////////////////////////////////////////////////
already_AddRefed<nsIBoxLayout> NS_NewListBoxLayout();
already_AddRefed<nsBoxLayout> NS_NewListBoxLayout();
nsIFrame*
NS_NewListBoxBodyFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
nsCOMPtr<nsIBoxLayout> layout = NS_NewListBoxLayout();
nsCOMPtr<nsBoxLayout> layout = NS_NewListBoxLayout();
if (!layout) {
return nsnull;
}

View File

@ -60,7 +60,7 @@ class nsListBoxBodyFrame : public nsBoxFrame,
public nsIReflowCallback
{
nsListBoxBodyFrame(nsIPresShell* aPresShell, nsStyleContext* aContext,
nsIBoxLayout* aLayoutManager);
nsBoxLayout* aLayoutManager);
virtual ~nsListBoxBodyFrame();
public:
@ -90,8 +90,8 @@ public:
NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType);
// nsIScrollbarMediator
NS_IMETHOD PositionChanged(nsIScrollbarFrame* aScrollbar, PRInt32 aOldIndex, PRInt32& aNewIndex);
NS_IMETHOD ScrollbarButtonPressed(nsIScrollbarFrame* aScrollbar, PRInt32 aOldIndex, PRInt32 aNewIndex);
NS_IMETHOD PositionChanged(nsScrollbarFrame* aScrollbar, PRInt32 aOldIndex, PRInt32& aNewIndex);
NS_IMETHOD ScrollbarButtonPressed(nsScrollbarFrame* aScrollbar, PRInt32 aOldIndex, PRInt32 aNewIndex);
NS_IMETHOD VisibilityChanged(PRBool aVisible);
// nsIReflowCallback

View File

@ -53,7 +53,7 @@ nsListBoxLayout::nsListBoxLayout() : nsGridRowGroupLayout()
{
}
////////// nsIBoxLayout //////////////
////////// nsBoxLayout //////////////
nsSize
nsListBoxLayout::GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)
@ -242,9 +242,9 @@ nsListBoxLayout::LayoutInternal(nsIBox* aBox, nsBoxLayoutState& aState)
// Creation Routines ///////////////////////////////////////////////////////////////////////
already_AddRefed<nsIBoxLayout> NS_NewListBoxLayout()
already_AddRefed<nsBoxLayout> NS_NewListBoxLayout()
{
nsIBoxLayout* layout = new nsListBoxLayout();
nsBoxLayout* layout = new nsListBoxLayout();
NS_IF_ADDREF(layout);
return layout;
}

View File

@ -50,7 +50,7 @@ class nsListBoxLayout : public nsGridRowGroupLayout
public:
nsListBoxLayout();
// nsIBoxLayout
// nsBoxLayout
NS_IMETHOD Layout(nsIBox* aBox, nsBoxLayoutState& aState);
virtual nsSize GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
virtual nsSize GetMinSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);

View File

@ -43,12 +43,12 @@
#include "nsINameSpaceManager.h"
#include "nsGkAtoms.h"
#include "nsDisplayList.h"
#include "nsIBoxLayout.h"
#include "nsBoxLayout.h"
nsListItemFrame::nsListItemFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager)
nsBoxLayout* aLayoutManager)
: nsGridRowLeafFrame(aPresShell, aContext, aIsRoot, aLayoutManager)
{
}
@ -85,12 +85,12 @@ nsListItemFrame::BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder,
// Creation Routine ///////////////////////////////////////////////////////////////////////
already_AddRefed<nsIBoxLayout> NS_NewGridRowLeafLayout();
already_AddRefed<nsBoxLayout> NS_NewGridRowLeafLayout();
nsIFrame*
NS_NewListItemFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
nsCOMPtr<nsIBoxLayout> layout = NS_NewGridRowLeafLayout();
nsCOMPtr<nsBoxLayout> layout = NS_NewGridRowLeafLayout();
if (!layout) {
return nsnull;
}

View File

@ -64,7 +64,7 @@ protected:
nsListItemFrame(nsIPresShell* aPresShell,
nsStyleContext *aContext,
PRBool aIsRoot = nsnull,
nsIBoxLayout* aLayoutManager = nsnull);
nsBoxLayout* aLayoutManager = nsnull);
virtual ~nsListItemFrame();
}; // class nsListItemFrame

View File

@ -213,7 +213,7 @@ NS_NewMenuItemFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
NS_IMPL_FRAMEARENA_HELPERS(nsMenuFrame)
NS_QUERYFRAME_HEAD(nsMenuFrame)
NS_QUERYFRAME_ENTRY(nsIMenuFrame)
NS_QUERYFRAME_ENTRY(nsMenuFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsBoxFrame)
//

View File

@ -51,7 +51,6 @@
#include "nsFrameList.h"
#include "nsGkAtoms.h"
#include "nsMenuParent.h"
#include "nsIMenuFrame.h"
#include "nsXULPopupManager.h"
#include "nsITimer.h"
#include "nsIDOMText.h"
@ -75,6 +74,12 @@ enum nsMenuType {
eMenuType_Radio = 2
};
enum nsMenuListType {
eNotMenuList, // not a menulist
eReadonlyMenuList, // <menulist/>
eEditableMenuList // <menulist editable="true"/>
};
class nsMenuFrame;
/**
@ -101,12 +106,12 @@ private:
nsMenuFrame* mFrame;
};
class nsMenuFrame : public nsBoxFrame,
public nsIMenuFrame
class nsMenuFrame : public nsBoxFrame
{
public:
nsMenuFrame(nsIPresShell* aShell, nsStyleContext* aContext);
NS_DECL_QUERYFRAME_TARGET(nsMenuFrame)
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
@ -185,11 +190,11 @@ public:
// nsMenuFrame methods
virtual PRBool IsOnMenuBar() { return mMenuParent && mMenuParent->IsMenuBar(); }
virtual PRBool IsOnActiveMenuBar() { return IsOnMenuBar() && mMenuParent->IsActive(); }
PRBool IsOnMenuBar() { return mMenuParent && mMenuParent->IsMenuBar(); }
PRBool IsOnActiveMenuBar() { return IsOnMenuBar() && mMenuParent->IsActive(); }
virtual PRBool IsOpen();
virtual PRBool IsMenu();
virtual nsMenuListType GetParentMenuListType();
nsMenuListType GetParentMenuListType();
PRBool IsDisabled();
void ToggleMenuState();

View File

@ -74,7 +74,6 @@
#include "nsContentUtils.h"
#include "nsCSSFrameConstructor.h"
#include "nsEventStateManager.h"
#include "nsIBoxLayout.h"
#include "nsIPopupBoxObject.h"
#include "nsPIWindowRoot.h"
#include "nsIReflowCallback.h"

View File

@ -149,7 +149,7 @@ nsRootBoxFrame::nsRootBoxFrame(nsIPresShell* aShell, nsStyleContext* aContext):
{
mPopupSetFrame = nsnull;
nsCOMPtr<nsIBoxLayout> layout;
nsCOMPtr<nsBoxLayout> layout;
NS_NewStackLayout(aShell, layout);
SetLayoutManager(layout);
}

View File

@ -49,7 +49,7 @@
#include "nsINameSpaceManager.h"
#include "nsGkAtoms.h"
#include "nsSliderFrame.h"
#include "nsIScrollbarFrame.h"
#include "nsScrollbarFrame.h"
#include "nsIScrollbarMediator.h"
#include "nsRepeatService.h"
#include "nsGUIEvent.h"
@ -245,7 +245,7 @@ nsScrollbarButtonFrame::DoButtonAction(PRBool aSmoothScroll)
else if (curpos > maxpos)
curpos = maxpos;
nsIScrollbarFrame* sb = do_QueryFrame(scrollbar);
nsScrollbarFrame* sb = do_QueryFrame(scrollbar);
if (sb) {
nsIScrollbarMediator* m = sb->GetScrollbarMediator();
if (m) {

View File

@ -62,7 +62,7 @@ NS_NewScrollbarFrame (nsIPresShell* aPresShell, nsStyleContext* aContext)
NS_IMPL_FRAMEARENA_HELPERS(nsScrollbarFrame)
NS_QUERYFRAME_HEAD(nsScrollbarFrame)
NS_QUERYFRAME_ENTRY(nsIScrollbarFrame)
NS_QUERYFRAME_ENTRY(nsScrollbarFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsBoxFrame)
NS_IMETHODIMP
@ -129,11 +129,7 @@ nsScrollbarFrame::AttributeChanged(PRInt32 aNameSpaceID,
if (aAttribute != nsGkAtoms::curpos)
return rv;
nsIFrame* parent = GetParent();
if (!parent)
return rv;
nsIScrollableFrame* scrollable = do_QueryFrame(parent);
nsIScrollableFrame* scrollable = do_QueryFrame(GetParent());
if (!scrollable)
return rv;
@ -170,16 +166,12 @@ nsScrollbarFrame::GetScrollbarMediator()
if (!mScrollbarMediator)
return nsnull;
nsIFrame* f = mScrollbarMediator->GetPrimaryFrame();
if (!f)
return nsnull;
// check if the frame is a scroll frame. If so, get the scrollable frame
// inside it.
nsIScrollableFrame* scrollFrame = do_QueryFrame(f);
if (scrollFrame) {
f = scrollFrame->GetScrolledFrame();
if (!f)
return nsnull;
}
nsIScrollbarMediator* sbm = do_QueryFrame(f);

View File

@ -43,18 +43,19 @@
#define nsScrollbarFrame_h__
#include "nsBoxFrame.h"
#include "nsIScrollbarFrame.h"
class nsIScrollbarMediator;
nsIFrame* NS_NewScrollbarFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
class nsScrollbarFrame : public nsBoxFrame, public nsIScrollbarFrame
class nsScrollbarFrame : public nsBoxFrame
{
public:
nsScrollbarFrame(nsIPresShell* aShell, nsStyleContext* aContext):
nsBoxFrame(aShell, aContext), mScrollbarMediator(nsnull) {}
NS_DECL_QUERYFRAME_TARGET(nsScrollbarFrame)
#ifdef DEBUG
NS_IMETHOD GetFrameName(nsAString& aResult) const {
return MakeFrameName(NS_LITERAL_STRING("ScrollbarFrame"), aResult);
@ -91,9 +92,8 @@ public:
virtual nsIAtom* GetType() const;
// nsIScrollbarFrame
virtual void SetScrollbarMediatorContent(nsIContent* aMediator);
virtual nsIScrollbarMediator* GetScrollbarMediator();
void SetScrollbarMediatorContent(nsIContent* aMediator);
nsIScrollbarMediator* GetScrollbarMediator();
// nsBox methods

View File

@ -60,7 +60,7 @@
#include "nsScrollbarButtonFrame.h"
#include "nsISliderListener.h"
#include "nsIScrollbarMediator.h"
#include "nsIScrollbarFrame.h"
#include "nsScrollbarFrame.h"
#include "nsILookAndFeel.h"
#include "nsRepeatService.h"
#include "nsBoxLayoutState.h"
@ -297,7 +297,7 @@ nsSliderFrame::AttributeChanged(PRInt32 aNameSpaceID,
current = max;
// set the new position and notify observers
nsIScrollbarFrame* scrollbarFrame = do_QueryFrame(scrollbarBox);
nsScrollbarFrame* scrollbarFrame = do_QueryFrame(scrollbarBox);
if (scrollbarFrame) {
nsIScrollbarMediator* mediator = scrollbarFrame->GetScrollbarMediator();
if (mediator) {
@ -812,7 +812,7 @@ nsSliderFrame::SetCurrentPositionInternal(nsIContent* aScrollbar, PRInt32 aNewPo
mUserChanged = PR_TRUE;
nsIScrollbarFrame* scrollbarFrame = do_QueryFrame(scrollbarBox);
nsScrollbarFrame* scrollbarFrame = do_QueryFrame(scrollbarBox);
if (scrollbarFrame) {
// See if we have a mediator.
nsIScrollbarMediator* mediator = scrollbarFrame->GetScrollbarMediator();

View File

@ -54,7 +54,7 @@
#include "nsBoxFrame.h"
#include "nsBoxFrame.h"
nsIBoxLayout* nsSprocketLayout::gInstance = nsnull;
nsBoxLayout* nsSprocketLayout::gInstance = nsnull;
//#define DEBUG_GROW
@ -64,7 +64,7 @@ nsIBoxLayout* nsSprocketLayout::gInstance = nsnull;
nsresult
NS_NewSprocketLayout( nsIPresShell* aPresShell, nsCOMPtr<nsIBoxLayout>& aNewLayout)
NS_NewSprocketLayout( nsIPresShell* aPresShell, nsCOMPtr<nsBoxLayout>& aNewLayout)
{
if (!nsSprocketLayout::gInstance) {
nsSprocketLayout::gInstance = new nsSprocketLayout();

View File

@ -89,13 +89,13 @@ public:
#define SET_COORD(aX, aY, coord, isHorizontal) if (isHorizontal) { aX = (coord); } else { aY = (coord); }
nsresult NS_NewSprocketLayout(nsIPresShell* aPresShell, nsCOMPtr<nsIBoxLayout>& aNewLayout);
nsresult NS_NewSprocketLayout(nsIPresShell* aPresShell, nsCOMPtr<nsBoxLayout>& aNewLayout);
class nsSprocketLayout : public nsBoxLayout {
public:
friend nsresult NS_NewSprocketLayout(nsIPresShell* aPresShell, nsCOMPtr<nsIBoxLayout>& aNewLayout);
friend nsresult NS_NewSprocketLayout(nsIPresShell* aPresShell, nsCOMPtr<nsBoxLayout>& aNewLayout);
static void Shutdown();
NS_IMETHOD Layout(nsIBox* aBox, nsBoxLayoutState& aState);
@ -162,8 +162,8 @@ private:
// because the sprocket layout manager has no instance variables. We
// can make a static on and reuse it everywhere.
static nsIBoxLayout* gInstance;
// can make a static one and reuse it everywhere.
static nsBoxLayout* gInstance;
};

View File

@ -64,7 +64,7 @@ NS_IMPL_FRAMEARENA_HELPERS(nsStackFrame)
nsStackFrame::nsStackFrame(nsIPresShell* aPresShell, nsStyleContext* aContext):
nsBoxFrame(aPresShell, aContext)
{
nsCOMPtr<nsIBoxLayout> layout;
nsCOMPtr<nsBoxLayout> layout;
NS_NewStackLayout(aPresShell, layout);
SetLayoutManager(layout);
}

View File

@ -52,7 +52,7 @@
#include "nsIContent.h"
#include "nsINameSpaceManager.h"
nsIBoxLayout* nsStackLayout::gInstance = nsnull;
nsBoxLayout* nsStackLayout::gInstance = nsnull;
#define SPECIFIED_LEFT (1 << NS_SIDE_LEFT)
#define SPECIFIED_RIGHT (1 << NS_SIDE_RIGHT)
@ -60,7 +60,7 @@ nsIBoxLayout* nsStackLayout::gInstance = nsnull;
#define SPECIFIED_BOTTOM (1 << NS_SIDE_BOTTOM)
nsresult
NS_NewStackLayout( nsIPresShell* aPresShell, nsCOMPtr<nsIBoxLayout>& aNewLayout)
NS_NewStackLayout( nsIPresShell* aPresShell, nsCOMPtr<nsBoxLayout>& aNewLayout)
{
if (!nsStackLayout::gInstance) {
nsStackLayout::gInstance = new nsStackLayout();

View File

@ -50,13 +50,13 @@
#include "nsBoxLayout.h"
#include "nsCOMPtr.h"
nsresult NS_NewStackLayout(nsIPresShell* aPresShell, nsCOMPtr<nsIBoxLayout>& aNewLayout);
nsresult NS_NewStackLayout(nsIPresShell* aPresShell, nsCOMPtr<nsBoxLayout>& aNewLayout);
class nsStackLayout : public nsBoxLayout
{
public:
friend nsresult NS_NewStackLayout(nsIPresShell* aPresShell, nsCOMPtr<nsIBoxLayout>& aNewLayout);
friend nsresult NS_NewStackLayout(nsIPresShell* aPresShell, nsCOMPtr<nsBoxLayout>& aNewLayout);
static void Shutdown();
nsStackLayout();
@ -75,7 +75,7 @@ public:
static PRUint8 GetOffset(nsBoxLayoutState& aState, nsIBox* aChild, nsMargin& aMargin);
private:
static nsIBoxLayout* gInstance;
static nsBoxLayout* gInstance;
}; // class nsStackLayout

View File

@ -842,7 +842,7 @@ FindScrollParts(nsIFrame* aCurrFrame, nsTreeBodyFrame::ScrollParts* aResult)
}
}
nsIScrollbarFrame *sf = do_QueryFrame(aCurrFrame);
nsScrollbarFrame *sf = do_QueryFrame(aCurrFrame);
if (sf) {
if (!aCurrFrame->IsHorizontal()) {
if (!aResult->mVScrollbar) {
@ -4148,7 +4148,7 @@ nsTreeBodyFrame::ScrollHorzInternal(const ScrollParts& aParts, PRInt32 aPosition
}
NS_IMETHODIMP
nsTreeBodyFrame::ScrollbarButtonPressed(nsIScrollbarFrame* aScrollbar, PRInt32 aOldIndex, PRInt32 aNewIndex)
nsTreeBodyFrame::ScrollbarButtonPressed(nsScrollbarFrame* aScrollbar, PRInt32 aOldIndex, PRInt32 aNewIndex)
{
ScrollParts parts = GetScrollParts();
@ -4167,7 +4167,7 @@ nsTreeBodyFrame::ScrollbarButtonPressed(nsIScrollbarFrame* aScrollbar, PRInt32 a
}
NS_IMETHODIMP
nsTreeBodyFrame::PositionChanged(nsIScrollbarFrame* aScrollbar, PRInt32 aOldIndex, PRInt32& aNewIndex)
nsTreeBodyFrame::PositionChanged(nsScrollbarFrame* aScrollbar, PRInt32 aOldIndex, PRInt32& aNewIndex)
{
ScrollParts parts = GetScrollParts();

View File

@ -60,7 +60,7 @@
#include "nsDataHashtable.h"
#include "imgIRequest.h"
#include "imgIDecoderObserver.h"
#include "nsIScrollbarFrame.h"
#include "nsScrollbarFrame.h"
#include "nsThreadUtils.h"
class nsOverflowChecker;
@ -146,8 +146,8 @@ public:
virtual PRBool PseudoMatches(nsCSSSelector* aSelector);
// nsIScrollbarMediator
NS_IMETHOD PositionChanged(nsIScrollbarFrame* aScrollbar, PRInt32 aOldIndex, PRInt32& aNewIndex);
NS_IMETHOD ScrollbarButtonPressed(nsIScrollbarFrame* aScrollbar, PRInt32 aOldIndex, PRInt32 aNewIndex);
NS_IMETHOD PositionChanged(nsScrollbarFrame* aScrollbar, PRInt32 aOldIndex, PRInt32& aNewIndex);
NS_IMETHOD ScrollbarButtonPressed(nsScrollbarFrame* aScrollbar, PRInt32 aOldIndex, PRInt32 aNewIndex);
NS_IMETHOD VisibilityChanged(PRBool aVisible) { Invalidate(); return NS_OK; }
// Overridden from nsIFrame to cache our pres context.
@ -173,9 +173,9 @@ public:
friend class nsTreeColumn;
struct ScrollParts {
nsIScrollbarFrame* mVScrollbar;
nsScrollbarFrame* mVScrollbar;
nsCOMPtr<nsIContent> mVScrollbarContent;
nsIScrollbarFrame* mHScrollbar;
nsScrollbarFrame* mHScrollbar;
nsCOMPtr<nsIContent> mHScrollbarContent;
nsIFrame* mColumnsFrame;
nsIScrollableFrame* mColumnsScrollFrame;

View File

@ -137,6 +137,8 @@ DEFINES += -DCAIRO_GFX
INCLUDES += \
-I$(srcdir)/../xpwidgets \
-I$(srcdir)/../shared \
-I$(topsrcdir)/layout/generic \
-I$(topsrcdir)/layout/xul/base/src \
-I$(topsrcdir)/other-licenses/atk-1.0 \
$(NULL)
ifdef MOZ_X11

View File

@ -54,7 +54,7 @@
#include "nsILookAndFeel.h"
#include "nsGfxCIID.h"
#include "nsTransform2D.h"
#include "nsIMenuFrame.h"
#include "nsMenuFrame.h"
#include "prlink.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsRenderingContext.h"
@ -332,7 +332,7 @@ nsNativeThemeGTK::GetGtkWidgetAndState(PRUint8 aWidgetType, nsIFrame* aFrame,
aWidgetType == NS_THEME_MENUSEPARATOR ||
aWidgetType == NS_THEME_MENUARROW) {
PRBool isTopLevel = PR_FALSE;
nsIMenuFrame *menuFrame = do_QueryFrame(aFrame);
nsMenuFrame *menuFrame = do_QueryFrame(aFrame);
if (menuFrame) {
isTopLevel = menuFrame->IsOnMenuBar();
}

View File

@ -124,6 +124,8 @@ LOCAL_INCLUDES = \
-I. \
-I$(srcdir)/../xpwidgets \
-I$(srcdir) \
-I$(topsrcdir)/layout/generic \
-I$(topsrcdir)/layout/xul/base/src \
-I$(topsrcdir)/toolkit/xre \
-I$(topsrcdir)/xpcom/base \
$(NULL)

View File

@ -55,7 +55,7 @@
#include "nsINameSpaceManager.h"
#include "nsILookAndFeel.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIMenuFrame.h"
#include "nsMenuFrame.h"
#include "nsWidgetAtoms.h"
#include <malloc.h>
#include "nsWindow.h"
@ -148,7 +148,7 @@ nsNativeThemeWin::~nsNativeThemeWin() {
static PRBool IsTopLevelMenu(nsIFrame *aFrame)
{
PRBool isTopLevel(PR_FALSE);
nsIMenuFrame *menuFrame = do_QueryFrame(aFrame);
nsMenuFrame *menuFrame = do_QueryFrame(aFrame);
if (menuFrame) {
isTopLevel = menuFrame->IsOnMenuBar();
}
@ -1062,7 +1062,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType,
PRBool isTopLevel = PR_FALSE;
PRBool isOpen = PR_FALSE;
PRBool isHover = PR_FALSE;
nsIMenuFrame *menuFrame = do_QueryFrame(aFrame);
nsMenuFrame *menuFrame = do_QueryFrame(aFrame);
nsEventStates eventState = GetContentState(aFrame, aWidgetType);
isTopLevel = IsTopLevelMenu(aFrame);
@ -2759,7 +2759,7 @@ nsresult nsNativeThemeWin::ClassicGetThemePartAndState(nsIFrame* aFrame, PRUint8
PRBool isTopLevel = PR_FALSE;
PRBool isOpen = PR_FALSE;
PRBool isContainer = PR_FALSE;
nsIMenuFrame *menuFrame = do_QueryFrame(aFrame);
nsMenuFrame *menuFrame = do_QueryFrame(aFrame);
nsEventStates eventState = GetContentState(aFrame, aWidgetType);
// We indicate top-level-ness using aPart. 0 is a normal menu item,

View File

@ -53,7 +53,7 @@
#include "nsIComponentManager.h"
#include "nsPIDOMWindow.h"
#include "nsProgressFrame.h"
#include "nsIMenuFrame.h"
#include "nsMenuFrame.h"
nsNativeTheme::nsNativeTheme()
: mAnimatedContentTimeout(PR_UINT32_MAX)
@ -514,7 +514,7 @@ nsNativeTheme::IsSubmenu(nsIFrame* aFrame, PRBool* aLeftOfParent)
PRBool
nsNativeTheme::IsRegularMenuItem(nsIFrame *aFrame)
{
nsIMenuFrame *menuFrame = do_QueryFrame(aFrame);
nsMenuFrame *menuFrame = do_QueryFrame(aFrame);
return !(menuFrame && (menuFrame->IsOnMenuBar() ||
menuFrame->GetParentMenuListType() != eNotMenuList));
}