Merge layout work from projects/birch, part 1. a=bsmedberg

This commit is contained in:
L. David Baron 2011-03-23 12:36:08 -07:00
Родитель 1ef146d92d 2819c13fc2
Коммит 4520f10e49
50 изменённых файлов: 1515 добавлений и 2073 удалений

Просмотреть файл

@ -2320,7 +2320,6 @@ nsCanvasRenderingContext2D::SetFont(const nsAString& font)
language,
fontStyle->mFont.sizeAdjust,
fontStyle->mFont.systemFont,
fontStyle->mFont.familyNameQuirks,
printerFont,
fontStyle->mFont.featureSettings,
fontStyle->mFont.languageOverride);

Просмотреть файл

@ -194,7 +194,6 @@ MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
if (value && value->Type() == nsAttrValue::eString &&
!value->IsEmptyString()) {
font.mFamily.SetStringValue(value->GetStringValue(), eCSSUnit_Families);
font.mFamilyFromHTML = PR_TRUE;
}
}

Просмотреть файл

@ -403,7 +403,6 @@ nsMathMLElement::MapMathMLAttributesInto(const nsMappedAttributes* aAttributes,
aData->mFontData->mFamily.GetUnit() == eCSSUnit_Null) {
aData->mFontData->mFamily.SetStringValue(value->GetStringValue(),
eCSSUnit_Families);
aData->mFontData->mFamilyFromHTML = PR_FALSE;
}
}

Просмотреть файл

