зеркало из https://github.com/mozilla/gecko-dev.git
Fix for bug #4833. Changed CreateGeneratedContentFrame() to make sure that
'position' is set to 'static'
This commit is contained in:
Родитель
6ef64de9a4
Коммит
5eae13db9c
|
@ -376,8 +376,8 @@ nsCSSFrameConstructor::CreateGeneratedContentFrame(nsIPresContext* aPresContext
|
||||||
|
|
||||||
if (NS_STYLE_DISPLAY_NONE != display->mDisplay) {
|
if (NS_STYLE_DISPLAY_NONE != display->mDisplay) {
|
||||||
// See if there was any content specified
|
// See if there was any content specified
|
||||||
const nsStyleContent* styleContent;
|
const nsStyleContent* styleContent =
|
||||||
styleContent = (const nsStyleContent*)pseudoStyleContext->GetStyleData(eStyleStruct_Content);
|
(const nsStyleContent*)pseudoStyleContext->GetStyleData(eStyleStruct_Content);
|
||||||
PRUint32 contentCount = styleContent->ContentCount();
|
PRUint32 contentCount = styleContent->ContentCount();
|
||||||
|
|
||||||
if (contentCount > 0) {
|
if (contentCount > 0) {
|
||||||
|
@ -411,6 +411,18 @@ nsCSSFrameConstructor::CreateGeneratedContentFrame(nsIPresContext* aPresContext
|
||||||
mutableDisplay->mDisplay = displayValue;
|
mutableDisplay->mDisplay = displayValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Also make sure the 'position' property is 'static'. :before and :after
|
||||||
|
// pseudo-elements can not be floated or positioned
|
||||||
|
const nsStylePosition * stylePosition =
|
||||||
|
(const nsStylePosition*)pseudoStyleContext->GetStyleData(eStyleStruct_Position);
|
||||||
|
if (NS_STYLE_POSITION_NORMAL != stylePosition->mPosition) {
|
||||||
|
// Reset the value
|
||||||
|
nsStylePosition* mutablePosition = (nsStylePosition*)
|
||||||
|
pseudoStyleContext->GetMutableStyleData(eStyleStruct_Position);
|
||||||
|
|
||||||
|
mutablePosition->mPosition = NS_STYLE_POSITION_NORMAL;
|
||||||
|
}
|
||||||
|
|
||||||
// Create a block box or an inline box depending on the value of
|
// Create a block box or an inline box depending on the value of
|
||||||
// the 'display' property
|
// the 'display' property
|
||||||
nsIFrame* containerFrame;
|
nsIFrame* containerFrame;
|
||||||
|
|
|
@ -376,8 +376,8 @@ nsCSSFrameConstructor::CreateGeneratedContentFrame(nsIPresContext* aPresContext
|
||||||
|
|
||||||
if (NS_STYLE_DISPLAY_NONE != display->mDisplay) {
|
if (NS_STYLE_DISPLAY_NONE != display->mDisplay) {
|
||||||
// See if there was any content specified
|
// See if there was any content specified
|
||||||
const nsStyleContent* styleContent;
|
const nsStyleContent* styleContent =
|
||||||
styleContent = (const nsStyleContent*)pseudoStyleContext->GetStyleData(eStyleStruct_Content);
|
(const nsStyleContent*)pseudoStyleContext->GetStyleData(eStyleStruct_Content);
|
||||||
PRUint32 contentCount = styleContent->ContentCount();
|
PRUint32 contentCount = styleContent->ContentCount();
|
||||||
|
|
||||||
if (contentCount > 0) {
|
if (contentCount > 0) {
|
||||||
|
@ -411,6 +411,18 @@ nsCSSFrameConstructor::CreateGeneratedContentFrame(nsIPresContext* aPresContext
|
||||||
mutableDisplay->mDisplay = displayValue;
|
mutableDisplay->mDisplay = displayValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Also make sure the 'position' property is 'static'. :before and :after
|
||||||
|
// pseudo-elements can not be floated or positioned
|
||||||
|
const nsStylePosition * stylePosition =
|
||||||
|
(const nsStylePosition*)pseudoStyleContext->GetStyleData(eStyleStruct_Position);
|
||||||
|
if (NS_STYLE_POSITION_NORMAL != stylePosition->mPosition) {
|
||||||
|
// Reset the value
|
||||||
|
nsStylePosition* mutablePosition = (nsStylePosition*)
|
||||||
|
pseudoStyleContext->GetMutableStyleData(eStyleStruct_Position);
|
||||||
|
|
||||||
|
mutablePosition->mPosition = NS_STYLE_POSITION_NORMAL;
|
||||||
|
}
|
||||||
|
|
||||||
// Create a block box or an inline box depending on the value of
|
// Create a block box or an inline box depending on the value of
|
||||||
// the 'display' property
|
// the 'display' property
|
||||||
nsIFrame* containerFrame;
|
nsIFrame* containerFrame;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче