diff options
Diffstat (limited to 'layout/base')
-rw-r--r-- | layout/base/crashtests/265027-1.html | 19 | ||||
-rw-r--r-- | layout/base/crashtests/265986-1.html | 10 | ||||
-rw-r--r-- | layout/base/crashtests/265999-1.html | 8 | ||||
-rw-r--r-- | layout/base/crashtests/367498-2.html | 14 | ||||
-rw-r--r-- | layout/base/crashtests/404491-1.html | 5 | ||||
-rw-r--r-- | layout/base/crashtests/580129-1.html | 19 | ||||
-rw-r--r-- | layout/base/crashtests/580494-1.html | 1 | ||||
-rw-r--r-- | layout/base/crashtests/597924-1.html | 16 | ||||
-rw-r--r-- | layout/base/nsCSSFrameConstructor.cpp | 8 | ||||
-rw-r--r-- | layout/base/nsLayoutUtils.cpp | 34 | ||||
-rw-r--r-- | layout/base/nsPresContext.cpp | 26 | ||||
-rw-r--r-- | layout/base/nsPresShell.cpp | 5 |
12 files changed, 47 insertions, 118 deletions
diff --git a/layout/base/crashtests/265027-1.html b/layout/base/crashtests/265027-1.html deleted file mode 100644 index 9b455da41..000000000 --- a/layout/base/crashtests/265027-1.html +++ /dev/null @@ -1,19 +0,0 @@ -<HTML> -<HEAD> -<MARQUEE> -<TABLE> -<MARQUEE HEIGHT=100000000> -<MARQUEE HEIGHT=100000000> -<MARQUEE HEIGHT=100000000> -<MARQUEE HEIGHT=100000000> -<MARQUEE HEIGHT=100000000> -<MARQUEE HEIGHT=100000000> -<MARQUEE HEIGHT=100000000> -<MARQUEE HEIGHT=100000000> -<MARQUEE HEIGHT=100000000> -<MARQUEE HEIGHT=100000000> -<MARQUEE HEIGHT=100000000> -<TBODY> -Attack of the marquees! - - diff --git a/layout/base/crashtests/265986-1.html b/layout/base/crashtests/265986-1.html deleted file mode 100644 index 8d4ca290f..000000000 --- a/layout/base/crashtests/265986-1.html +++ /dev/null @@ -1,10 +0,0 @@ -<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'>
-<HTML>
-<HEAD>
-</HEAD>
-<BODY>
-<IFRAME STYLE="MARGIN:99999999999px; PADDING:-99999999999px;"></IFRAME>
-<APPLET STYLE="HEIGHT:9999999999pt; float:left; MARGIN:-99999999999px; border:99999999999px solid blue;"></APPLET>
-<MARQUEE STYLE=" WIDTH:9999999999px;">W</MARQUEE>
-</BODY>
-</HTML>
diff --git a/layout/base/crashtests/265999-1.html b/layout/base/crashtests/265999-1.html deleted file mode 100644 index 7e6e3d416..000000000 --- a/layout/base/crashtests/265999-1.html +++ /dev/null @@ -1,8 +0,0 @@ -<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'>
-<HTML>
-<HEAD>
-</HEAD>
-<BODY>
-<MARQUEE STYLE="HEIGHT:9999999999px; float:right; border:99999999999px solid blue;"></MARQUEE>
-</BODY>
-</HTML>
diff --git a/layout/base/crashtests/367498-2.html b/layout/base/crashtests/367498-2.html deleted file mode 100644 index 2c85ac0a4..000000000 --- a/layout/base/crashtests/367498-2.html +++ /dev/null @@ -1,14 +0,0 @@ -<html><head> -</head><body> -<marquee> -<div style="border: 1px solid black; -moz-border-radius: 2em;"> -<marquee> -<span style="display: -moz-grid-line;"> -<select></select> -</span> -</marquee> -</div> -</marquee> - -</body> -</html> diff --git a/layout/base/crashtests/404491-1.html b/layout/base/crashtests/404491-1.html deleted file mode 100644 index 540a0f6a1..000000000 --- a/layout/base/crashtests/404491-1.html +++ /dev/null @@ -1,5 +0,0 @@ -<html> -<body> -<marquee><marquee></marquee><img></marquee> -</body> -</html> diff --git a/layout/base/crashtests/580129-1.html b/layout/base/crashtests/580129-1.html deleted file mode 100644 index 228051b5a..000000000 --- a/layout/base/crashtests/580129-1.html +++ /dev/null @@ -1,19 +0,0 @@ -<html> -<head> -<script> - -function boom() -{ - var a = document.documentElement; - var b = document.createElementNS("http://www.w3.org/1999/xhtml", "body"); - b.setAttributeNS(null, "style", "-moz-column-width: 20em;"); - a.innerHTML = "<frameset>"; - b.innerHTML = "<dd><marquee>x"; - document.removeChild(a); - document.appendChild(b); -} - -</script> -</head> -<body onload="boom();"></body> -</html> diff --git a/layout/base/crashtests/580494-1.html b/layout/base/crashtests/580494-1.html deleted file mode 100644 index c76125f74..000000000 --- a/layout/base/crashtests/580494-1.html +++ /dev/null @@ -1 +0,0 @@ -<html><body><marquee><video></video></marquee></body></html>
\ No newline at end of file diff --git a/layout/base/crashtests/597924-1.html b/layout/base/crashtests/597924-1.html deleted file mode 100644 index d855997ee..000000000 --- a/layout/base/crashtests/597924-1.html +++ /dev/null @@ -1,16 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script> - -function boom() -{ - document.getElementById("s").appendChild(document.createElement("div")); - var marq = document.getElementById("f").contentDocument.documentElement; - marq.behavior = "alternate"; -} - -</script> -</head> -<body onload="boom();"><span id="s"></span><iframe src="data:text/xml,%3Cmarquee%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%3EX%3C%2Fmarquee%3E" id="f"></iframe></body> -</html> diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 6642a090d..d28e60740 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -2614,7 +2614,8 @@ nsCSSFrameConstructor::ConstructDocElementFrame(Element* aDocEle newFrame = frameItems.FirstChild(); NS_ASSERTION(frameItems.OnlyChild(), "multiple root element frames"); } else { - MOZ_ASSERT(display->mDisplay == StyleDisplay::Block, + MOZ_ASSERT(display->mDisplay == StyleDisplay::Block || + display->mDisplay == StyleDisplay::FlowRoot, "Unhandled display type for root element"); contentFrame = NS_NewBlockFormattingContext(mPresShell, styleContext); nsFrameItems frameItems; @@ -4758,6 +4759,7 @@ nsCSSFrameConstructor::FindDisplayData(const nsStyleDisplay* aDisplay, static const FrameConstructionDataByDisplay sDisplayData[] = { FCDATA_FOR_DISPLAY(StyleDisplay::None, UNREACHABLE_FCDATA()), FCDATA_FOR_DISPLAY(StyleDisplay::Block, UNREACHABLE_FCDATA()), + FCDATA_FOR_DISPLAY(StyleDisplay::FlowRoot, UNREACHABLE_FCDATA()), // To keep the hash table small don't add inline frames (they're // typically things like FONT and B), because we can quickly // find them if we need to. @@ -4943,7 +4945,7 @@ nsCSSFrameConstructor::ConstructNonScrollableBlockWithConstructor( StyleDisplay::InlineBlock == aDisplay->mDisplay || clipPaginatedOverflow) && !aParentFrame->IsSVGText()) { - flags = NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT; + flags = NS_BLOCK_FORMATTING_CONTEXT_STATE_BITS; if (clipPaginatedOverflow) { flags |= NS_BLOCK_CLIP_PAGINATED_OVERFLOW; } @@ -5112,7 +5114,7 @@ nsCSSFrameConstructor::FlushAccumulatedBlock(nsFrameConstructorState& aState, // is not a suitable block. nsContainerFrame* blockFrame = NS_NewMathMLmathBlockFrame(mPresShell, blockContext); - blockFrame->AddStateBits(NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT); + blockFrame->AddStateBits(NS_BLOCK_FORMATTING_CONTEXT_STATE_BITS); InitAndRestoreFrame(aState, aContent, aParentFrame, blockFrame); ReparentFrames(this, blockFrame, aBlockItems); diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 5de6f2013..9b204d734 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -149,6 +149,7 @@ using namespace mozilla::gfx; #define GRID_ENABLED_PREF_NAME "layout.css.grid.enabled" #define GRID_TEMPLATE_SUBGRID_ENABLED_PREF_NAME "layout.css.grid-template-subgrid-value.enabled" #define WEBKIT_PREFIXES_ENABLED_PREF_NAME "layout.css.prefixes.webkit" +#define DISPLAY_FLOW_ROOT_ENABLED_PREF_NAME "layout.css.display-flow-root.enabled" #define DISPLAY_CONTENTS_ENABLED_PREF_NAME "layout.css.display-contents.enabled" #define TEXT_ALIGN_UNSAFE_ENABLED_PREF_NAME "layout.css.text-align-unsafe-value.enabled" #define FLOAT_LOGICAL_VALUES_ENABLED_PREF_NAME "layout.css.float-logical-values.enabled" @@ -314,6 +315,37 @@ WebkitPrefixEnabledPrefChangeCallback(const char* aPrefName, void* aClosure) } } +// When the pref "layout.css.display-flow-root.enabled" changes, this function is +// invoked to let us update kDisplayKTable, to selectively disable or restore +// the entries for "flow-root" in that table. +static void +DisplayFlowRootEnabledPrefChangeCallback(const char* aPrefName, void* aClosure) +{ + NS_ASSERTION(strcmp(aPrefName, DISPLAY_FLOW_ROOT_ENABLED_PREF_NAME) == 0, + "Did you misspell " DISPLAY_FLOW_ROOT_ENABLED_PREF_NAME " ?"); + + static bool sIsDisplayFlowRootKeywordIndexInitialized; + static int32_t sIndexOfFlowRootInDisplayTable; + bool isDisplayFlowRootEnabled = + Preferences::GetBool(DISPLAY_FLOW_ROOT_ENABLED_PREF_NAME, false); + + if (!sIsDisplayFlowRootKeywordIndexInitialized) { + // First run: find the position of "flow-root" in kDisplayKTable. + sIndexOfFlowRootInDisplayTable = + nsCSSProps::FindIndexOfKeyword(eCSSKeyword_flow_root, + nsCSSProps::kDisplayKTable); + sIsDisplayFlowRootKeywordIndexInitialized = true; + } + + // OK -- now, stomp on or restore the "flow-root" entry in kDisplayKTable, + // depending on whether the pref is enabled vs. disabled. + if (sIndexOfFlowRootInDisplayTable >= 0) { + nsCSSProps::kDisplayKTable[sIndexOfFlowRootInDisplayTable].mKeyword = + isDisplayFlowRootEnabled ? eCSSKeyword_flow_root : eCSSKeyword_UNKNOWN; + } +} + + // When the pref "layout.css.display-contents.enabled" changes, this function is // invoked to let us update kDisplayKTable, to selectively disable or restore // the entries for "contents" in that table. @@ -7635,6 +7667,8 @@ static const PrefCallbacks kPrefCallbacks[] = { WebkitPrefixEnabledPrefChangeCallback }, { TEXT_ALIGN_UNSAFE_ENABLED_PREF_NAME, TextAlignUnsafeEnabledPrefChangeCallback }, + { DISPLAY_FLOW_ROOT_ENABLED_PREF_NAME, + DisplayFlowRootEnabledPrefChangeCallback }, { DISPLAY_CONTENTS_ENABLED_PREF_NAME, DisplayContentsEnabledPrefChangeCallback }, { FLOAT_LOGICAL_VALUES_ENABLED_PREF_NAME, diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp index befb5deb2..1d90b967a 100644 --- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -1931,33 +1931,13 @@ nsPresContext::MediaFeatureValuesChanged(nsRestyleHint aRestyleHint, if (!PR_CLIST_IS_EMPTY(mDocument->MediaQueryLists())) { // We build a list of all the notifications we're going to send - // before we send any of them. (The spec says the notifications - // should be a queued task, so any removals that happen during the - // notifications shouldn't affect what gets notified.) Furthermore, - // we hold strong pointers to everything we're going to make - // notification calls to, since each notification involves calling - // arbitrary script that might otherwise destroy these objects, or, - // for that matter, |this|. - // - // Note that we intentionally send the notifications to media query - // list in the order they were created and, for each list, to the - // listeners in the order added. - nsTArray<MediaQueryList::HandleChangeData> notifyList; + // before we send any of them. for (PRCList *l = PR_LIST_HEAD(mDocument->MediaQueryLists()); l != mDocument->MediaQueryLists(); l = PR_NEXT_LINK(l)) { + nsAutoMicroTask mt; MediaQueryList *mql = static_cast<MediaQueryList*>(l); - mql->MediumFeaturesChanged(notifyList); + mql->MaybeNotify(); } - - if (!notifyList.IsEmpty()) { - for (uint32_t i = 0, i_end = notifyList.Length(); i != i_end; ++i) { - nsAutoMicroTask mt; - MediaQueryList::HandleChangeData &d = notifyList[i]; - d.callback->Call(*d.mql); - } - } - - // NOTE: When |notifyList| goes out of scope, our destructor could run. } } diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 63f512af4..0544a69a4 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -9090,6 +9090,11 @@ PresShell::DidDoReflow(bool aInterruptible) docShell->NotifyReflowObservers(aInterruptible, mLastReflowStart, now); } + // Notify resize observers on reflow. + if (!mPresContext->HasPendingInterrupt()) { + mDocument->ScheduleResizeObserversNotification(); + } + if (sSynthMouseMove) { SynthesizeMouseMove(false); } |