@ -52,7 +52,6 @@ nsFont::nsFont(const char* aName, PRUint8 aStyle, PRUint8 aVariant,
style = aStyle;
systemFont = PR_FALSE;
variant = aVariant;
familyNameQuirks = PR_FALSE;
weight = aWeight;
stretch = aStretch;
decorations = aDecoration;
@ -76,7 +75,6 @@ nsFont::nsFont(const nsString& aName, PRUint8 aStyle, PRUint8 aVariant,
style = aStyle;
systemFont = PR_FALSE;
variant = aVariant;
familyNameQuirks = PR_FALSE;
weight = aWeight;
stretch = aStretch;
decorations = aDecoration;
@ -96,7 +94,6 @@ nsFont::nsFont(const nsFont& aOther)
style = aOther.style;
systemFont = aOther.systemFont;
variant = aOther.variant;
familyNameQuirks = aOther.familyNameQuirks;
weight = aOther.weight;
stretch = aOther.stretch;
decorations = aOther.decorations;
@ -118,7 +115,6 @@ PRBool nsFont::BaseEquals(const nsFont& aOther) const
{
if ((style == aOther.style) &&
(systemFont == aOther.systemFont) &&
(familyNameQuirks == aOther.familyNameQuirks) &&
(weight == aOther.weight) &&
(stretch == aOther.stretch) &&
(size == aOther.size) &&
@ -147,7 +143,6 @@ nsFont& nsFont::operator=(const nsFont& aOther)
style = aOther.style;
systemFont = aOther.systemFont;
variant = aOther.variant;
familyNameQuirks = aOther.familyNameQuirks;
weight = aOther.weight;
stretch = aOther.stretch;
decorations = aOther.decorations;

Просмотреть файл

@ -78,10 +78,6 @@ struct NS_GFX nsFont {
// The variant of the font (normal, small-caps)
PRUint8 variant;
// True if the character set quirks (for treatment of "Symbol",
// "Wingdings", etc.) should be applied.
PRUint8 familyNameQuirks;
// The weight of the font; see gfxFontConstants.h.
PRUint16 weight;

Просмотреть файл

@ -826,7 +826,6 @@ nsThebesDeviceContext::GetSystemFont(nsSystemFontID aID, nsFont *aFont) const
aFont->style = fontStyle.style;
aFont->systemFont = fontStyle.systemFont;
aFont->variant = NS_FONT_VARIANT_NORMAL;
aFont->familyNameQuirks = fontStyle.familyNameQuirks;
aFont->weight = fontStyle.weight;
aFont->stretch = fontStyle.stretch;
aFont->decorations = NS_FONT_DECORATION_NONE;

Просмотреть файл

@ -82,7 +82,6 @@ nsThebesFontMetrics::Init(const nsFont& aFont, nsIAtom* aLanguage,
mFontStyle = new gfxFontStyle(aFont.style, aFont.weight, aFont.stretch,
size, aLanguage,
aFont.sizeAdjust, aFont.systemFont,
aFont.familyNameQuirks,
printerFont,
aFont.featureSettings,
aFont.languageOverride);

Просмотреть файл

@ -117,19 +117,6 @@ gfxAlphaBoxBlur::Init(const gfxRect& aRect,
return mContext;
}
void
gfxAlphaBoxBlur::PremultiplyAlpha(gfxFloat alpha)
{
if (!mImageSurface)
return;
unsigned char* data = mImageSurface->Data();
PRInt32 length = mImageSurface->GetDataSize();
for (PRInt32 i=0; i<length; ++i)
data[i] = static_cast<unsigned char>(data[i] * alpha);
}
/**
* Box blur involves looking at one pixel, and setting its value to the average
* of its neighbouring pixels.

Просмотреть файл

@ -103,11 +103,6 @@ public:
return mContext;
}
/**
* Premultiplies the image by the given alpha.
*/
void PremultiplyAlpha(gfxFloat alpha);
/**
* Does the actual blurring/spreading and mask applying. Users of this
* object must have drawn whatever they want to be blurred onto the internal

Просмотреть файл

@ -2860,7 +2860,7 @@ gfxFontStyle::ParseFontLanguageOverride(const nsString& aLangTag)
gfxFontStyle::gfxFontStyle() :
style(FONT_STYLE_NORMAL), systemFont(PR_TRUE), printerFont(PR_FALSE),
familyNameQuirks(PR_FALSE), weight(FONT_WEIGHT_NORMAL),
weight(FONT_WEIGHT_NORMAL),
stretch(NS_FONT_STRETCH_NORMAL), size(DEFAULT_PIXEL_FONT_SIZE),
sizeAdjust(0.0f),
language(gfxAtoms::x_western),
@ -2871,12 +2871,11 @@ gfxFontStyle::gfxFontStyle() :
gfxFontStyle::gfxFontStyle(PRUint8 aStyle, PRUint16 aWeight, PRInt16 aStretch,
gfxFloat aSize, nsIAtom *aLanguage,
float aSizeAdjust, PRPackedBool aSystemFont,
PRPackedBool aFamilyNameQuirks,
PRPackedBool aPrinterFont,
const nsString& aFeatureSettings,
const nsString& aLanguageOverride):
style(aStyle), systemFont(aSystemFont), printerFont(aPrinterFont),
familyNameQuirks(aFamilyNameQuirks), weight(aWeight), stretch(aStretch),
weight(aWeight), stretch(aStretch),
size(aSize), sizeAdjust(aSizeAdjust),
language(aLanguage),
languageOverride(ParseFontLanguageOverride(aLanguageOverride))
@ -2904,7 +2903,7 @@ gfxFontStyle::gfxFontStyle(PRUint8 aStyle, PRUint16 aWeight, PRInt16 aStretch,
gfxFontStyle::gfxFontStyle(const gfxFontStyle& aStyle) :
style(aStyle.style), systemFont(aStyle.systemFont), printerFont(aStyle.printerFont),
familyNameQuirks(aStyle.familyNameQuirks), weight(aStyle.weight),
weight(aStyle.weight),
stretch(aStyle.stretch), size(aStyle.size),
sizeAdjust(aStyle.sizeAdjust),
language(aStyle.language),

Просмотреть файл

@ -111,7 +111,6 @@ struct THEBES_API gfxFontStyle {
gfxFontStyle(PRUint8 aStyle, PRUint16 aWeight, PRInt16 aStretch,
gfxFloat aSize, nsIAtom *aLanguage,
float aSizeAdjust, PRPackedBool aSystemFont,
PRPackedBool aFamilyNameQuirks,
PRPackedBool aPrinterFont,
const nsString& aFeatureSettings,
const nsString& aLanguageOverride);
@ -128,10 +127,6 @@ struct THEBES_API gfxFontStyle {
// Say that this font is used for print or print preview.
PRPackedBool printerFont : 1;
// True if the character set quirks (for treatment of "Symbol",
// "Wingdings", etc.) should be applied.
PRPackedBool familyNameQuirks : 1;
// The weight of the font: 100, 200, ... 900.
PRUint16 weight;
@ -177,8 +172,8 @@ struct THEBES_API gfxFontStyle {
}
PLDHashNumber Hash() const {
return ((style + (systemFont << 7) + (familyNameQuirks << 8) +
(weight << 9)) + PRUint32(size*1000) + PRUint32(sizeAdjust*1000)) ^
return ((style + (systemFont << 7) +
(weight << 8)) + PRUint32(size*1000) + PRUint32(sizeAdjust*1000)) ^
nsISupportsHashKey::HashKey(language);
}
@ -189,7 +184,6 @@ struct THEBES_API gfxFontStyle {
(style == other.style) &&
(systemFont == other.systemFont) &&
(printerFont == other.printerFont) &&
(familyNameQuirks == other.familyNameQuirks) &&
(weight == other.weight) &&
(stretch == other.stretch) &&
(language == other.language) &&

Просмотреть файл

@ -2346,7 +2346,7 @@ gfxFcFont::GetOrMakeFont(FcPattern *aRequestedPattern, FcPattern *aFontPattern)
// FIXME: Pass a real stretch based on renderPattern!
gfxFontStyle fontStyle(style, weight, NS_FONT_STRETCH_NORMAL,
size, language, 0.0,
PR_TRUE, PR_FALSE, PR_FALSE,
PR_TRUE, PR_FALSE,
NS_LITERAL_STRING(""),
NS_LITERAL_STRING(""));

Просмотреть файл

@ -3434,7 +3434,7 @@ nsCSSFrameConstructor::ConstructTextFrame(const FrameConstructionData* aData,
/* static */
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindDataByInt(PRInt32 aInt,
nsIContent* aContent,
Element* aElement,
nsStyleContext* aStyleContext,
const FrameConstructionDataByInt* aDataPtr,
PRUint32 aDataLength)
@ -3446,7 +3446,7 @@ nsCSSFrameConstructor::FindDataByInt(PRInt32 aInt,
if (curData->mInt == aInt) {
const FrameConstructionData* data = &curData->mData;
if (data->mBits & FCDATA_FUNC_IS_DATA_GETTER) {
return data->mFunc.mDataGetter(aContent, aStyleContext);
return data->mFunc.mDataGetter(aElement, aStyleContext);
}
return data;
@ -3459,7 +3459,7 @@ nsCSSFrameConstructor::FindDataByInt(PRInt32 aInt,
/* static */
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindDataByTag(nsIAtom* aTag,
nsIContent* aContent,
Element* aElement,
nsStyleContext* aStyleContext,
const FrameConstructionDataByTag* aDataPtr,
PRUint32 aDataLength)
@ -3471,7 +3471,7 @@ nsCSSFrameConstructor::FindDataByTag(nsIAtom* aTag,
if (*curData->mTag == aTag) {
const FrameConstructionData* data = &curData->mData;
if (data->mBits & FCDATA_FUNC_IS_DATA_GETTER) {
return data->mFunc.mDataGetter(aContent, aStyleContext);
return data->mFunc.mDataGetter(aElement, aStyleContext);
}
return data;
@ -3497,7 +3497,7 @@ nsCSSFrameConstructor::FindDataByTag(nsIAtom* aTag,
/* static */
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindHTMLData(nsIContent* aContent,
nsCSSFrameConstructor::FindHTMLData(Element* aElement,
nsIAtom* aTag,
PRInt32 aNameSpaceID,
nsIFrame* aParentFrame,
@ -3520,9 +3520,8 @@ nsCSSFrameConstructor::FindHTMLData(nsIContent* aContent,
(aParentFrame->GetType() != nsGkAtoms::fieldSetFrame &&
aParentFrame->GetStyleContext()->GetPseudo() !=
nsCSSAnonBoxes::fieldsetContent) ||
!aContent->GetParent() ||
!aContent->GetParent()->IsHTML() ||
aContent->GetParent()->Tag() != nsGkAtoms::fieldset ||
!aElement->GetParent() ||
!aElement->GetParent()->IsHTML(nsGkAtoms::fieldset) ||
aStyleContext->GetStyleDisplay()->IsFloating() ||
aStyleContext->GetStyleDisplay()->IsAbsolutelyPositioned())) {
// <legend> is only special inside fieldset, check both the frame tree
@ -3565,16 +3564,16 @@ nsCSSFrameConstructor::FindHTMLData(nsIContent* aContent,
SIMPLE_TAG_CREATE(isindex, NS_NewIsIndexFrame)
};
return FindDataByTag(aTag, aContent, aStyleContext, sHTMLData,
return FindDataByTag(aTag, aElement, aStyleContext, sHTMLData,
NS_ARRAY_LENGTH(sHTMLData));
}
/* static */
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindImgData(nsIContent* aContent,
nsCSSFrameConstructor::FindImgData(Element* aElement,
nsStyleContext* aStyleContext)
{
if (!nsImageFrame::ShouldCreateImageFrameFor(aContent, aStyleContext)) {
if (!nsImageFrame::ShouldCreateImageFrameFor(aElement, aStyleContext)) {
return nsnull;
}
@ -3584,10 +3583,10 @@ nsCSSFrameConstructor::FindImgData(nsIContent* aContent,
/* static */
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindImgControlData(nsIContent* aContent,
nsCSSFrameConstructor::FindImgControlData(Element* aElement,
nsStyleContext* aStyleContext)
{
if (!nsImageFrame::ShouldCreateImageFrameFor(aContent, aStyleContext)) {
if (!nsImageFrame::ShouldCreateImageFrameFor(aElement, aStyleContext)) {
return nsnull;
}
@ -3598,7 +3597,7 @@ nsCSSFrameConstructor::FindImgControlData(nsIContent* aContent,
/* static */
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindInputData(nsIContent* aContent,
nsCSSFrameConstructor::FindInputData(Element* aElement,
nsStyleContext* aStyleContext)
{
static const FrameConstructionDataByInt sInputData[] = {
@ -3623,28 +3622,28 @@ nsCSSFrameConstructor::FindInputData(nsIContent* aContent,
// display (in practice, none).
};
nsCOMPtr<nsIFormControl> control = do_QueryInterface(aContent);
nsCOMPtr<nsIFormControl> control = do_QueryInterface(aElement);
NS_ASSERTION(control, "input doesn't implement nsIFormControl?");
return FindDataByInt(control->GetType(), aContent, aStyleContext,
return FindDataByInt(control->GetType(), aElement, aStyleContext,
sInputData, NS_ARRAY_LENGTH(sInputData));
}
/* static */
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindObjectData(nsIContent* aContent,
nsCSSFrameConstructor::FindObjectData(Element* aElement,
nsStyleContext* aStyleContext)
{
// GetDisplayedType isn't necessarily nsIObjectLoadingContent::TYPE_NULL for
// cases when the object is broken/suppressed/etc (e.g. a broken image), but
// we want to treat those cases as TYPE_NULL
PRUint32 type;
if (aContent->IntrinsicState().HasAtLeastOneOfStates(NS_EVENT_STATE_BROKEN |
if (aElement->IntrinsicState().HasAtLeastOneOfStates(NS_EVENT_STATE_BROKEN |
NS_EVENT_STATE_USERDISABLED |
NS_EVENT_STATE_SUPPRESSED)) {
type = nsIObjectLoadingContent::TYPE_NULL;
} else {
nsCOMPtr<nsIObjectLoadingContent> objContent(do_QueryInterface(aContent));
nsCOMPtr<nsIObjectLoadingContent> objContent(do_QueryInterface(aElement));
NS_ASSERTION(objContent,
"applet, embed and object must implement "
"nsIObjectLoadingContent!");
@ -3664,7 +3663,7 @@ nsCSSFrameConstructor::FindObjectData(nsIContent* aContent,
// Nothing for TYPE_NULL so we'll construct frames by display there
};
return FindDataByInt((PRInt32)type, aContent, aStyleContext,
return FindDataByInt((PRInt32)type, aElement, aStyleContext,
sObjectData, NS_ARRAY_LENGTH(sObjectData));
}
@ -4008,7 +4007,7 @@ nsIFrame* NS_NewGridBoxFrame(nsIPresShell* aPresShell,
/* static */
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindXULTagData(nsIContent* aContent,
nsCSSFrameConstructor::FindXULTagData(Element* aElement,
nsIAtom* aTag,
PRInt32 aNameSpaceID,
nsStyleContext* aStyleContext)
@ -4056,17 +4055,17 @@ nsCSSFrameConstructor::FindXULTagData(nsIContent* aContent,
SIMPLE_XUL_CREATE(scrollbarbutton, NS_NewScrollbarButtonFrame)
};
return FindDataByTag(aTag, aContent, aStyleContext, sXULTagData,
return FindDataByTag(aTag, aElement, aStyleContext, sXULTagData,
NS_ARRAY_LENGTH(sXULTagData));
}
#ifdef MOZ_XUL
/* static */
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindPopupGroupData(nsIContent* aContent,
nsCSSFrameConstructor::FindPopupGroupData(Element* aElement,
nsStyleContext* /* unused */)
{
if (!aContent->IsRootOfNativeAnonymousSubtree()) {
if (!aElement->IsRootOfNativeAnonymousSubtree()) {
return nsnull;
}
@ -4081,10 +4080,10 @@ nsCSSFrameConstructor::sXULTextBoxData = SIMPLE_XUL_FCDATA(NS_NewTextBoxFrame);
/* static */
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindXULLabelData(nsIContent* aContent,
nsCSSFrameConstructor::FindXULLabelData(Element* aElement,
nsStyleContext* /* unused */)
{
if (aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::value)) {
if (aElement->HasAttr(kNameSpaceID_None, nsGkAtoms::value)) {
return &sXULTextBoxData;
}
@ -4104,10 +4103,10 @@ NS_NewXULDescriptionFrame(nsIPresShell* aPresShell, nsStyleContext *aContext)
/* static */
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindXULDescriptionData(nsIContent* aContent,
nsCSSFrameConstructor::FindXULDescriptionData(Element* aElement,
nsStyleContext* /* unused */)
{
if (aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::value)) {
if (aElement->HasAttr(kNameSpaceID_None, nsGkAtoms::value)) {
return &sXULTextBoxData;
}
@ -4119,7 +4118,7 @@ nsCSSFrameConstructor::FindXULDescriptionData(nsIContent* aContent,
#ifdef XP_MACOSX
/* static */
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindXULMenubarData(nsIContent* aContent,
nsCSSFrameConstructor::FindXULMenubarData(Element* aElement,
nsStyleContext* aStyleContext)
{
nsCOMPtr<nsISupports> container =
@ -4150,7 +4149,7 @@ nsCSSFrameConstructor::FindXULMenubarData(nsIContent* aContent,
/* static */
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindXULListBoxBodyData(nsIContent* aContent,
nsCSSFrameConstructor::FindXULListBoxBodyData(Element* aElement,
nsStyleContext* aStyleContext)
{
if (aStyleContext->GetStyleDisplay()->mDisplay !=
@ -4165,7 +4164,7 @@ nsCSSFrameConstructor::FindXULListBoxBodyData(nsIContent* aContent,
/* static */
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindXULListItemData(nsIContent* aContent,
nsCSSFrameConstructor::FindXULListItemData(Element* aElement,
nsStyleContext* aStyleContext)
{
if (aStyleContext->GetStyleDisplay()->mDisplay !=
@ -4183,7 +4182,7 @@ nsCSSFrameConstructor::FindXULListItemData(nsIContent* aContent,
/* static */
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindXULDisplayData(const nsStyleDisplay* aDisplay,
nsIContent* aContent,
Element* aElement,
nsStyleContext* aStyleContext)
{
static const FrameConstructionDataByInt sXULDisplayData[] = {
@ -4207,7 +4206,7 @@ nsCSSFrameConstructor::FindXULDisplayData(const nsStyleDisplay* aDisplay,
};
// Processing by display here:
return FindDataByInt(aDisplay->mDisplay, aContent, aStyleContext,
return FindDataByInt(aDisplay->mDisplay, aElement, aStyleContext,
sXULDisplayData, NS_ARRAY_LENGTH(sXULDisplayData));
}
@ -4327,7 +4326,7 @@ nsCSSFrameConstructor::BuildScrollFrame(nsFrameConstructorState& aState,
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindDisplayData(const nsStyleDisplay* aDisplay,
nsIContent* aContent,
Element* aElement,
nsStyleContext* aStyleContext)
{
PR_STATIC_ASSERT(eParentTypeCount < (1 << (32 - FCDATA_PARENT_TYPE_OFFSET)));
@ -4346,10 +4345,9 @@ nsCSSFrameConstructor::FindDisplayData(const nsStyleDisplay* aDisplay,
// XXXbz is this the right place to do this? If this code moves,
// make this function static.
PRBool propagatedScrollToViewport = PR_FALSE;
if (aContent->NodeInfo()->Equals(nsGkAtoms::body) &&
aContent->IsHTML()) {
if (aElement->IsHTML(nsGkAtoms::body)) {
propagatedScrollToViewport =
PropagateScrollToViewport() == aContent;
PropagateScrollToViewport() == aElement;
}
NS_ASSERTION(!propagatedScrollToViewport ||
@ -4369,7 +4367,7 @@ nsCSSFrameConstructor::FindDisplayData(const nsStyleDisplay* aDisplay,
// anonymous stuff.
if (mPresShell->GetPresContext()->IsPaginated() &&
aDisplay->IsBlockOutside() &&
!aContent->IsInNativeAnonymousSubtree()) {
!aElement->IsInNativeAnonymousSubtree()) {
static const FrameConstructionData sForcedNonScrollableBlockData =
FULL_CTOR_FCDATA(FCDATA_FORCED_NON_SCROLLABLE_BLOCK,
&nsCSSFrameConstructor::ConstructNonScrollableBlock);
@ -4444,7 +4442,7 @@ nsCSSFrameConstructor::FindDisplayData(const nsStyleDisplay* aDisplay,
&nsCSSFrameConstructor::ConstructTableCell) }
};
return FindDataByInt(aDisplay->mDisplay, aContent, aStyleContext,
return FindDataByInt(aDisplay->mDisplay, aElement, aStyleContext,
sDisplayData, NS_ARRAY_LENGTH(sDisplayData));
}
@ -4654,7 +4652,7 @@ nsCSSFrameConstructor::FlushAccumulatedBlock(nsFrameConstructorState& aState,
/* static */
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindMathMLData(nsIContent* aContent,
nsCSSFrameConstructor::FindMathMLData(Element* aElement,
nsIAtom* aTag,
PRInt32 aNameSpaceID,
nsStyleContext* aStyleContext)
@ -4715,7 +4713,7 @@ nsCSSFrameConstructor::FindMathMLData(nsIContent* aContent,
SIMPLE_MATHML_CREATE(semantics_, NS_NewMathMLsemanticsFrame)
};
return FindDataByTag(aTag, aContent, aStyleContext, sMathMLData,
return FindDataByTag(aTag, aElement, aStyleContext, sMathMLData,
NS_ARRAY_LENGTH(sMathMLData));
}
#endif // MOZ_MATHML
@ -4731,7 +4729,7 @@ nsCSSFrameConstructor::FindMathMLData(nsIContent* aContent,
/* static */
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindSVGData(nsIContent* aContent,
nsCSSFrameConstructor::FindSVGData(Element* aElement,
nsIAtom* aTag,
PRInt32 aNameSpaceID,
nsIFrame* aParentFrame,
@ -4789,7 +4787,7 @@ nsCSSFrameConstructor::FindSVGData(nsIContent* aContent,
}
// We don't need frames for animation elements
if (aContent->IsNodeOfType(nsINode::eANIMATION)) {
if (aElement->IsNodeOfType(nsINode::eANIMATION)) {
return &sSuppressData;
}
@ -4807,7 +4805,7 @@ nsCSSFrameConstructor::FindSVGData(nsIContent* aContent,
return &sOuterSVGData;
}
if (!nsSVGFeatures::PassesConditionalProcessingTests(aContent)) {
if (!nsSVGFeatures::PassesConditionalProcessingTests(aElement)) {
// Elements with failing conditional processing attributes never get
// rendered. Note that this is not where we select which frame in a
// <switch> to render! That happens in nsSVGSwitchFrame::PaintSVG.
@ -4892,7 +4890,7 @@ nsCSSFrameConstructor::FindSVGData(nsIContent* aContent,
};
const FrameConstructionData* data =
FindDataByTag(aTag, aContent, aStyleContext, sSVGData,
FindDataByTag(aTag, aElement, aStyleContext, sSVGData,
NS_ARRAY_LENGTH(sSVGData));
if (!data) {
@ -5091,6 +5089,10 @@ nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState
PRUint32 aFlags,
FrameConstructionItemList& aItems)
{
NS_PRECONDITION(aContent->IsNodeOfType(nsINode::eTEXT) ||
aContent->IsElement(),
"Shouldn't get anything else here!");
// The following code allows the user to specify the base tag
// of an element using XBL. XUL and HTML objects (like boxes, menus, etc.)
// can then be extended arbitrarily.
@ -5144,7 +5146,7 @@ nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState
return;
}
PRBool isText = aContent->IsNodeOfType(nsINode::eTEXT);
PRBool isText = !aContent->IsElement();
// never create frames for non-option/optgroup kids of <select> and
// non-option kids of <optgroup> inside a <select>.
@ -5181,46 +5183,48 @@ nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState
return;
}
} else {
Element* element = aContent->AsElement();
// Don't create frames for non-SVG element children of SVG elements.
if (aNameSpaceID != kNameSpaceID_SVG &&
aParentFrame &&
aParentFrame->IsFrameOfType(nsIFrame::eSVG) &&
!aParentFrame->IsFrameOfType(nsIFrame::eSVGForeignObject)
) {
SetAsUndisplayedContent(aState.mFrameManager, aContent, styleContext,
SetAsUndisplayedContent(aState.mFrameManager, element, styleContext,
isGeneratedContent);
return;
}
data = FindHTMLData(aContent, aTag, aNameSpaceID, aParentFrame,
data = FindHTMLData(element, aTag, aNameSpaceID, aParentFrame,
styleContext);
if (!data) {
data = FindXULTagData(aContent, aTag, aNameSpaceID, styleContext);
data = FindXULTagData(element, aTag, aNameSpaceID, styleContext);
}
#ifdef MOZ_MATHML
if (!data) {
data = FindMathMLData(aContent, aTag, aNameSpaceID, styleContext);
data = FindMathMLData(element, aTag, aNameSpaceID, styleContext);
}
#endif
if (!data) {
data = FindSVGData(aContent, aTag, aNameSpaceID, aParentFrame,
data = FindSVGData(element, aTag, aNameSpaceID, aParentFrame,
styleContext);
}
// Now check for XUL display types
if (!data) {
data = FindXULDisplayData(display, aContent, styleContext);
data = FindXULDisplayData(display, element, styleContext);
}
// And general display types
if (!data) {
data = FindDisplayData(display, aContent, styleContext);
data = FindDisplayData(display, element, styleContext);
}
NS_ASSERTION(data, "Should have frame construction data now");
if (data->mBits & FCDATA_SUPPRESS_FRAME) {
SetAsUndisplayedContent(aState.mFrameManager, aContent, styleContext,
SetAsUndisplayedContent(aState.mFrameManager, element, styleContext,
isGeneratedContent);
return;
}
@ -5231,7 +5235,7 @@ nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState
aParentFrame->GetType() != nsGkAtoms::menuFrame)) {
if (!aState.mPopupItems.containingBlock &&
!aState.mHavePendingPopupgroup) {
SetAsUndisplayedContent(aState.mFrameManager, aContent, styleContext,
SetAsUndisplayedContent(aState.mFrameManager, element, styleContext,
isGeneratedContent);
return;
}
@ -8879,8 +8883,7 @@ nsCSSFrameConstructor::GetInsertionPoint(nsIFrame* aParentFrame,
// have to look at insertionElement here...
if (aMultiple && !*aMultiple) {
nsIContent* content = insertionElement ? insertionElement : container;
if (content->IsHTML() &&
content->Tag() == nsGkAtoms::fieldset) {
if (content->IsHTML(nsGkAtoms::fieldset)) {
*aMultiple = PR_TRUE;
}
}
@ -10942,7 +10945,7 @@ nsCSSFrameConstructor::BuildInlineChildItems(nsFrameConstructorState& aState,
for (ChildIterator::Init(parentContent, &iter, &last);
iter != last;
++iter) {
// Manually check for comments/PIs, since we do't have a frame to pass to
// Manually check for comments/PIs, since we don't have a frame to pass to
// AddFrameConstructionItems. We know our parent is a non-replaced inline,
// so there is no need to do the NeedFrameFor check.
nsIContent* content = *iter;

Просмотреть файл

@ -623,7 +623,7 @@ private:
*/
struct FrameConstructionData;
typedef const FrameConstructionData*
(* FrameConstructionDataGetter)(nsIContent*, nsStyleContext*);
(* FrameConstructionDataGetter)(Element*, nsStyleContext*);
/* A constructor function that's used for complicated construction tasks.
This is expected to create the new frame, initialize it, add whatever
@ -787,7 +787,7 @@ private:
match or if the matching integer has a FrameConstructionDataGetter that
returns null. */
static const FrameConstructionData*
FindDataByInt(PRInt32 aInt, nsIContent* aContent,
FindDataByInt(PRInt32 aInt, Element* aElement,
nsStyleContext* aStyleContext,
const FrameConstructionDataByInt* aDataPtr,
PRUint32 aDataLength);
@ -798,7 +798,7 @@ private:
match or if the matching tag has a FrameConstructionDataGetter that
returns null. */
static const FrameConstructionData*
FindDataByTag(nsIAtom* aTag, nsIContent* aContent,
FindDataByTag(nsIAtom* aTag, Element* aElement,
nsStyleContext* aStyleContext,
const FrameConstructionDataByTag* aDataPtr,
PRUint32 aDataLength);
@ -1194,24 +1194,24 @@ private:
nsStyleContext* aMainStyleContext,
FrameConstructionItemList& aItems);
// Function to find FrameConstructionData for aContent. Will return
// null if aContent is not HTML.
// Function to find FrameConstructionData for aElement. Will return
// null if aElement is not HTML.
// aParentFrame might be null. If it is, that means it was an
// inline frame.
static const FrameConstructionData* FindHTMLData(nsIContent* aContent,
static const FrameConstructionData* FindHTMLData(Element* aContent,
nsIAtom* aTag,
PRInt32 aNameSpaceID,
nsIFrame* aParentFrame,
nsStyleContext* aStyleContext);
// HTML data-finding helper functions
static const FrameConstructionData*
FindImgData(nsIContent* aContent, nsStyleContext* aStyleContext);
FindImgData(Element* aElement, nsStyleContext* aStyleContext);
static const FrameConstructionData*
FindImgControlData(nsIContent* aContent, nsStyleContext* aStyleContext);
FindImgControlData(Element* aElement, nsStyleContext* aStyleContext);
static const FrameConstructionData*
FindInputData(nsIContent* aContent, nsStyleContext* aStyleContext);
FindInputData(Element* aElement, nsStyleContext* aStyleContext);
static const FrameConstructionData*
FindObjectData(nsIContent* aContent, nsStyleContext* aStyleContext);
FindObjectData(Element* aElement, nsStyleContext* aStyleContext);
/* Construct a frame from the given FrameConstructionItem. This function
will handle adding the frame to frame lists, processing children, setting
@ -1289,7 +1289,7 @@ private:
// Function to find FrameConstructionData for aContent. Will return
// null if aContent is not MathML.
static const FrameConstructionData* FindMathMLData(nsIContent* aContent,
static const FrameConstructionData* FindMathMLData(Element* aElement,
nsIAtom* aTag,
PRInt32 aNameSpaceID,
nsStyleContext* aStyleContext);
@ -1297,28 +1297,28 @@ private:
// Function to find FrameConstructionData for aContent. Will return
// null if aContent is not XUL.
static const FrameConstructionData* FindXULTagData(nsIContent* aContent,
static const FrameConstructionData* FindXULTagData(Element* aElement,
nsIAtom* aTag,
PRInt32 aNameSpaceID,
nsStyleContext* aStyleContext);
// XUL data-finding helper functions and structures
#ifdef MOZ_XUL
static const FrameConstructionData*
FindPopupGroupData(nsIContent* aContent, nsStyleContext* aStyleContext);
FindPopupGroupData(Element* aElement, nsStyleContext* aStyleContext);
// sXULTextBoxData used for both labels and descriptions
static const FrameConstructionData sXULTextBoxData;
static const FrameConstructionData*
FindXULLabelData(nsIContent* aContent, nsStyleContext* aStyleContext);
FindXULLabelData(Element* aElement, nsStyleContext* aStyleContext);
static const FrameConstructionData*
FindXULDescriptionData(nsIContent* aContent, nsStyleContext* aStyleContext);
FindXULDescriptionData(Element* aElement, nsStyleContext* aStyleContext);
#ifdef XP_MACOSX
static const FrameConstructionData*
FindXULMenubarData(nsIContent* aContent, nsStyleContext* aStyleContext);
FindXULMenubarData(Element* aElement, nsStyleContext* aStyleContext);
#endif /* XP_MACOSX */
static const FrameConstructionData*
FindXULListBoxBodyData(nsIContent* aContent, nsStyleContext* aStyleContext);
FindXULListBoxBodyData(Element* aElement, nsStyleContext* aStyleContext);
static const FrameConstructionData*
FindXULListItemData(nsIContent* aContent, nsStyleContext* aStyleContext);
FindXULListItemData(Element* aElement, nsStyleContext* aStyleContext);
#endif /* MOZ_XUL */
// Function to find FrameConstructionData for aContent using one of the XUL
@ -1328,12 +1328,12 @@ private:
// constructed by tag.
static const FrameConstructionData*
FindXULDisplayData(const nsStyleDisplay* aDisplay,
nsIContent* aContent,
Element* aElement,
nsStyleContext* aStyleContext);
// SVG - rods
#ifdef MOZ_SVG
static const FrameConstructionData* FindSVGData(nsIContent* aContent,
static const FrameConstructionData* FindSVGData(Element* aElement,
nsIAtom* aTag,
PRInt32 aNameSpaceID,
nsIFrame* aParentFrame,
@ -1350,7 +1350,7 @@ private:
/* Not static because it does PropagateScrollToViewport. If this
changes, make this static */
const FrameConstructionData*
FindDisplayData(const nsStyleDisplay* aDisplay, nsIContent* aContent,
FindDisplayData(const nsStyleDisplay* aDisplay, Element* aElement,
nsStyleContext* aStyleContext);
/**

Просмотреть файл

@ -2074,14 +2074,17 @@ nsCSSRendering::PaintGradient(nsPresContext* aPresContext,
// multiplying by stopScale.
double stopScale;
double stopDelta = lastStop - firstStop;
if (stopDelta < 1e-6 || lineLength < 1e-6 ||
(aGradient->mShape != NS_STYLE_GRADIENT_SHAPE_LINEAR &&
(radiusX < 1e-6 || radiusY < 1e-6))) {
PRBool zeroRadius = aGradient->mShape != NS_STYLE_GRADIENT_SHAPE_LINEAR &&
(radiusX < 1e-6 || radiusY < 1e-6);
if (stopDelta < 1e-6 || lineLength < 1e-6 || zeroRadius) {
// Stops are all at the same place. Map all stops to 0.0.
// For radial gradients we need to fill with the last stop color,
// so just set both radii to 0.
// For repeating radial gradients, or for any radial gradients with
// a zero radius, we need to fill with the last stop color, so just set
// both radii to 0.
stopScale = 0.0;
radiusX = radiusY = 0.0;
if (aGradient->mRepeating || zeroRadius) {
radiusX = radiusY = 0.0;
}
lastStop = firstStop;
} else {
stopScale = 1.0/stopDelta;
@ -2115,6 +2118,11 @@ nsCSSRendering::PaintGradient(nsPresContext* aPresContext,
// So our radii are based on radiusX.
double innerRadius = radiusX*firstStop;
double outerRadius = radiusX*lastStop;
if (stopScale == 0.0) {
// Stops are all at the same place. See above (except we now have
// the inside vs. outside of an ellipse).
outerRadius = innerRadius + 1;
}
gradientPattern = new gfxPattern(lineStart.x, lineStart.y, innerRadius,
lineStart.x, lineStart.y, outerRadius);
if (gradientPattern && radiusX != radiusY) {
@ -2135,12 +2143,11 @@ nsCSSRendering::PaintGradient(nsPresContext* aPresContext,
// Now set normalized color stops in pattern.
if (stopScale == 0.0) {
// Non-repeating linear gradient with all stops in same place -> just add
// Non-repeating gradient with all stops in same place -> just add
// first stop and last stop, both at position 0.
// Repeating or radial gradient with all stops in the same place -> just
// paint the last stop color.
if (!aGradient->mRepeating &&
aGradient->mShape == NS_STYLE_GRADIENT_SHAPE_LINEAR) {
// Repeating gradient with all stops in the same place, or radial
// gradient with radius of 0 -> just paint the last stop color.
if (!aGradient->mRepeating && !zeroRadius) {
gradientPattern->AddColorStop(0.0, stops[0].mColor);
}
gradientPattern->AddColorStop(0.0, stops[stops.Length() - 1].mColor);

Просмотреть файл

@ -60,23 +60,31 @@ using mozilla::TimeStamp;
// Compute the interval to use for the refresh driver timer, in
// milliseconds
static PRInt32
GetRefreshTimerInterval(bool aThrottled)
PRInt32
nsRefreshDriver::GetRefreshTimerInterval() const
{
const char* prefName =
aThrottled ? "layout.throttled_frame_rate" : "layout.frame_rate";
mThrottled ? "layout.throttled_frame_rate" : "layout.frame_rate";
PRInt32 rate = nsContentUtils::GetIntPref(prefName, -1);
if (rate <= 0) {
// TODO: get the rate from the platform
rate = aThrottled ? DEFAULT_THROTTLED_FRAME_RATE : DEFAULT_FRAME_RATE;
rate = mThrottled ? DEFAULT_THROTTLED_FRAME_RATE : DEFAULT_FRAME_RATE;
}
NS_ASSERTION(rate > 0, "Must have positive rate here");
return NSToIntRound(1000.0/rate);
PRInt32 interval = NSToIntRound(1000.0/rate);
if (mThrottled) {
interval = NS_MAX(interval, mLastTimerInterval * 2);
}
mLastTimerInterval = interval;
return interval;
}
static PRInt32
GetRefreshTimerType()
PRInt32
nsRefreshDriver::GetRefreshTimerType() const
{
if (mThrottled) {
return nsITimer::TYPE_ONE_SHOT;
}
PRBool precise =
nsContentUtils::GetBoolPref("layout.frame_rate.precise", PR_FALSE);
return precise ? (PRInt32)nsITimer::TYPE_REPEATING_PRECISE
@ -150,7 +158,7 @@ nsRefreshDriver::EnsureTimerStarted()
}
nsresult rv = mTimer->InitWithCallback(this,
GetRefreshTimerInterval(mThrottled),
GetRefreshTimerInterval(),
GetRefreshTimerType());
if (NS_FAILED(rv)) {
mTimer = nsnull;
@ -330,6 +338,16 @@ nsRefreshDriver::Notify(nsITimer * /* unused */)
}
}
if (mThrottled) {
// Stop the timer now and restart it here. Stopping is ok because either
// it's already one-shot, and it just fired, and all we need to do is null
// it out, or it's repeating and we need to reset it to be one-shot. Note
// that the EnsureTimerStarted() call here is ok because EnsureTimerStarted
// makes sure to not start the timer if it shouldn't be started.
StopTimer();
EnsureTimerStarted();
}
return NS_OK;
}
@ -358,10 +376,10 @@ nsRefreshDriver::SetThrottled(bool aThrottled)
if (aThrottled != mThrottled) {
mThrottled = aThrottled;
if (mTimer) {
// Stopping and restarting the timer would update our most recent refresh
// time, which isn't quite right. Luckily, we can just reschedule the
// timer.
mTimer->SetDelay(GetRefreshTimerInterval(mThrottled));
// We want to switch our timer type here, so just stop and
// restart the timer.
StopTimer();
EnsureTimerStarted();
}
}
}

Просмотреть файл

@ -218,6 +218,9 @@ private:
// Trigger a refresh immediately, if haven't been disconnected or frozen.
void DoRefresh();
PRInt32 GetRefreshTimerInterval() const;
PRInt32 GetRefreshTimerType() const;
nsCOMPtr<nsITimer> mTimer;
mozilla::TimeStamp mMostRecentRefresh; // only valid when mTimer non-null
PRInt64 mMostRecentRefreshEpochTime; // same thing as mMostRecentRefresh,
@ -237,6 +240,10 @@ private:
nsTArray<nsIDocument*> mBeforePaintTargets;
// nsTArray on purpose, because we want to be able to swap.
nsTArray<nsIDocument*> mAnimationFrameListenerDocs;
// This is the last interval we used for our timer. May be 0 if we
// haven't computed a timer interval yet.
mutable PRInt32 mLastTimerInterval;
};
#endif /* !defined(nsRefreshDriver_h_) */

Просмотреть файл

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<script>
function boom()
{
var frame = document.getElementById("f");
var frameDoc = frame.contentDocument;
frameDoc.getElementById("g").style.background = "yellow";
frame.style.cssFloat = "right";
document.documentElement.offsetHeight;
frameDoc.documentElement.style.color = "green";
}
</script>
</head>
<body onload="boom();"><iframe id="f" src="data:text/html,<!DOCTYPE html><frameset><frame id=g></frameset>"></iframe></body>
</html>

Просмотреть файл

@ -352,3 +352,4 @@ load 603510-1.html
load 604314-1.html
load 604843.html
load 605340.html
load 621841-1.html

Просмотреть файл

@ -365,15 +365,24 @@ nsHTMLFramesetFrame::Init(nsIContent* aContent,
for (PRUint32 childX = 0; childX < numChildren; childX++) {
if (mChildCount == numCells) { // we have more <frame> or <frameset> than cells
// Clear the lazy bits in the remaining children.
// Clear the lazy bits in the remaining children. Also clear
// the restyle flags, like nsCSSFrameConstructor::ProcessChildren does.
for (PRUint32 i = childX; i < numChildren; i++) {
mContent->GetChildAt(i)->UnsetFlags(NODE_DESCENDANTS_NEED_FRAMES |
NODE_NEEDS_FRAME);
nsIContent *child = mContent->GetChildAt(i);
child->UnsetFlags(NODE_DESCENDANTS_NEED_FRAMES | NODE_NEEDS_FRAME);
if (child->IsElement()) {
child->UnsetFlags(ELEMENT_ALL_RESTYLE_FLAGS);
}
}
break;
}
nsIContent *child = mContent->GetChildAt(childX);
child->UnsetFlags(NODE_DESCENDANTS_NEED_FRAMES | NODE_NEEDS_FRAME);
// Also clear the restyle flags in the child like
// nsCSSFrameConstructor::ProcessChildren does.
if (child->IsElement()) {
child->UnsetFlags(ELEMENT_ALL_RESTYLE_FLAGS);
}
// IMPORTANT: This must match the conditions in
// nsCSSFrameConstructor::ContentAppended/Inserted/Removed

Просмотреть файл

@ -2597,12 +2597,12 @@ nsGfxScrollFrameInner::AsyncScrollPortEvent::Run()
}
PRBool
nsXULScrollFrame::AddHorizontalScrollbar(nsBoxLayoutState& aState, PRBool aOnTop)
nsXULScrollFrame::AddHorizontalScrollbar(nsBoxLayoutState& aState, PRBool aOnBottom)
{
if (!mInner.mHScrollbarBox)
return PR_TRUE;
return AddRemoveScrollbar(aState, aOnTop, PR_TRUE, PR_TRUE);
return AddRemoveScrollbar(aState, aOnBottom, PR_TRUE, PR_TRUE);
}
PRBool
@ -2615,13 +2615,13 @@ nsXULScrollFrame::AddVerticalScrollbar(nsBoxLayoutState& aState, PRBool aOnRight
}
void
nsXULScrollFrame::RemoveHorizontalScrollbar(nsBoxLayoutState& aState, PRBool aOnTop)
nsXULScrollFrame::RemoveHorizontalScrollbar(nsBoxLayoutState& aState, PRBool aOnBottom)
{
// removing a scrollbar should always fit
#ifdef DEBUG
PRBool result =
#endif
AddRemoveScrollbar(aState, aOnTop, PR_TRUE, PR_FALSE);
AddRemoveScrollbar(aState, aOnBottom, PR_TRUE, PR_FALSE);
NS_ASSERTION(result, "Removing horizontal scrollbar failed to fit??");
}
@ -2638,7 +2638,7 @@ nsXULScrollFrame::RemoveVerticalScrollbar(nsBoxLayoutState& aState, PRBool aOnRi
PRBool
nsXULScrollFrame::AddRemoveScrollbar(nsBoxLayoutState& aState,
PRBool aOnTop, PRBool aHorizontal, PRBool aAdd)
PRBool aOnRightOrBottom, PRBool aHorizontal, PRBool aAdd)
{
if (aHorizontal) {
if (mInner.mNeverHasHorizontalScrollbar || !mInner.mHScrollbarBox)
@ -2653,7 +2653,7 @@ nsXULScrollFrame::AddRemoveScrollbar(nsBoxLayoutState& aState,
PRBool fit = AddRemoveScrollbar(hasHorizontalScrollbar,
mInner.mScrollPort.y,
mInner.mScrollPort.height,
hSize.height, aOnTop, aAdd);
hSize.height, aOnRightOrBottom, aAdd);
mInner.mHasHorizontalScrollbar = hasHorizontalScrollbar; // because mHasHorizontalScrollbar is a PRPackedBool
if (!fit)
mInner.SetScrollbarVisibility(mInner.mHScrollbarBox, !aAdd);
@ -2672,7 +2672,7 @@ nsXULScrollFrame::AddRemoveScrollbar(nsBoxLayoutState& aState,
PRBool fit = AddRemoveScrollbar(hasVerticalScrollbar,
mInner.mScrollPort.x,
mInner.mScrollPort.width,
vSize.width, aOnTop, aAdd);
vSize.width, aOnRightOrBottom, aAdd);
mInner.mHasVerticalScrollbar = hasVerticalScrollbar; // because mHasVerticalScrollbar is a PRPackedBool
if (!fit)
mInner.SetScrollbarVisibility(mInner.mVScrollbarBox, !aAdd);
@ -2684,7 +2684,7 @@ nsXULScrollFrame::AddRemoveScrollbar(nsBoxLayoutState& aState,
PRBool
nsXULScrollFrame::AddRemoveScrollbar(PRBool& aHasScrollbar, nscoord& aXY,
nscoord& aSize, nscoord aSbSize,
PRBool aRightOrBottom, PRBool aAdd)
PRBool aOnRightOrBottom, PRBool aAdd)
{
nscoord size = aSize;
nscoord xy = aXY;
@ -2692,11 +2692,11 @@ nsXULScrollFrame::AddRemoveScrollbar(PRBool& aHasScrollbar, nscoord& aXY,
if (size != NS_INTRINSICSIZE) {
if (aAdd) {
size -= aSbSize;
if (!aRightOrBottom && size >= 0)
if (!aOnRightOrBottom && size >= 0)
xy += aSbSize;
} else {
size += aSbSize;
if (!aRightOrBottom)
if (!aOnRightOrBottom)
xy -= aSbSize;
}
}

Просмотреть файл

@ -653,7 +653,7 @@ public:
PRBool aAdd);
PRBool AddRemoveScrollbar(nsBoxLayoutState& aState,
PRBool aOnTop,
PRBool aOnRightOrBottom,
PRBool aHorizontal,
PRBool aAdd);

Просмотреть файл

@ -1313,32 +1313,50 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsPresContext* aPresContext,
PRBool marginRightIsAuto =
eStyleUnit_Auto == mStyleMargin->mMargin.GetRightUnit();
if (availMarginSpace < 0 ||
(!marginLeftIsAuto && !marginRightIsAuto)) {
// We're over-constrained so use the direction of the containing block
// to dictate which value to ignore. (And note that the spec says to ignore
// 'left' or 'right' rather than 'margin-left' or 'margin-right'.)
if (cbrs &&
NS_STYLE_DIRECTION_RTL == cbrs->mStyleVisibility->mDirection) {
// Ignore the specified value for 'left'.
mComputedOffsets.left += availMarginSpace;
} else {
// Ignore the specified value for 'right'.
mComputedOffsets.right += availMarginSpace;
}
} else if (marginLeftIsAuto) {
if (marginLeftIsAuto) {
if (marginRightIsAuto) {
// Both 'margin-left' and 'margin-right' are 'auto', so they get
// equal values
mComputedMargin.left = availMarginSpace / 2;
mComputedMargin.right = availMarginSpace - mComputedMargin.left;
if (availMarginSpace < 0) {
// Note that this case is different from the neither-'auto'
// case below, where the spec says to ignore 'left'/'right'.
if (cbrs &&
NS_STYLE_DIRECTION_RTL == cbrs->mStyleVisibility->mDirection) {
// Ignore the specified value for 'margin-left'.
mComputedMargin.left = availMarginSpace;
} else {
// Ignore the specified value for 'margin-right'.
mComputedMargin.right = availMarginSpace;
}
} else {
// Both 'margin-left' and 'margin-right' are 'auto', so they get
// equal values
mComputedMargin.left = availMarginSpace / 2;
mComputedMargin.right = availMarginSpace - mComputedMargin.left;
}
} else {
// Just 'margin-left' is 'auto'
mComputedMargin.left = availMarginSpace;
}
} else {
// Just 'margin-right' is 'auto'
mComputedMargin.right = availMarginSpace;
if (marginRightIsAuto) {
// Just 'margin-right' is 'auto'
mComputedMargin.right = availMarginSpace;
} else {
// We're over-constrained so use the direction of the containing
// block to dictate which value to ignore. (And note that the
// spec says to ignore 'left' or 'right' rather than
// 'margin-left' or 'margin-right'.)
// Note that this case is different from the both-'auto' case
// above, where the spec says to ignore
// 'margin-left'/'margin-right'.
if (cbrs &&
NS_STYLE_DIRECTION_RTL == cbrs->mStyleVisibility->mDirection) {
// Ignore the specified value for 'left'.
mComputedOffsets.left += availMarginSpace;
} else {
// Ignore the specified value for 'right'.
mComputedOffsets.right += availMarginSpace;
}
}
}
}
@ -1392,24 +1410,31 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsPresContext* aPresContext,
PRBool marginBottomIsAuto =
eStyleUnit_Auto == mStyleMargin->mMargin.GetBottomUnit();
if (availMarginSpace < 0 || (!marginTopIsAuto && !marginBottomIsAuto)) {
// We're over-constrained so ignore the specified value for
// 'bottom'. (And note that the spec says to ignore 'bottom'
// rather than 'margin-bottom'.)
mComputedOffsets.bottom += availMarginSpace;
} else if (marginTopIsAuto) {
if (marginTopIsAuto) {
if (marginBottomIsAuto) {
// Both 'margin-top' and 'margin-bottom' are 'auto', so they get
// equal values
mComputedMargin.top = availMarginSpace / 2;
mComputedMargin.bottom = availMarginSpace - mComputedMargin.top;
if (availMarginSpace < 0) {
// FIXME: Note that the spec doesn't actually say we should do this!
mComputedMargin.bottom = availMarginSpace;
} else {
// Both 'margin-top' and 'margin-bottom' are 'auto', so they get
// equal values
mComputedMargin.top = availMarginSpace / 2;
mComputedMargin.bottom = availMarginSpace - mComputedMargin.top;
}
} else {
// Just 'margin-top' is 'auto'
mComputedMargin.top = availMarginSpace;
}
} else {
// Just 'margin-bottom' is 'auto'
mComputedMargin.bottom = availMarginSpace;
if (marginBottomIsAuto) {
// Just 'margin-bottom' is 'auto'
mComputedMargin.bottom = availMarginSpace;
} else {
// We're over-constrained so ignore the specified value for
// 'bottom'. (And note that the spec says to ignore 'bottom'
// rather than 'margin-bottom'.)
mComputedOffsets.bottom += availMarginSpace;
}
}
}
}

Просмотреть файл

@ -11,16 +11,6 @@ div { height: 1px; background: navy; }
</head>
<body>
<!--
Differences between CSS 2.1 and this reference:
2. it ignores single 'auto' margins (one side only) when they should
become negative; this is a bug that we should fix:
https://bugzilla.mozilla.org/show_bug.cgi?id=419100
-->
<!-- ***** NARROW WIDTH ***** -->
<!-- nothing auto -->
@ -354,14 +344,13 @@ Differences between CSS 2.1 and this reference:
<div style="margin-left: -53px; width: 684px;"></div>
<div style="margin-left: -53px; width: 684px;"></div>
<!-- only margin-left auto -->
<!-- THIS SET AFFECTED BY CHANGE (2) FROM CSS 2.1 SPEC -->
<div style="margin-left: 53px; width: 684px;"></div>
<div style="margin-left: -11px; width: 684px;"></div>
<div style="margin-left: 53px; width: 684px;"></div>
<div style="margin-left: -11px; width: 684px;"></div>
<div style="margin-left: 53px; width: 684px;"></div>
<div style="margin-left: -11px; width: 684px;"></div>
<div style="margin-left: 53px; width: 684px;"></div>
<div style="margin-left: -11px; width: 684px;"></div>
<div style="margin-left: -11px; width: 684px;"></div>
<div style="margin-left: -11px; width: 684px;"></div>
<div style="margin-left: -11px; width: 684px;"></div>
<div style="margin-left: -11px; width: 684px;"></div>
<!-- left and margin-left auto -->
<div style="margin-left: -11px; width: 684px;"></div>
@ -391,15 +380,14 @@ Differences between CSS 2.1 and this reference:
<div style="margin-left: -53px; width: 684px;"></div>
<div style="margin-left: -53px; width: 684px;"></div>
<!-- only margin-right auto -->
<!-- THIS SET AFFECTED BY CHANGE (2) FROM CSS 2.1 SPEC -->
<div style="margin-left: 70px; width: 684px;"></div>
<div style="margin-left: 8px; width: 684px;"></div>
<div style="margin-left: 70px; width: 684px;"></div>
<div style="margin-left: 8px; width: 684px;"></div>
<div style="margin-left: 70px; width: 684px;"></div>
<div style="margin-left: 8px; width: 684px;"></div>
<div style="margin-left: 70px; width: 684px;"></div>
<div style="margin-left: 8px; width: 684px;"></div>
<div style="margin-left: 70px; width: 684px;"></div>
<div style="margin-left: 70px; width: 684px;"></div>
<div style="margin-left: 70px; width: 684px;"></div>
<div style="margin-left: 70px; width: 684px;"></div>
<!-- left and margin-right auto (margin-right like 0) -->
<div style="margin-left: 8px; width: 684px;"></div>
<div style="margin-left: 8px; width: 684px;"></div>

Просмотреть файл

@ -12,16 +12,6 @@ div { height: 1px; background: blue;
</head>
<body>
<!--
Differences between CSS 2.1 and this reference:
2. it ignores single 'auto' margins (one side only) when they should
become negative; this is a bug that we should fix:
https://bugzilla.mozilla.org/show_bug.cgi?id=419100
-->
<!-- ***** WIDE WIDTH ***** -->
<!-- nothing auto -->
@ -61,14 +51,13 @@ Differences between CSS 2.1 and this reference:
<div style="margin-left: -53px; width: 660px;"></div>
<div style="margin-left: -53px; width: 660px;"></div>
<!-- only margin-left auto -->
<!-- THIS SET AFFECTED BY CHANGE (2) FROM CSS 2.1 SPEC -->
<div style="margin-left: 53px; width: 660px;"></div>
<div style="margin-left: -11px; width: 660px;"></div>
<div style="margin-left: 53px; width: 660px;"></div>
<div style="margin-left: -11px; width: 660px;"></div>
<div style="margin-left: 53px; width: 660px;"></div>
<div style="margin-left: -11px; width: 660px;"></div>
<div style="margin-left: 53px; width: 660px;"></div>
<div style="margin-left: -11px; width: 660px;"></div>
<div style="margin-left: -11px; width: 660px;"></div>
<div style="margin-left: -11px; width: 660px;"></div>
<div style="margin-left: -11px; width: 660px;"></div>
<div style="margin-left: -11px; width: 660px;"></div>
<!-- left and margin-left auto -->
<div style="margin-left: -11px; width: 660px;"></div>
@ -98,15 +87,14 @@ Differences between CSS 2.1 and this reference:
<div style="margin-left: -53px; width: 660px;"></div>
<div style="margin-left: -53px; width: 660px;"></div>
<!-- only margin-right auto -->
<!-- THIS SET AFFECTED BY CHANGE (2) FROM CSS 2.1 SPEC -->
<div style="margin-left: 70px; width: 660px;"></div>
<div style="margin-left: 8px; width: 660px;"></div>
<div style="margin-left: 70px; width: 660px;"></div>
<div style="margin-left: 8px; width: 660px;"></div>
<div style="margin-left: 70px; width: 660px;"></div>
<div style="margin-left: 8px; width: 660px;"></div>
<div style="margin-left: 70px; width: 660px;"></div>
<div style="margin-left: 8px; width: 660px;"></div>
<div style="margin-left: 70px; width: 660px;"></div>
<div style="margin-left: 70px; width: 660px;"></div>
<div style="margin-left: 70px; width: 660px;"></div>
<div style="margin-left: 70px; width: 660px;"></div>
<!-- left and margin-right auto (margin-right like 0) -->
<div style="margin-left: 8px; width: 660px;"></div>
<div style="margin-left: 8px; width: 660px;"></div>
@ -504,14 +492,13 @@ Differences between CSS 2.1 and this reference:
<div style="margin-left: -53px; width: 660px;"></div>
<div style="margin-left: -53px; width: 660px;"></div>
<!-- only margin-left auto -->
<!-- THIS SET AFFECTED BY CHANGE (2) FROM CSS 2.1 SPEC -->
<div style="margin-left: 53px; width: 660px;"></div>
<div style="margin-left: -11px; width: 660px;"></div>
<div style="margin-left: 53px; width: 660px;"></div>
<div style="margin-left: -11px; width: 660px;"></div>
<div style="margin-left: 53px; width: 660px;"></div>
<div style="margin-left: -11px; width: 660px;"></div>
<div style="margin-left: 53px; width: 660px;"></div>
<div style="margin-left: -11px; width: 660px;"></div>
<div style="margin-left: -11px; width: 660px;"></div>
<div style="margin-left: -11px; width: 660px;"></div>
<div style="margin-left: -11px; width: 660px;"></div>
<div style="margin-left: -11px; width: 660px;"></div>
<!-- left and margin-left auto -->
<div style="margin-left: -11px; width: 660px;"></div>
@ -541,15 +528,14 @@ Differences between CSS 2.1 and this reference:
<div style="margin-left: -53px; width: 660px;"></div>
<div style="margin-left: -53px; width: 660px;"></div>
<!-- only margin-right auto -->
<!-- THIS SET AFFECTED BY CHANGE (2) FROM CSS 2.1 SPEC -->
<div style="margin-left: 70px; width: 660px;"></div>
<div style="margin-left: 8px; width: 660px;"></div>
<div style="margin-left: 70px; width: 660px;"></div>
<div style="margin-left: 8px; width: 660px;"></div>
<div style="margin-left: 70px; width: 660px;"></div>
<div style="margin-left: 8px; width: 660px;"></div>
<div style="margin-left: 70px; width: 660px;"></div>
<div style="margin-left: 8px; width: 660px;"></div>
<div style="margin-left: 70px; width: 660px;"></div>
<div style="margin-left: 70px; width: 660px;"></div>
<div style="margin-left: 70px; width: 660px;"></div>
<div style="margin-left: 70px; width: 660px;"></div>
<!-- left and margin-right auto (margin-right like 0) -->
<div style="margin-left: 8px; width: 660px;"></div>
<div style="margin-left: 8px; width: 660px;"></div>

Просмотреть файл

@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<title>Test for -moz-linear-gradient() with all stops at the same position</title>
<style>
div {
width: 200px;
height: 200px;
background-image: -moz-linear-gradient(left, blue 0%, blue 25%, orange 25%, orange 100%);
}
</style>
<div></div>

Просмотреть файл

@ -0,0 +1,21 @@
<!DOCTYPE HTML>
<title>Test for -moz-linear-gradient() with all stops at the same position</title>
<style>
#div1 {
float: left;
width: 50px;
height: 200px;
background: blue;
}
#div2 {
float: left;
width: 150px;
height: 200px;
background: orange;
}
</style>
<div id="div1"></div>
<div id="div2"></div>

Просмотреть файл

@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<title>Test for -moz-linear-gradient() with all stops at the same position</title>
<style>
div {
width: 200px;
height: 200px;
background-image: -moz-linear-gradient(left, blue 25%, orange 25%);
}
</style>
<div></div>

Просмотреть файл

@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<title>orange square</title>
<style>
div {
width: 200px;
height: 200px;
background: orange;
}
</style>
<div></div>

Просмотреть файл

@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<title>Test for -moz-radial-gradient() with all stops at the same position</title>
<style>
div {
width: 200px;
height: 200px;
background-image: -moz-radial-gradient(contain, blue 0%, blue 25%, orange 25%, orange 100%);
}
</style>
<div></div>

Просмотреть файл

@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<title>Test for -moz-radial-gradient() with all stops at the same position</title>
<style>
div {
width: 200px;
height: 200px;
background-image: -moz-radial-gradient(contain, blue 25%, orange 25%);
}
</style>
<div></div>

Просмотреть файл

@ -88,3 +88,9 @@ fails == aja-linear-6b.html aja-linear-6-ref.html # bug 522607
== height-dependence-1.html height-dependence-1-ref.html
fails-if(cocoaWidget) == height-dependence-2.html height-dependence-2-ref.html # bug 535007
== height-dependence-3.html height-dependence-3-ref.html
fails-if(d2d) == linear-onestopposition-1.html linear-onestopposition-1-ref.html # bug 638664
== linear-onestopposition-1.html linear-onestopposition-1-ref2.html
fails-if(d2d) fails-if(cocoaWidget) == radial-onestopposition-1.html radial-onestopposition-1-ref.html # bug 638664
== repeating-linear-onestopposition-1.html orange-square.html
== repeating-radial-onestopposition-1.html orange-square.html

Просмотреть файл

@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<title>Test for -moz-repeating-linear-gradient() with all stops at the same position</title>
<style>
div {
width: 200px;
height: 200px;
background-image: -moz-repeating-linear-gradient(left, blue 25%, orange 25%);
}
</style>
<div></div>

Просмотреть файл

@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<title>Test for -moz-repeating-radial-gradient() with all stops at the same position</title>
<style>
div {
width: 200px;
height: 200px;
background-image: -moz-repeating-radial-gradient(contain, blue 25%, orange 25%);
}
</style>
<div></div>

Просмотреть файл

@ -0,0 +1,25 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!--
from the CSS 2.1 test suite,
http://test.csswg.org/suites/css2.1/20110111/html4/at-rule-013.htm
See ../css3-namespace/LICENSE .
-->
<html>
<head>
<title>CSS Test: Ignoring at-rules inside @media blocks</title>
<link rel="author" title="L. David Baron" href="http://dbaron.org/">
<style type="text/css">
p {
color: green;
background: transparent;
}
</style>
</head>
<body>
<p>This sentence must be green.</p>
<p>This sentence must be green.</p>
<p>This sentence must be green.</p>
<p>This sentence must be green.</p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,68 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!--
from the CSS 2.1 test suite,
http://test.csswg.org/suites/css2.1/20110111/html4/at-rule-013.htm
See ../css3-namespace/LICENSE .
-->
<html>
<head>
<title>CSS Test: Ignoring at-rules inside @media blocks</title>
<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
<link rel="help" href="http://www.w3.org/TR/CSS21/syndata.html#parsing-errors">
<link rel="help" href="http://www.w3.org/TR/CSS21/media.html#at-media-rule">
<meta name="flags" content="invalid">
<meta name="assert" content="At-rules inside @media blocks are ignored up to up to the end of the block that contains the invalid at-keyword, or up to and including the next semicolon (;) or up to and including the next block ({...}), whichever comes first.">
<style type="text/css">
p {
color: red;
background: red;
}
@media all {
#semicolon { background: transparent; }
@foo ] & | # $ % test-token \
[; # { background: red; } ]
(; #semicolon { background: red; } } } } )
'; #semicolon { background: red; } } } }',
"; #semicolon { background: red; }' } } }"
;
#semicolon { color: green; }
}
@media all {
#block { background: transparent; }
@foo ] & | # $ % test-token \
[; #block { background: red; } ]
(; #block { background: red; } )
'; #block { background: red; }',
"; #block { background: red; }'"
{; #block { background: red; }
#block { background: red; } }
#block { color: green; }
}
@media all {
#eob { background: transparent; }
@import "support/import-red.css"
}
#eob {
color: green;
}
@media all {
#eob-complex { background: transparent; }
@import "support/import-red.css"
[; #eob-complex { background: red; } ]
(; #eob-complex { background: red; } )
'; #eob-complex { background: red; }',
"; #eob-complex { background: red; }'"
}
#eob-complex {
color: green;
}
</style>
</head>
<body>
<p id="semicolon">This sentence must be green.</p>
<p id="block">This sentence must be green.</p>
<p id="eob">This sentence must be green.</p>
<p id="eob-complex">This sentence must be green.</p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<style>
p { color: green; }
</style>
<style>
div { color: green; }
</style>
</head>
<body>
<p>This text should be green.</p>
<div>This text should be green.</p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<style>
p { color: red; }
[
p { color: red !important; }
p { color: red !important; }
] p { color: red !important; }
p { color: green; }
</style>
<style>
div { color: red; }
:not([)
div { color: red !important; }
div { color: red !important; }
]) div { color: red !important; }
div { color: green; }
</style>
</head>
<body>
<p>This text should be green.</p>
<div>This text should be green.</p>
</body>
</html>

Просмотреть файл

@ -1,2 +1,4 @@
== at-rule-013.html at-rule-013-ref.html
== invalid-url-handling.xhtml invalid-url-handling-ref.xhtml
== pseudo-elements-1.html pseudo-elements-1-ref.html
== invalid-attr-1.html invalid-attr-1-ref.html

Просмотреть файл

@ -190,10 +190,6 @@ nsCSSCompressedDataBlock::MapRuleInfoInto(nsRuleData *aRuleData) const
TryToStartImageLoad(*val, doc, iProp);
}
*target = *val;
if (iProp == eCSSProperty_font_family) {
// XXX Are there other things like this?
aRuleData->mFontData->mFamilyFromHTML = PR_FALSE;
}
if (nsCSSProps::PropHasFlags(iProp,
CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED) &&
ShouldIgnoreColors(aRuleData))

Просмотреть файл

@ -310,7 +310,7 @@ protected:
void SkipUntil(PRUnichar aStopSymbol);
void SkipUntilOneOf(const PRUnichar* aStopSymbolChars);
void SkipRuleSet(PRBool aInsideBraces);
PRBool SkipAtRule();
PRBool SkipAtRule(PRBool aInsideBlock);
PRBool SkipDeclaration(PRBool aCheckForBraces);
PRBool PushGroup(nsICSSGroupRule* aRule);
@ -323,8 +323,8 @@ protected:
PRBool ParseImportRule(RuleAppendFunc aAppendFunc, void* aProcessData);
PRBool GatherURL(nsString& aURL);
PRBool GatherMedia(nsMediaList* aMedia,
PRUnichar aStopSymbol);
PRBool ParseMediaQuery(PRUnichar aStopSymbol, nsMediaQuery **aQuery,
PRBool aInAtRule);
PRBool ParseMediaQuery(PRBool aInAtRule, nsMediaQuery **aQuery,
PRBool *aParsedSomething, PRBool *aHitStop);
PRBool ParseMediaQueryExpression(nsMediaQuery* aQuery);
void ProcessImport(const nsString& aURLSpec,
@ -1178,7 +1178,7 @@ CSSParserImpl::ParseMediaList(const nsSubstring& aBuffer,
// to a media query. (The main substative difference is the relative
// precedence of commas and paretheses.)
if (!GatherMedia(aMediaList, PRUnichar(0))) {
if (!GatherMedia(aMediaList, PR_FALSE)) {
aMediaList->Clear();
aMediaList->SetNonEmpty(); // don't match anything
if (!mHTMLMediaMode) {
@ -1434,7 +1434,7 @@ CSSParserImpl::NextIdent()
}
PRBool
CSSParserImpl::SkipAtRule()
CSSParserImpl::SkipAtRule(PRBool aInsideBlock)
{
for (;;) {
if (!GetToken(PR_TRUE)) {
@ -1446,6 +1446,11 @@ CSSParserImpl::SkipAtRule()
if (symbol == ';') {
break;
}
if (aInsideBlock && symbol == '}') {
// The closing } doesn't belong to us.
UngetToken();
break;
}
if (symbol == '{') {
SkipUntil('}');
break;
@ -1465,6 +1470,12 @@ PRBool
CSSParserImpl::ParseAtRule(RuleAppendFunc aAppendFunc,
void* aData)
{
// If we ever allow nested at-rules, we need to be very careful about
// the error handling rules in the CSS spec. In particular, we need
// to pass in to ParseAtRule whether we're inside a block, we need to
// ensure that all the individual at-rule parsing functions terminate
// immediately when they hit a '}', and then we need to pass whether
// we're inside a block to SkipAtRule below.
nsCSSSection newSection;
PRBool (CSSParserImpl::*parseFunc)(RuleAppendFunc, void*);
@ -1505,13 +1516,13 @@ CSSParserImpl::ParseAtRule(RuleAppendFunc aAppendFunc,
OUTPUT_ERROR();
}
// Skip over unsupported at rule, don't advance section
return SkipAtRule();
return SkipAtRule(PR_FALSE);
}
if (!(this->*parseFunc)(aAppendFunc, aData)) {
// Skip over invalid at rule, don't advance section
OUTPUT_ERROR();
return SkipAtRule();
return SkipAtRule(PR_FALSE);
}
mSection = newSection;
@ -1528,6 +1539,7 @@ CSSParserImpl::ParseCharsetRule(RuleAppendFunc aAppendFunc,
}
if (eCSSToken_String != mToken.mType) {
UngetToken();
REPORT_UNEXPECTED_TOKEN(PECharsetRuleNotString);
return PR_FALSE;
}
@ -1567,7 +1579,7 @@ CSSParserImpl::GatherURL(nsString& aURL)
}
PRBool
CSSParserImpl::ParseMediaQuery(PRUnichar aStopSymbol,
CSSParserImpl::ParseMediaQuery(PRBool aInAtRule,
nsMediaQuery **aQuery,
PRBool *aParsedSomething,
PRBool *aHitStop)
@ -1582,7 +1594,7 @@ CSSParserImpl::ParseMediaQuery(PRUnichar aStopSymbol,
if (!GetToken(PR_TRUE)) {
*aHitStop = PR_TRUE;
// expected termination by EOF
if (aStopSymbol == PRUnichar(0))
if (!aInAtRule)
return PR_TRUE;
// unexpected termination by EOF
@ -1590,8 +1602,8 @@ CSSParserImpl::ParseMediaQuery(PRUnichar aStopSymbol,
return PR_TRUE;
}
if (eCSSToken_Symbol == mToken.mType &&
mToken.mSymbol == aStopSymbol) {
if (eCSSToken_Symbol == mToken.mType && aInAtRule &&
(mToken.mSymbol == ';' || mToken.mSymbol == '{')) {
*aHitStop = PR_TRUE;
UngetToken();
return PR_TRUE;
@ -1648,7 +1660,7 @@ CSSParserImpl::ParseMediaQuery(PRUnichar aStopSymbol,
if (!GetToken(PR_TRUE)) {
*aHitStop = PR_TRUE;
// expected termination by EOF
if (aStopSymbol == PRUnichar(0))
if (!aInAtRule)
break;
// unexpected termination by EOF
@ -1656,8 +1668,8 @@ CSSParserImpl::ParseMediaQuery(PRUnichar aStopSymbol,
break;
}
if (eCSSToken_Symbol == mToken.mType &&
mToken.mSymbol == aStopSymbol) {
if (eCSSToken_Symbol == mToken.mType && aInAtRule &&
(mToken.mSymbol == ';' || mToken.mSymbol == '{')) {
*aHitStop = PR_TRUE;
UngetToken();
break;
@ -1685,22 +1697,27 @@ CSSParserImpl::ParseMediaQuery(PRUnichar aStopSymbol,
// (out-of-memory).
PRBool
CSSParserImpl::GatherMedia(nsMediaList* aMedia,
PRUnichar aStopSymbol)
PRBool aInAtRule)
{
for (;;) {
nsAutoPtr<nsMediaQuery> query;
PRBool parsedSomething, hitStop;
if (!ParseMediaQuery(aStopSymbol, getter_Transfers(query),
if (!ParseMediaQuery(aInAtRule, getter_Transfers(query),
&parsedSomething, &hitStop)) {
NS_ASSERTION(!hitStop, "should return true when hit stop");
if (NS_FAILED(mScanner.GetLowLevelError())) {
return PR_FALSE;
}
const PRUnichar stopChars[] =
{ PRUnichar(','), aStopSymbol /* may be null */, PRUnichar(0) };
SkipUntilOneOf(stopChars);
if (aInAtRule) {
const PRUnichar stopChars[] =
{ PRUnichar(','), PRUnichar('{'), PRUnichar(';'), PRUnichar(0) };
SkipUntilOneOf(stopChars);
} else {
SkipUntil(',');
}
// Rely on SkipUntilOneOf leaving mToken around as the last token read.
if (mToken.mType == eCSSToken_Symbol && mToken.mSymbol == aStopSymbol) {
if (mToken.mType == eCSSToken_Symbol && aInAtRule &&
(mToken.mSymbol == '{' || mToken.mSymbol == ';')) {
UngetToken();
hitStop = PR_TRUE;
}
@ -1883,7 +1900,7 @@ CSSParserImpl::ParseImportRule(RuleAppendFunc aAppendFunc, void* aData)
}
if (!ExpectSymbol(';', PR_TRUE)) {
if (!GatherMedia(media, ';') ||
if (!GatherMedia(media, PR_TRUE) ||
!ExpectSymbol(';', PR_TRUE)) {
REPORT_UNEXPECTED_TOKEN(PEImportUnexpected);
// don't advance section, simply ignore invalid @import
@ -1966,7 +1983,7 @@ CSSParserImpl::ParseGroupRule(nsICSSGroupRule* aRule,
break;
}
if (eCSSToken_AtKeyword == mToken.mType) {
SkipAtRule(); // group rules cannot contain @rules
SkipAtRule(PR_TRUE); // group rules cannot contain @rules
continue;
}
UngetToken();
@ -1992,7 +2009,7 @@ CSSParserImpl::ParseMediaRule(RuleAppendFunc aAppendFunc, void* aData)
return PR_FALSE;
}
if (GatherMedia(media, '{')) {
if (GatherMedia(media, PR_TRUE)) {
// XXXbz this could use better error reporting throughout the method
nsRefPtr<nsCSSMediaRule> rule(new nsCSSMediaRule());
// Append first, so when we do SetMedia() the rule
@ -3215,6 +3232,10 @@ CSSParserImpl::ParseNegatedSimpleSelector(PRInt32& aDataMask,
}
else if (mToken.IsSymbol('[')) { // [attribute
parsingStatus = ParseAttributeSelector(aDataMask, *newSel);
if (eSelectorParsingStatus_Error == parsingStatus) {
// Skip forward to the matching ']'
SkipUntil(']');
}
}
else {
// then it should be a type element or universal selector
@ -3473,6 +3494,9 @@ CSSParserImpl::ParseSelector(nsCSSSelectorList* aList,
}
else if (mToken.IsSymbol('[')) { // [attribute
parsingStatus = ParseAttributeSelector(dataMask, *selector);
if (eSelectorParsingStatus_Error == parsingStatus) {
SkipUntil(']');
}
}
else { // not a selector token, we're done
parsingStatus = eSelectorParsingStatus_Done;
@ -5677,7 +5701,7 @@ CSSParserImpl::ParseSingleValueProperty(nsCSSValue& aValue,
return ParseVariant(aValue, VARIANT_HK,
nsCSSProps::kBoxPackKTable);
case eCSSProperty_box_ordinal_group:
return ParseNonNegativeVariant(aValue, VARIANT_HI, nsnull);
return ParsePositiveNonZeroVariant(aValue, VARIANT_HI, nsnull);
#ifdef MOZ_SVG
case eCSSProperty_clip_path:
return ParseVariant(aValue, VARIANT_HUO, nsnull);

Просмотреть файл

@ -140,7 +140,6 @@ private:
};
struct nsRuleDataFont : public nsCSSFont {
PRBool mFamilyFromHTML; // Is the family from an HTML FONT element
nsRuleDataFont() {}
private:
nsRuleDataFont(const nsRuleDataFont& aOther); // NOT IMPLEMENTED

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -123,289 +123,290 @@ private:
#include "nsStyleStructList.h"
#undef STYLE_STRUCT
nsresult GetEllipseRadii(const nsStyleCorners& aRadius,
PRUint8 aFullCorner,
PRBool aIsBorder, // else outline
nsIDOMCSSValue** aValue);
// All of the property getters below return a pointer to a refcounted object
// that has just been created, but the refcount is still 0. Caller must take
// ownership.
nsresult GetOffsetWidthFor(mozilla::css::Side aSide, nsIDOMCSSValue** aValue);
nsIDOMCSSValue* GetEllipseRadii(const nsStyleCorners& aRadius,
PRUint8 aFullCorner,
PRBool aIsBorder); // else outline
nsresult GetAbsoluteOffset(mozilla::css::Side aSide, nsIDOMCSSValue** aValue);
nsIDOMCSSValue* GetOffsetWidthFor(mozilla::css::Side aSide);
nsresult GetRelativeOffset(mozilla::css::Side aSide, nsIDOMCSSValue** aValue);
nsIDOMCSSValue* GetAbsoluteOffset(mozilla::css::Side aSide);
nsresult GetStaticOffset(mozilla::css::Side aSide, nsIDOMCSSValue** aValue);
nsIDOMCSSValue* GetRelativeOffset(mozilla::css::Side aSide);
nsresult GetPaddingWidthFor(mozilla::css::Side aSide, nsIDOMCSSValue** aValue);
nsIDOMCSSValue* GetStaticOffset(mozilla::css::Side aSide);
nsresult GetBorderColorsFor(mozilla::css::Side aSide, nsIDOMCSSValue** aValue);
nsIDOMCSSValue* GetPaddingWidthFor(mozilla::css::Side aSide);
nsresult GetBorderStyleFor(mozilla::css::Side aSide, nsIDOMCSSValue** aValue);
nsIDOMCSSValue* GetBorderColorsFor(mozilla::css::Side aSide);
nsresult GetBorderWidthFor(mozilla::css::Side aSide, nsIDOMCSSValue** aValue);
nsIDOMCSSValue* GetBorderStyleFor(mozilla::css::Side aSide);
nsresult GetBorderColorFor(mozilla::css::Side aSide, nsIDOMCSSValue** aValue);
nsIDOMCSSValue* GetBorderWidthFor(mozilla::css::Side aSide);
nsresult GetMarginWidthFor(mozilla::css::Side aSide, nsIDOMCSSValue** aValue);
nsIDOMCSSValue* GetBorderColorFor(mozilla::css::Side aSide);
nsresult GetSVGPaintFor(PRBool aFill, nsIDOMCSSValue** aValue);
nsIDOMCSSValue* GetMarginWidthFor(mozilla::css::Side aSide);
nsIDOMCSSValue* GetSVGPaintFor(PRBool aFill);
PRBool GetLineHeightCoord(nscoord& aCoord);
nsresult GetCSSShadowArray(nsCSSShadowArray* aArray,
const nscolor& aDefaultColor,
PRBool aIsBoxShadow,
nsIDOMCSSValue** aValue);
nsIDOMCSSValue* GetCSSShadowArray(nsCSSShadowArray* aArray,
const nscolor& aDefaultColor,
PRBool aIsBoxShadow);
nsresult GetBackgroundList(PRUint8 nsStyleBackground::Layer::* aMember,
PRUint32 nsStyleBackground::* aCount,
const PRInt32 aTable[],
nsIDOMCSSValue** aResult);
nsIDOMCSSValue* GetBackgroundList(PRUint8 nsStyleBackground::Layer::* aMember,
PRUint32 nsStyleBackground::* aCount,
const PRInt32 aTable[]);
nsresult GetCSSGradientString(const nsStyleGradient* aGradient,
nsAString& aString);
nsresult GetImageRectString(nsIURI* aURI,
const nsStyleSides& aCropRect,
nsString& aString);
void GetCSSGradientString(const nsStyleGradient* aGradient,
nsAString& aString);
void GetImageRectString(nsIURI* aURI,
const nsStyleSides& aCropRect,
nsString& aString);
/* Properties queryable as CSSValues.
* To avoid a name conflict with nsIDOM*CSS2Properties, these are all
* DoGetXXX instead of GetXXX.
*/
nsresult DoGetAppearance(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetAppearance();
/* Box properties */
nsresult DoGetBoxAlign(nsIDOMCSSValue** aValue);
nsresult DoGetBoxDirection(nsIDOMCSSValue** aValue);
nsresult DoGetBoxFlex(nsIDOMCSSValue** aValue);
nsresult DoGetBoxOrdinalGroup(nsIDOMCSSValue** aValue);
nsresult DoGetBoxOrient(nsIDOMCSSValue** aValue);
nsresult DoGetBoxPack(nsIDOMCSSValue** aValue);
nsresult DoGetBoxSizing(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetBoxAlign();
nsIDOMCSSValue* DoGetBoxDirection();
nsIDOMCSSValue* DoGetBoxFlex();
nsIDOMCSSValue* DoGetBoxOrdinalGroup();
nsIDOMCSSValue* DoGetBoxOrient();
nsIDOMCSSValue* DoGetBoxPack();
nsIDOMCSSValue* DoGetBoxSizing();
nsresult DoGetWidth(nsIDOMCSSValue** aValue);
nsresult DoGetHeight(nsIDOMCSSValue** aValue);
nsresult DoGetMaxHeight(nsIDOMCSSValue** aValue);
nsresult DoGetMaxWidth(nsIDOMCSSValue** aValue);
nsresult DoGetMinHeight(nsIDOMCSSValue** aValue);
nsresult DoGetMinWidth(nsIDOMCSSValue** aValue);
nsresult DoGetLeft(nsIDOMCSSValue** aValue);
nsresult DoGetTop(nsIDOMCSSValue** aValue);
nsresult DoGetRight(nsIDOMCSSValue** aValue);
nsresult DoGetBottom(nsIDOMCSSValue** aValue);
nsresult DoGetStackSizing(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetWidth();
nsIDOMCSSValue* DoGetHeight();
nsIDOMCSSValue* DoGetMaxHeight();
nsIDOMCSSValue* DoGetMaxWidth();
nsIDOMCSSValue* DoGetMinHeight();
nsIDOMCSSValue* DoGetMinWidth();
nsIDOMCSSValue* DoGetLeft();
nsIDOMCSSValue* DoGetTop();
nsIDOMCSSValue* DoGetRight();
nsIDOMCSSValue* DoGetBottom();
nsIDOMCSSValue* DoGetStackSizing();
/* Font properties */
nsresult DoGetColor(nsIDOMCSSValue** aValue);
nsresult DoGetFontFamily(nsIDOMCSSValue** aValue);
nsresult DoGetMozFontFeatureSettings(nsIDOMCSSValue** aValue);
nsresult DoGetMozFontLanguageOverride(nsIDOMCSSValue** aValue);
nsresult DoGetFontSize(nsIDOMCSSValue** aValue);
nsresult DoGetFontSizeAdjust(nsIDOMCSSValue** aValue);
nsresult DoGetFontStretch(nsIDOMCSSValue** aValue);
nsresult DoGetFontStyle(nsIDOMCSSValue** aValue);
nsresult DoGetFontWeight(nsIDOMCSSValue** aValue);
nsresult DoGetFontVariant(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetColor();
nsIDOMCSSValue* DoGetFontFamily();
nsIDOMCSSValue* DoGetMozFontFeatureSettings();
nsIDOMCSSValue* DoGetMozFontLanguageOverride();
nsIDOMCSSValue* DoGetFontSize();
nsIDOMCSSValue* DoGetFontSizeAdjust();
nsIDOMCSSValue* DoGetFontStretch();
nsIDOMCSSValue* DoGetFontStyle();
nsIDOMCSSValue* DoGetFontWeight();
nsIDOMCSSValue* DoGetFontVariant();
/* Background properties */
nsresult DoGetBackgroundAttachment(nsIDOMCSSValue** aValue);
nsresult DoGetBackgroundColor(nsIDOMCSSValue** aValue);
nsresult DoGetBackgroundImage(nsIDOMCSSValue** aValue);
nsresult DoGetBackgroundPosition(nsIDOMCSSValue** aValue);
nsresult DoGetBackgroundRepeat(nsIDOMCSSValue** aValue);
nsresult DoGetBackgroundClip(nsIDOMCSSValue** aValue);
nsresult DoGetBackgroundInlinePolicy(nsIDOMCSSValue** aValue);
nsresult DoGetBackgroundOrigin(nsIDOMCSSValue** aValue);
nsresult DoGetMozBackgroundSize(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetBackgroundAttachment();
nsIDOMCSSValue* DoGetBackgroundColor();
nsIDOMCSSValue* DoGetBackgroundImage();
nsIDOMCSSValue* DoGetBackgroundPosition();
nsIDOMCSSValue* DoGetBackgroundRepeat();
nsIDOMCSSValue* DoGetBackgroundClip();
nsIDOMCSSValue* DoGetBackgroundInlinePolicy();
nsIDOMCSSValue* DoGetBackgroundOrigin();
nsIDOMCSSValue* DoGetMozBackgroundSize();
/* Padding properties */
nsresult DoGetPadding(nsIDOMCSSValue** aValue);
nsresult DoGetPaddingTop(nsIDOMCSSValue** aValue);
nsresult DoGetPaddingBottom(nsIDOMCSSValue** aValue);
nsresult DoGetPaddingLeft(nsIDOMCSSValue** aValue);
nsresult DoGetPaddingRight(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetPadding();
nsIDOMCSSValue* DoGetPaddingTop();
nsIDOMCSSValue* DoGetPaddingBottom();
nsIDOMCSSValue* DoGetPaddingLeft();
nsIDOMCSSValue* DoGetPaddingRight();
/* Table Properties */
nsresult DoGetBorderCollapse(nsIDOMCSSValue** aValue);
nsresult DoGetBorderSpacing(nsIDOMCSSValue** aValue);
nsresult DoGetCaptionSide(nsIDOMCSSValue** aValue);
nsresult DoGetEmptyCells(nsIDOMCSSValue** aValue);
nsresult DoGetTableLayout(nsIDOMCSSValue** aValue);
nsresult DoGetVerticalAlign(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetBorderCollapse();
nsIDOMCSSValue* DoGetBorderSpacing();
nsIDOMCSSValue* DoGetCaptionSide();
nsIDOMCSSValue* DoGetEmptyCells();
nsIDOMCSSValue* DoGetTableLayout();
nsIDOMCSSValue* DoGetVerticalAlign();
/* Border Properties */
nsresult DoGetBorderStyle(nsIDOMCSSValue** aValue);
nsresult DoGetBorderWidth(nsIDOMCSSValue** aValue);
nsresult DoGetBorderTopStyle(nsIDOMCSSValue** aValue);
nsresult DoGetBorderBottomStyle(nsIDOMCSSValue** aValue);
nsresult DoGetBorderLeftStyle(nsIDOMCSSValue** aValue);
nsresult DoGetBorderRightStyle(nsIDOMCSSValue** aValue);
nsresult DoGetBorderTopWidth(nsIDOMCSSValue** aValue);
nsresult DoGetBorderBottomWidth(nsIDOMCSSValue** aValue);
nsresult DoGetBorderLeftWidth(nsIDOMCSSValue** aValue);
nsresult DoGetBorderRightWidth(nsIDOMCSSValue** aValue);
nsresult DoGetBorderTopColor(nsIDOMCSSValue** aValue);
nsresult DoGetBorderBottomColor(nsIDOMCSSValue** aValue);
nsresult DoGetBorderLeftColor(nsIDOMCSSValue** aValue);
nsresult DoGetBorderRightColor(nsIDOMCSSValue** aValue);
nsresult DoGetBorderBottomColors(nsIDOMCSSValue** aValue);
nsresult DoGetBorderLeftColors(nsIDOMCSSValue** aValue);
nsresult DoGetBorderRightColors(nsIDOMCSSValue** aValue);
nsresult DoGetBorderTopColors(nsIDOMCSSValue** aValue);
nsresult DoGetBorderBottomLeftRadius(nsIDOMCSSValue** aValue);
nsresult DoGetBorderBottomRightRadius(nsIDOMCSSValue** aValue);
nsresult DoGetBorderTopLeftRadius(nsIDOMCSSValue** aValue);
nsresult DoGetBorderTopRightRadius(nsIDOMCSSValue** aValue);
nsresult DoGetFloatEdge(nsIDOMCSSValue** aValue);
nsresult DoGetBorderImage(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetBorderStyle();
nsIDOMCSSValue* DoGetBorderWidth();
nsIDOMCSSValue* DoGetBorderTopStyle();
nsIDOMCSSValue* DoGetBorderBottomStyle();
nsIDOMCSSValue* DoGetBorderLeftStyle();
nsIDOMCSSValue* DoGetBorderRightStyle();
nsIDOMCSSValue* DoGetBorderTopWidth();
nsIDOMCSSValue* DoGetBorderBottomWidth();
nsIDOMCSSValue* DoGetBorderLeftWidth();
nsIDOMCSSValue* DoGetBorderRightWidth();
nsIDOMCSSValue* DoGetBorderTopColor();
nsIDOMCSSValue* DoGetBorderBottomColor();
nsIDOMCSSValue* DoGetBorderLeftColor();
nsIDOMCSSValue* DoGetBorderRightColor();
nsIDOMCSSValue* DoGetBorderBottomColors();
nsIDOMCSSValue* DoGetBorderLeftColors();
nsIDOMCSSValue* DoGetBorderRightColors();
nsIDOMCSSValue* DoGetBorderTopColors();
nsIDOMCSSValue* DoGetBorderBottomLeftRadius();
nsIDOMCSSValue* DoGetBorderBottomRightRadius();
nsIDOMCSSValue* DoGetBorderTopLeftRadius();
nsIDOMCSSValue* DoGetBorderTopRightRadius();
nsIDOMCSSValue* DoGetFloatEdge();
nsIDOMCSSValue* DoGetBorderImage();
/* Box Shadow */
nsresult DoGetBoxShadow(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetBoxShadow();
/* Window Shadow */
nsresult DoGetWindowShadow(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetWindowShadow();
/* Margin Properties */
nsresult DoGetMarginWidth(nsIDOMCSSValue** aValue);
nsresult DoGetMarginTopWidth(nsIDOMCSSValue** aValue);
nsresult DoGetMarginBottomWidth(nsIDOMCSSValue** aValue);
nsresult DoGetMarginLeftWidth(nsIDOMCSSValue** aValue);
nsresult DoGetMarginRightWidth(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetMarginWidth();
nsIDOMCSSValue* DoGetMarginTopWidth();
nsIDOMCSSValue* DoGetMarginBottomWidth();
nsIDOMCSSValue* DoGetMarginLeftWidth();
nsIDOMCSSValue* DoGetMarginRightWidth();
/* Outline Properties */
nsresult DoGetOutline(nsIDOMCSSValue** aValue);
nsresult DoGetOutlineWidth(nsIDOMCSSValue** aValue);
nsresult DoGetOutlineStyle(nsIDOMCSSValue** aValue);
nsresult DoGetOutlineColor(nsIDOMCSSValue** aValue);
nsresult DoGetOutlineOffset(nsIDOMCSSValue** aValue);
nsresult DoGetOutlineRadiusBottomLeft(nsIDOMCSSValue** aValue);
nsresult DoGetOutlineRadiusBottomRight(nsIDOMCSSValue** aValue);
nsresult DoGetOutlineRadiusTopLeft(nsIDOMCSSValue** aValue);
nsresult DoGetOutlineRadiusTopRight(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetOutline();
nsIDOMCSSValue* DoGetOutlineWidth();
nsIDOMCSSValue* DoGetOutlineStyle();
nsIDOMCSSValue* DoGetOutlineColor();
nsIDOMCSSValue* DoGetOutlineOffset();
nsIDOMCSSValue* DoGetOutlineRadiusBottomLeft();
nsIDOMCSSValue* DoGetOutlineRadiusBottomRight();
nsIDOMCSSValue* DoGetOutlineRadiusTopLeft();
nsIDOMCSSValue* DoGetOutlineRadiusTopRight();
/* Content Properties */
nsresult DoGetContent(nsIDOMCSSValue** aValue);
nsresult DoGetCounterIncrement(nsIDOMCSSValue** aValue);
nsresult DoGetCounterReset(nsIDOMCSSValue** aValue);
nsresult DoGetMarkerOffset(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetContent();
nsIDOMCSSValue* DoGetCounterIncrement();
nsIDOMCSSValue* DoGetCounterReset();
nsIDOMCSSValue* DoGetMarkerOffset();
/* Quotes Properties */
nsresult DoGetQuotes(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetQuotes();
/* z-index */
nsresult DoGetZIndex(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetZIndex();
/* List properties */
nsresult DoGetListStyleImage(nsIDOMCSSValue** aValue);
nsresult DoGetListStylePosition(nsIDOMCSSValue** aValue);
nsresult DoGetListStyleType(nsIDOMCSSValue** aValue);
nsresult DoGetImageRegion(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetListStyleImage();
nsIDOMCSSValue* DoGetListStylePosition();
nsIDOMCSSValue* DoGetListStyleType();
nsIDOMCSSValue* DoGetImageRegion();
/* Text Properties */
nsresult DoGetLineHeight(nsIDOMCSSValue** aValue);
nsresult DoGetTextAlign(nsIDOMCSSValue** aValue);
nsresult DoGetTextDecoration(nsIDOMCSSValue** aValue);
nsresult DoGetTextIndent(nsIDOMCSSValue** aValue);
nsresult DoGetTextTransform(nsIDOMCSSValue** aValue);
nsresult DoGetTextShadow(nsIDOMCSSValue** aValue);
nsresult DoGetLetterSpacing(nsIDOMCSSValue** aValue);
nsresult DoGetWordSpacing(nsIDOMCSSValue** aValue);
nsresult DoGetWhiteSpace(nsIDOMCSSValue** aValue);
nsresult DoGetWordWrap(nsIDOMCSSValue** aValue);
nsresult DoGetMozTabSize(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetLineHeight();
nsIDOMCSSValue* DoGetTextAlign();
nsIDOMCSSValue* DoGetTextDecoration();
nsIDOMCSSValue* DoGetTextIndent();
nsIDOMCSSValue* DoGetTextTransform();
nsIDOMCSSValue* DoGetTextShadow();
nsIDOMCSSValue* DoGetLetterSpacing();
nsIDOMCSSValue* DoGetWordSpacing();
nsIDOMCSSValue* DoGetWhiteSpace();
nsIDOMCSSValue* DoGetWordWrap();
nsIDOMCSSValue* DoGetMozTabSize();
/* Visibility properties */
nsresult DoGetOpacity(nsIDOMCSSValue** aValue);
nsresult DoGetPointerEvents(nsIDOMCSSValue** aValue);
nsresult DoGetVisibility(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetOpacity();
nsIDOMCSSValue* DoGetPointerEvents();
nsIDOMCSSValue* DoGetVisibility();
/* Direction properties */
nsresult DoGetDirection(nsIDOMCSSValue** aValue);
nsresult DoGetUnicodeBidi(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetDirection();
nsIDOMCSSValue* DoGetUnicodeBidi();
/* Display properties */
nsresult DoGetBinding(nsIDOMCSSValue** aValue);
nsresult DoGetClear(nsIDOMCSSValue** aValue);
nsresult DoGetCssFloat(nsIDOMCSSValue** aValue);
nsresult DoGetDisplay(nsIDOMCSSValue** aValue);
nsresult DoGetPosition(nsIDOMCSSValue** aValue);
nsresult DoGetClip(nsIDOMCSSValue** aValue);
nsresult DoGetOverflow(nsIDOMCSSValue** aValue);
nsresult DoGetOverflowX(nsIDOMCSSValue** aValue);
nsresult DoGetOverflowY(nsIDOMCSSValue** aValue);
nsresult DoGetResize(nsIDOMCSSValue** aValue);
nsresult DoGetPageBreakAfter(nsIDOMCSSValue** aValue);
nsresult DoGetPageBreakBefore(nsIDOMCSSValue** aValue);
nsresult DoGetMozTransform(nsIDOMCSSValue** aValue);
nsresult DoGetMozTransformOrigin(nsIDOMCSSValue **aValue);
nsIDOMCSSValue* DoGetBinding();
nsIDOMCSSValue* DoGetClear();
nsIDOMCSSValue* DoGetCssFloat();
nsIDOMCSSValue* DoGetDisplay();
nsIDOMCSSValue* DoGetPosition();
nsIDOMCSSValue* DoGetClip();
nsIDOMCSSValue* DoGetOverflow();
nsIDOMCSSValue* DoGetOverflowX();
nsIDOMCSSValue* DoGetOverflowY();
nsIDOMCSSValue* DoGetResize();
nsIDOMCSSValue* DoGetPageBreakAfter();
nsIDOMCSSValue* DoGetPageBreakBefore();
nsIDOMCSSValue* DoGetMozTransform();
nsIDOMCSSValue* DoGetMozTransformOrigin();
/* User interface properties */
nsresult DoGetCursor(nsIDOMCSSValue** aValue);
nsresult DoGetForceBrokenImageIcon(nsIDOMCSSValue** aValue);
nsresult DoGetIMEMode(nsIDOMCSSValue** aValue);
nsresult DoGetUserFocus(nsIDOMCSSValue** aValue);
nsresult DoGetUserInput(nsIDOMCSSValue** aValue);
nsresult DoGetUserModify(nsIDOMCSSValue** aValue);
nsresult DoGetUserSelect(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetCursor();
nsIDOMCSSValue* DoGetForceBrokenImageIcon();
nsIDOMCSSValue* DoGetIMEMode();
nsIDOMCSSValue* DoGetUserFocus();
nsIDOMCSSValue* DoGetUserInput();
nsIDOMCSSValue* DoGetUserModify();
nsIDOMCSSValue* DoGetUserSelect();
/* Column properties */
nsresult DoGetColumnCount(nsIDOMCSSValue** aValue);
nsresult DoGetColumnWidth(nsIDOMCSSValue** aValue);
nsresult DoGetColumnGap(nsIDOMCSSValue** aValue);
nsresult DoGetColumnRuleWidth(nsIDOMCSSValue** aValue);
nsresult DoGetColumnRuleStyle(nsIDOMCSSValue** aValue);
nsresult DoGetColumnRuleColor(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetColumnCount();
nsIDOMCSSValue* DoGetColumnWidth();
nsIDOMCSSValue* DoGetColumnGap();
nsIDOMCSSValue* DoGetColumnRuleWidth();
nsIDOMCSSValue* DoGetColumnRuleStyle();
nsIDOMCSSValue* DoGetColumnRuleColor();
/* CSS Transitions */
nsresult DoGetTransitionProperty(nsIDOMCSSValue** aValue);
nsresult DoGetTransitionDuration(nsIDOMCSSValue** aValue);
nsresult DoGetTransitionDelay(nsIDOMCSSValue** aValue);
nsresult DoGetTransitionTimingFunction(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetTransitionProperty();
nsIDOMCSSValue* DoGetTransitionDuration();
nsIDOMCSSValue* DoGetTransitionDelay();
nsIDOMCSSValue* DoGetTransitionTimingFunction();
/* SVG properties */
nsresult DoGetFill(nsIDOMCSSValue** aValue);
nsresult DoGetStroke(nsIDOMCSSValue** aValue);
nsresult DoGetMarkerEnd(nsIDOMCSSValue** aValue);
nsresult DoGetMarkerMid(nsIDOMCSSValue** aValue);
nsresult DoGetMarkerStart(nsIDOMCSSValue** aValue);
nsresult DoGetStrokeDasharray(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetFill();
nsIDOMCSSValue* DoGetStroke();
nsIDOMCSSValue* DoGetMarkerEnd();
nsIDOMCSSValue* DoGetMarkerMid();
nsIDOMCSSValue* DoGetMarkerStart();
nsIDOMCSSValue* DoGetStrokeDasharray();
nsresult DoGetStrokeDashoffset(nsIDOMCSSValue** aValue);
nsresult DoGetStrokeWidth(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetStrokeDashoffset();
nsIDOMCSSValue* DoGetStrokeWidth();
nsresult DoGetFillOpacity(nsIDOMCSSValue** aValue);
nsresult DoGetFloodOpacity(nsIDOMCSSValue** aValue);
nsresult DoGetStopOpacity(nsIDOMCSSValue** aValue);
nsresult DoGetStrokeMiterlimit(nsIDOMCSSValue** aValue);
nsresult DoGetStrokeOpacity(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetFillOpacity();
nsIDOMCSSValue* DoGetFloodOpacity();
nsIDOMCSSValue* DoGetStopOpacity();
nsIDOMCSSValue* DoGetStrokeMiterlimit();
nsIDOMCSSValue* DoGetStrokeOpacity();
nsresult DoGetClipRule(nsIDOMCSSValue** aValue);
nsresult DoGetFillRule(nsIDOMCSSValue** aValue);
nsresult DoGetStrokeLinecap(nsIDOMCSSValue** aValue);
nsresult DoGetStrokeLinejoin(nsIDOMCSSValue** aValue);
nsresult DoGetTextAnchor(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetClipRule();
nsIDOMCSSValue* DoGetFillRule();
nsIDOMCSSValue* DoGetStrokeLinecap();
nsIDOMCSSValue* DoGetStrokeLinejoin();
nsIDOMCSSValue* DoGetTextAnchor();
nsresult DoGetColorInterpolation(nsIDOMCSSValue** aValue);
nsresult DoGetColorInterpolationFilters(nsIDOMCSSValue** aValue);
nsresult DoGetDominantBaseline(nsIDOMCSSValue** aValue);
nsresult DoGetImageRendering(nsIDOMCSSValue** aValue);
nsresult DoGetShapeRendering(nsIDOMCSSValue** aValue);
nsresult DoGetTextRendering(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetColorInterpolation();
nsIDOMCSSValue* DoGetColorInterpolationFilters();
nsIDOMCSSValue* DoGetDominantBaseline();
nsIDOMCSSValue* DoGetImageRendering();
nsIDOMCSSValue* DoGetShapeRendering();
nsIDOMCSSValue* DoGetTextRendering();
nsresult DoGetFloodColor(nsIDOMCSSValue** aValue);
nsresult DoGetLightingColor(nsIDOMCSSValue** aValue);
nsresult DoGetStopColor(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetFloodColor();
nsIDOMCSSValue* DoGetLightingColor();
nsIDOMCSSValue* DoGetStopColor();
nsresult DoGetClipPath(nsIDOMCSSValue** aValue);
nsresult DoGetFilter(nsIDOMCSSValue** aValue);
nsresult DoGetMask(nsIDOMCSSValue** aValue);
nsIDOMCSSValue* DoGetClipPath();
nsIDOMCSSValue* DoGetFilter();
nsIDOMCSSValue* DoGetMask();
nsROCSSPrimitiveValue* GetROCSSPrimitiveValue();
nsDOMCSSValueList* GetROCSSValueList(PRBool aCommaDelimited);
nsresult SetToRGBAColor(nsROCSSPrimitiveValue* aValue, nscolor aColor);
nsresult SetValueToStyleImage(const nsStyleImage& aStyleImage,
nsROCSSPrimitiveValue* aValue);
void SetToRGBAColor(nsROCSSPrimitiveValue* aValue, nscolor aColor);
void SetValueToStyleImage(const nsStyleImage& aStyleImage,
nsROCSSPrimitiveValue* aValue);
/**
* A method to get a percentage base for a percentage value. Returns PR_TRUE
@ -456,7 +457,7 @@ private:
struct ComputedStyleMapEntry
{
// Create a pointer-to-member-function type.
typedef nsresult (nsComputedDOMStyle::*ComputeMethod)(nsIDOMCSSValue**);
typedef nsIDOMCSSValue* (nsComputedDOMStyle::*ComputeMethod)();
nsCSSProperty mProperty;
ComputeMethod mGetter;

Просмотреть файл

@ -65,10 +65,10 @@ NS_INTERFACE_MAP_BEGIN(nsDOMCSSValueList)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CSSValueList)
NS_INTERFACE_MAP_END
PRBool
void
nsDOMCSSValueList::AppendCSSValue(nsIDOMCSSValue* aValue)
{
return mCSSValues.AppendObject(aValue);
mCSSValues.AppendElement(aValue);
}
// nsIDOMCSSValueList
@ -76,7 +76,7 @@ nsDOMCSSValueList::AppendCSSValue(nsIDOMCSSValue* aValue)
NS_IMETHODIMP
nsDOMCSSValueList::GetLength(PRUint32* aLength)
{
*aLength = mCSSValues.Count();
*aLength = mCSSValues.Length();
return NS_OK;
}
@ -98,7 +98,7 @@ nsDOMCSSValueList::GetCssText(nsAString& aCssText)
{
aCssText.Truncate();
PRUint32 count = mCSSValues.Count();
PRUint32 count = mCSSValues.Length();
nsAutoString separator;
if (mCommaDelimited) {

Просмотреть файл

@ -63,14 +63,12 @@ public:
/**
* Adds a value to this list.
* @retval PR_TRUE Adding the value succeeded
* @retval PR_FALSE The value could not be added (Out of memory)
*/
PRBool AppendCSSValue(nsIDOMCSSValue* aValue);
void AppendCSSValue(nsIDOMCSSValue* aValue);
nsIDOMCSSValue* GetItemAt(PRUint32 aIndex)
{
return mCSSValues.SafeObjectAt(aIndex);
return mCSSValues.SafeElementAt(aIndex, nsnull);
}
static nsDOMCSSValueList* FromSupports(nsISupports* aSupports)
@ -97,7 +95,7 @@ private:
PRPackedBool mReadonly; // Are we read-only?
nsCOMArray<nsIDOMCSSValue> mCSSValues;
InfallibleTArray<nsCOMPtr<nsIDOMCSSValue> > mCSSValues;
};

Просмотреть файл

@ -2943,9 +2943,6 @@ nsRuleNode::SetFont(nsPresContext* aPresContext, nsStyleContext* aContext,
// defaultVariableFont.name should always be "serif" or "sans-serif".
aFont->mFont.name.Append(defaultVariableFont->name);
}
aFont->mFont.familyNameQuirks =
(aPresContext->CompatibilityMode() == eCompatibility_NavQuirks &&
aFontData.mFamilyFromHTML);
aFont->mFont.systemFont = PR_FALSE;
// Technically this is redundant with the code below, but it's good
// to have since we'll still want it once we get rid of
@ -2954,20 +2951,17 @@ nsRuleNode::SetFont(nsPresContext* aPresContext, nsStyleContext* aContext,
}
else if (eCSSUnit_System_Font == aFontData.mFamily.GetUnit()) {
aFont->mFont.name = systemFont.name;
aFont->mFont.familyNameQuirks = PR_FALSE;
aFont->mFont.systemFont = PR_TRUE;
aFont->mGenericID = kGenericFont_NONE;
}
else if (eCSSUnit_Inherit == aFontData.mFamily.GetUnit()) {
aCanStoreInRuleTree = PR_FALSE;
aFont->mFont.name = aParentFont->mFont.name;
aFont->mFont.familyNameQuirks = aParentFont->mFont.familyNameQuirks;
aFont->mFont.systemFont = aParentFont->mFont.systemFont;
aFont->mGenericID = aParentFont->mGenericID;
}
else if (eCSSUnit_Initial == aFontData.mFamily.GetUnit()) {
aFont->mFont.name = defaultVariableFont->name;
aFont->mFont.familyNameQuirks = PR_FALSE;
aFont->mFont.systemFont = defaultVariableFont->systemFont;
aFont->mGenericID = kGenericFont_NONE;
}

Просмотреть файл

@ -208,7 +208,6 @@ nsChangeHint nsStyleFont::CalcFontDifference(const nsFont& aFont1, const nsFont&
(aFont1.sizeAdjust == aFont2.sizeAdjust) &&
(aFont1.style == aFont2.style) &&
(aFont1.variant == aFont2.variant) &&
(aFont1.familyNameQuirks == aFont2.familyNameQuirks) &&
(aFont1.weight == aFont2.weight) &&
(aFont1.stretch == aFont2.stretch) &&
(aFont1.name == aFont2.name) &&

Просмотреть файл

@ -369,8 +369,8 @@ var gCSSProperties = {
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "1" ],
other_values: [ "0", "100" ],
invalid_values: [ "1.0", "-1", "-1000" ]
other_values: [ "2", "100" ],
invalid_values: [ "1.0", "-1", "-1000", "0" ]
},
"-moz-box-orient": {
domProp: "MozBoxOrient",

Просмотреть файл

@ -1602,7 +1602,6 @@ nsSVGGlyphFrame::EnsureTextRun(float *aDrawScale, float *aMetricsScale,
gfxFontStyle fontStyle(font.style, font.weight, font.stretch, textRunSize,
mStyleContext->GetStyleVisibility()->mLanguage,
font.sizeAdjust, font.systemFont,
font.familyNameQuirks,
printerFont,
font.featureSettings,
font.languageOverride);