Bug 1288572: Don't hide -moz-box / -moz-inline-box yet. r?mats
I'd really prefer to not land this patch, but...
MozReview-Commit-ID: HzmvhTd32gz
--- a/dom/base/nsDeprecatedOperationList.h
+++ b/dom/base/nsDeprecatedOperationList.h
@@ -42,8 +42,9 @@ DEPRECATED_OPERATION(WindowContentUntrus
DEPRECATED_OPERATION(RegisterProtocolHandlerInsecure)
DEPRECATED_OPERATION(MixedDisplayObjectSubrequest)
DEPRECATED_OPERATION(MotionEvent)
DEPRECATED_OPERATION(OrientationEvent)
DEPRECATED_OPERATION(ProximityEvent)
DEPRECATED_OPERATION(AmbientLightEvent)
DEPRECATED_OPERATION(IDBOpenDBOptions_StorageType)
DEPRECATED_OPERATION(DOMAttrModifiedEvent)
+DEPRECATED_OPERATION(MozBoxOrInlineBoxDisplay)
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -4464,30 +4464,36 @@ nsCSSFrameConstructor::FindXULDisplayDat
FCDATA_SKIP_ABSPOS_PUSH, NS_NewMenuPopupFrame))
#endif /* MOZ_XUL */
};
if (aDisplay->mDisplay < StyleDisplay::MozBox) {
return nullptr;
}
- // If we're emulating -moz-box with flexbox, then treat it as non-XUL and
- // return null (except for scrollcorners which have to be XUL becuase their
- // parent reflows them with BoxReflow() which means they have to get
- // actual-XUL frames).
- if (StaticPrefs::layout_css_emulate_moz_box_with_flex() &&
- aElement && !aElement->IsXULElement(nsGkAtoms::scrollcorner) &&
- (aDisplay->mDisplay == StyleDisplay::MozBox ||
- aDisplay->mDisplay == StyleDisplay::MozInlineBox)) {
- return nullptr;
- }
-
MOZ_ASSERT(aDisplay->mDisplay <= StyleDisplay::MozPopup,
"Someone added a new display value?");
+ if (aDisplay->mDisplay == StyleDisplay::MozBox ||
+ aDisplay->mDisplay == StyleDisplay::MozInlineBox) {
+ if (!aElement->IsInNativeAnonymousSubtree() &&
+ aElement->OwnerDoc()->IsContentDocument()) {
+ aElement->OwnerDoc()->WarnOnceAbout(nsIDocument::eMozBoxOrInlineBoxDisplay);
+ }
+
+ // If we're emulating -moz-box with flexbox, then treat it as non-XUL and
+ // return null (except for scrollcorners which have to be XUL becuase their
+ // parent reflows them with BoxReflow() which means they have to get
+ // actual-XUL frames).
+ if (StaticPrefs::layout_css_emulate_moz_box_with_flex() &&
+ !aElement->IsXULElement(nsGkAtoms::scrollcorner)) {
+ return nullptr;
+ }
+ }
+
const FrameConstructionDataByDisplay& data =
sXULDisplayData[size_t(aDisplay->mDisplay) - size_t(StyleDisplay::MozBox)];
MOZ_ASSERT(aDisplay->mDisplay == data.mDisplay,
"Did someone mess with the order?");
return &data.mData;
}
--- a/layout/style/test/test_non_content_accessible_values.html
+++ b/layout/style/test/test_non_content_accessible_values.html
@@ -1,18 +1,19 @@
<!doctype html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style id="sheet"></style>
<div></div>
<script>
const NON_CONTENT_ACCESSIBLE_VALUES = {
"display": [
- "-moz-box",
- "-moz-inline-box",
+ // FIXME(emilio, bug TBD): Remove from content these two too.
+ // "-moz-box",
+ // "-moz-inline-box",
"-moz-grid",
"-moz-inline-grid",
"-moz-grid-group",
"-moz-grid-line",
"-moz-stack",
"-moz-inline-stack",
"-moz-deck",
"-moz-popup",
--- a/servo/components/style/values/specified/box.rs
+++ b/servo/components/style/values/specified/box.rs
@@ -74,20 +74,18 @@ pub enum Display {
Contents,
#[cfg(feature = "gecko")]
FlowRoot,
#[cfg(feature = "gecko")]
WebkitBox,
#[cfg(feature = "gecko")]
WebkitInlineBox,
#[cfg(feature = "gecko")]
- #[css(parse_condition = "moz_display_values_enabled_on_content")]
MozBox,
#[cfg(feature = "gecko")]
- #[css(parse_condition = "moz_display_values_enabled_on_content")]
MozInlineBox,
#[cfg(feature = "gecko")]
#[css(parse_condition = "moz_display_values_enabled_on_content")]
MozGrid,
#[cfg(feature = "gecko")]
#[css(parse_condition = "moz_display_values_enabled_on_content")]
MozInlineGrid,
#[cfg(feature = "gecko")]