mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-19 07:26:26 +00:00
Make sure proper computed values for root element display fixups end up in the style data so that other code looking at the style data doesn't break. b=233480 r+sr=bzbarsky
This commit is contained in:
parent
952d32ee39
commit
4b1b971ac8
@ -3357,8 +3357,26 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresShell* aPresShell,
|
||||
PRBool isBlockFrame = PR_FALSE;
|
||||
nsresult rv;
|
||||
|
||||
PRBool docElemIsTable = display->mDisplay == NS_STYLE_DISPLAY_TABLE ||
|
||||
display->mDisplay == NS_STYLE_DISPLAY_INLINE_TABLE;
|
||||
// CSS2.1 section 9.2.4 specifies fixups for the 'display' property
|
||||
// of the root element. We can't implement them in nsRuleNode because
|
||||
// it doesn't (and shouldn't, for nodes that can have siblings) know
|
||||
// the content node. So do them here if needed, by changing the style
|
||||
// data, so that other code doesn't get confused by looking at the style
|
||||
// data.
|
||||
if (display->mDisplay != NS_STYLE_DISPLAY_NONE &&
|
||||
display->mDisplay != NS_STYLE_DISPLAY_BLOCK &&
|
||||
display->mDisplay != NS_STYLE_DISPLAY_TABLE) {
|
||||
nsStyleDisplay *mutable_display = NS_STATIC_CAST(nsStyleDisplay*,
|
||||
styleContext->GetUniqueStyleData(eStyleStruct_Display));
|
||||
display = mutable_display;
|
||||
|
||||
if (mutable_display->mDisplay == NS_STYLE_DISPLAY_INLINE_TABLE)
|
||||
mutable_display->mDisplay = NS_STYLE_DISPLAY_TABLE;
|
||||
else
|
||||
mutable_display->mDisplay = NS_STYLE_DISPLAY_BLOCK;
|
||||
}
|
||||
|
||||
PRBool docElemIsTable = display->mDisplay == NS_STYLE_DISPLAY_TABLE;
|
||||
|
||||
if (docElemIsTable) {
|
||||
// if the document is a table then just populate it.
|
||||
|
@ -3357,8 +3357,26 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresShell* aPresShell,
|
||||
PRBool isBlockFrame = PR_FALSE;
|
||||
nsresult rv;
|
||||
|
||||
PRBool docElemIsTable = display->mDisplay == NS_STYLE_DISPLAY_TABLE ||
|
||||
display->mDisplay == NS_STYLE_DISPLAY_INLINE_TABLE;
|
||||
// CSS2.1 section 9.2.4 specifies fixups for the 'display' property
|
||||
// of the root element. We can't implement them in nsRuleNode because
|
||||
// it doesn't (and shouldn't, for nodes that can have siblings) know
|
||||
// the content node. So do them here if needed, by changing the style
|
||||
// data, so that other code doesn't get confused by looking at the style
|
||||
// data.
|
||||
if (display->mDisplay != NS_STYLE_DISPLAY_NONE &&
|
||||
display->mDisplay != NS_STYLE_DISPLAY_BLOCK &&
|
||||
display->mDisplay != NS_STYLE_DISPLAY_TABLE) {
|
||||
nsStyleDisplay *mutable_display = NS_STATIC_CAST(nsStyleDisplay*,
|
||||
styleContext->GetUniqueStyleData(eStyleStruct_Display));
|
||||
display = mutable_display;
|
||||
|
||||
if (mutable_display->mDisplay == NS_STYLE_DISPLAY_INLINE_TABLE)
|
||||
mutable_display->mDisplay = NS_STYLE_DISPLAY_TABLE;
|
||||
else
|
||||
mutable_display->mDisplay = NS_STYLE_DISPLAY_BLOCK;
|
||||
}
|
||||
|
||||
PRBool docElemIsTable = display->mDisplay == NS_STYLE_DISPLAY_TABLE;
|
||||
|
||||
if (docElemIsTable) {
|
||||
// if the document is a table then just populate it.
|
||||
|
Loading…
x
Reference in New Issue
Block a user