mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-15 08:53:07 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
96fb72ec56
106 changed files with 4038 additions and 1148 deletions
2
config/external/moz.build
vendored
2
config/external/moz.build
vendored
|
|
@ -55,7 +55,7 @@ external_dirs += [
|
|||
'media/psshparser'
|
||||
]
|
||||
|
||||
if CONFIG['MOZ_LINKER']:
|
||||
if CONFIG['MOZ_UPDATER']:
|
||||
external_dirs += ['modules/xz-embedded']
|
||||
|
||||
DIRS += ['../../' + i for i in external_dirs]
|
||||
|
|
|
|||
|
|
@ -2073,6 +2073,7 @@ exports.CSS_PROPERTIES = {
|
|||
"-moz-min-content",
|
||||
"auto",
|
||||
"calc",
|
||||
"content",
|
||||
"inherit",
|
||||
"initial",
|
||||
"unset"
|
||||
|
|
@ -2095,6 +2096,7 @@ exports.CSS_PROPERTIES = {
|
|||
"-moz-min-content",
|
||||
"auto",
|
||||
"calc",
|
||||
"content",
|
||||
"inherit",
|
||||
"initial",
|
||||
"unset"
|
||||
|
|
@ -2931,10 +2933,8 @@ exports.CSS_PROPERTIES = {
|
|||
"grid-auto-flow",
|
||||
"grid-auto-rows",
|
||||
"grid-column-end",
|
||||
"grid-column-gap",
|
||||
"grid-column-start",
|
||||
"grid-row-end",
|
||||
"grid-row-gap",
|
||||
"grid-row-start",
|
||||
"grid-template-areas",
|
||||
"grid-template-columns",
|
||||
|
|
@ -3029,6 +3029,7 @@ exports.CSS_PROPERTIES = {
|
|||
"quotes",
|
||||
"resize",
|
||||
"right",
|
||||
"row-gap",
|
||||
"ruby-align",
|
||||
"ruby-position",
|
||||
"scroll-behavior",
|
||||
|
|
@ -3232,6 +3233,7 @@ exports.CSS_PROPERTIES = {
|
|||
"column-reverse",
|
||||
"condensed",
|
||||
"contain",
|
||||
"content",
|
||||
"content-box",
|
||||
"contents",
|
||||
"cover",
|
||||
|
|
@ -5841,6 +5843,7 @@ exports.CSS_PROPERTIES = {
|
|||
"-moz-min-content",
|
||||
"auto",
|
||||
"calc",
|
||||
"content",
|
||||
"inherit",
|
||||
"initial",
|
||||
"unset"
|
||||
|
|
@ -5863,6 +5866,7 @@ exports.CSS_PROPERTIES = {
|
|||
"-moz-min-content",
|
||||
"auto",
|
||||
"calc",
|
||||
"content",
|
||||
"inherit",
|
||||
"initial",
|
||||
"unset"
|
||||
|
|
@ -6328,17 +6332,11 @@ exports.CSS_PROPERTIES = {
|
|||
"unset"
|
||||
]
|
||||
},
|
||||
"grid": {
|
||||
"gap": {
|
||||
"isInherited": false,
|
||||
"subproperties": [
|
||||
"grid-template-areas",
|
||||
"grid-template-rows",
|
||||
"grid-template-columns",
|
||||
"grid-auto-flow",
|
||||
"grid-auto-rows",
|
||||
"grid-auto-columns",
|
||||
"grid-row-gap",
|
||||
"grid-column-gap"
|
||||
"row-gap",
|
||||
"column-gap"
|
||||
],
|
||||
"supports": [
|
||||
6,
|
||||
|
|
@ -6347,6 +6345,27 @@ exports.CSS_PROPERTIES = {
|
|||
"values": [
|
||||
"-moz-calc",
|
||||
"calc",
|
||||
"inherit",
|
||||
"initial",
|
||||
"normal",
|
||||
"unset"
|
||||
]
|
||||
},
|
||||
"grid": {
|
||||
"isInherited": false,
|
||||
"subproperties": [
|
||||
"grid-template-areas",
|
||||
"grid-template-rows",
|
||||
"grid-template-columns",
|
||||
"grid-auto-flow",
|
||||
"grid-auto-rows",
|
||||
"grid-auto-columns"
|
||||
],
|
||||
"supports": [
|
||||
6,
|
||||
8
|
||||
],
|
||||
"values": [
|
||||
"inherit",
|
||||
"initial",
|
||||
"unset"
|
||||
|
|
@ -6443,7 +6462,7 @@ exports.CSS_PROPERTIES = {
|
|||
"grid-column-gap": {
|
||||
"isInherited": false,
|
||||
"subproperties": [
|
||||
"grid-column-gap"
|
||||
"column-gap"
|
||||
],
|
||||
"supports": [
|
||||
6,
|
||||
|
|
@ -6454,6 +6473,7 @@ exports.CSS_PROPERTIES = {
|
|||
"calc",
|
||||
"inherit",
|
||||
"initial",
|
||||
"normal",
|
||||
"unset"
|
||||
]
|
||||
},
|
||||
|
|
@ -6474,8 +6494,8 @@ exports.CSS_PROPERTIES = {
|
|||
"grid-gap": {
|
||||
"isInherited": false,
|
||||
"subproperties": [
|
||||
"grid-row-gap",
|
||||
"grid-column-gap"
|
||||
"row-gap",
|
||||
"column-gap"
|
||||
],
|
||||
"supports": [
|
||||
6,
|
||||
|
|
@ -6486,6 +6506,7 @@ exports.CSS_PROPERTIES = {
|
|||
"calc",
|
||||
"inherit",
|
||||
"initial",
|
||||
"normal",
|
||||
"unset"
|
||||
]
|
||||
},
|
||||
|
|
@ -6521,7 +6542,7 @@ exports.CSS_PROPERTIES = {
|
|||
"grid-row-gap": {
|
||||
"isInherited": false,
|
||||
"subproperties": [
|
||||
"grid-row-gap"
|
||||
"row-gap"
|
||||
],
|
||||
"supports": [
|
||||
6,
|
||||
|
|
@ -6532,6 +6553,7 @@ exports.CSS_PROPERTIES = {
|
|||
"calc",
|
||||
"inherit",
|
||||
"initial",
|
||||
"normal",
|
||||
"unset"
|
||||
]
|
||||
},
|
||||
|
|
@ -8335,6 +8357,24 @@ exports.CSS_PROPERTIES = {
|
|||
"unset"
|
||||
]
|
||||
},
|
||||
"row-gap": {
|
||||
"isInherited": false,
|
||||
"subproperties": [
|
||||
"row-gap"
|
||||
],
|
||||
"supports": [
|
||||
6,
|
||||
8
|
||||
],
|
||||
"values": [
|
||||
"-moz-calc",
|
||||
"calc",
|
||||
"inherit",
|
||||
"initial",
|
||||
"normal",
|
||||
"unset"
|
||||
]
|
||||
},
|
||||
"ruby-align": {
|
||||
"isInherited": true,
|
||||
"subproperties": [
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <ostream>
|
||||
#include <limits>
|
||||
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
|
|
|
|||
|
|
@ -969,12 +969,14 @@ function String_static_trimStart(string) {
|
|||
ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, 'String.trimStart');
|
||||
return callFunction(std_String_trimStart, string);
|
||||
}
|
||||
_SetCanonicalName(String_static_trimStart, "trimStart");
|
||||
|
||||
function String_static_trimEnd(string) {
|
||||
if (arguments.length < 1)
|
||||
ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, 'String.trimEnd');
|
||||
return callFunction(std_String_trimEnd, string);
|
||||
}
|
||||
_SetCanonicalName(String_static_trimEnd, "trimEnd");
|
||||
|
||||
function String_static_toLocaleLowerCase(string) {
|
||||
if (arguments.length < 1)
|
||||
|
|
|
|||
|
|
@ -8181,12 +8181,14 @@ IonBuilder::maybeMarkEmpty(MDefinition* ins)
|
|||
// as having no possible types too. This is to avoid degrading
|
||||
// subsequent analysis.
|
||||
for (size_t i = 0; i < ins->numOperands(); i++) {
|
||||
if (!ins->emptyResultTypeSet())
|
||||
if (!ins->getOperand(i)->emptyResultTypeSet())
|
||||
continue;
|
||||
|
||||
TemporaryTypeSet* types = alloc().lifoAlloc()->new_<TemporaryTypeSet>();
|
||||
if (types)
|
||||
if (types) {
|
||||
ins->setResultTypeSet(types);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -162,7 +162,12 @@ void
|
|||
FrameLayerBuilder::DisplayItemData::AddFrame(nsIFrame* aFrame)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(mLayer);
|
||||
mFrameList.AppendElement(aFrame);
|
||||
|
||||
// Make sure we don't add duplicate frames as we're storing these as vectors.
|
||||
// See UXP Issue #1860
|
||||
if (!mFrameList.Contains(aFrame)) {
|
||||
mFrameList.AppendElement(aFrame);
|
||||
}
|
||||
|
||||
nsTArray<DisplayItemData*>* array =
|
||||
aFrame->GetProperty(FrameLayerBuilder::LayerManagerDataProperty());
|
||||
|
|
@ -328,8 +333,7 @@ public:
|
|||
void Dump(const char *aPrefix = "") {
|
||||
printf_stderr("%sLayerManagerData %p\n", aPrefix, this);
|
||||
|
||||
for (auto iter = mDisplayItems.Iter(); !iter.Done(); iter.Next()) {
|
||||
FrameLayerBuilder::DisplayItemData* data = iter.Get()->GetKey();
|
||||
for (auto& data : mDisplayItems) {
|
||||
|
||||
nsAutoCString prefix;
|
||||
prefix += aPrefix;
|
||||
|
|
@ -388,7 +392,7 @@ public:
|
|||
#ifdef DEBUG_DISPLAY_ITEM_DATA
|
||||
LayerManagerData *mParent;
|
||||
#endif
|
||||
nsTHashtable<nsRefPtrHashKey<FrameLayerBuilder::DisplayItemData> > mDisplayItems;
|
||||
std::vector<RefPtr<FrameLayerBuilder::DisplayItemData> > mDisplayItems;
|
||||
bool mInvalidateAllLayers;
|
||||
};
|
||||
|
||||
|
|
@ -1971,7 +1975,12 @@ FrameLayerBuilder::RemoveFrameFromLayerManager(const nsIFrame* aFrame,
|
|||
}
|
||||
}
|
||||
|
||||
data->mParent->mDisplayItems.RemoveEntry(data);
|
||||
auto it = std::find(data->mParent->mDisplayItems.begin(),
|
||||
data->mParent->mDisplayItems.end(),
|
||||
data);
|
||||
MOZ_ASSERT(it != data->mParent->mDisplayItems.end());
|
||||
std::iter_swap(it, data->mParent->mDisplayItems.end() - 1);
|
||||
data->mParent->mDisplayItems.pop_back();
|
||||
}
|
||||
|
||||
arrayCopy.Clear();
|
||||
|
|
@ -2024,27 +2033,40 @@ FrameLayerBuilder::WillEndTransaction()
|
|||
NS_ASSERTION(data, "Must have data!");
|
||||
|
||||
// Update all the frames that used to have layers.
|
||||
for (auto iter = data->mDisplayItems.Iter(); !iter.Done(); iter.Next()) {
|
||||
DisplayItemData* data = iter.Get()->GetKey();
|
||||
if (!data->mUsed) {
|
||||
auto iter = data->mDisplayItems.begin();
|
||||
while (iter != data->mDisplayItems.end()) {
|
||||
DisplayItemData* did = iter->get();
|
||||
if (!did->mUsed) {
|
||||
// This item was visible, but isn't anymore.
|
||||
PaintedLayer* t = data->mLayer->AsPaintedLayer();
|
||||
if (t && data->mGeometry) {
|
||||
PaintedLayer* t = did->mLayer->AsPaintedLayer();
|
||||
if (t && did->mGeometry) {
|
||||
#ifdef MOZ_DUMP_PAINTING
|
||||
if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) {
|
||||
printf_stderr("Invalidating unused display item (%i) belonging to frame %p from layer %p\n", data->mDisplayItemKey, data->mFrameList[0], t);
|
||||
printf_stderr("Invalidating unused display item (%i) belonging to frame %p from layer %p\n", did->mDisplayItemKey, did->mFrameList[0], t);
|
||||
}
|
||||
#endif
|
||||
InvalidatePostTransformRegion(t,
|
||||
data->mGeometry->ComputeInvalidationRegion(),
|
||||
data->mClip,
|
||||
did->mGeometry->ComputeInvalidationRegion(),
|
||||
did->mClip,
|
||||
GetLastPaintOffset(t));
|
||||
}
|
||||
|
||||
data->ClearAnimationCompositorState();
|
||||
iter.Remove();
|
||||
did->ClearAnimationCompositorState();
|
||||
|
||||
// Remove this item. Swapping it with the last element first is
|
||||
// quicker than erasing from the middle.
|
||||
if (iter != data->mDisplayItems.end() - 1) {
|
||||
std::iter_swap(iter, data->mDisplayItems.end() - 1);
|
||||
data->mDisplayItems.pop_back();
|
||||
} else {
|
||||
data->mDisplayItems.pop_back();
|
||||
break;
|
||||
}
|
||||
|
||||
// Don't increment iter because we still need to process the item which was moved.
|
||||
} else {
|
||||
ComputeGeometryChangeForItem(data);
|
||||
ComputeGeometryChangeForItem(did);
|
||||
iter++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4800,7 +4822,7 @@ FrameLayerBuilder::StoreDataForFrame(nsDisplayItem* aItem, Layer* aLayer, LayerS
|
|||
|
||||
data->BeginUpdate(aLayer, aState, mContainerLayerGeneration, aItem);
|
||||
|
||||
lmd->mDisplayItems.PutEntry(data);
|
||||
lmd->mDisplayItems.push_back(data);
|
||||
return data;
|
||||
}
|
||||
|
||||
|
|
@ -4824,7 +4846,7 @@ FrameLayerBuilder::StoreDataForFrame(nsIFrame* aFrame,
|
|||
|
||||
data->BeginUpdate(aLayer, aState, mContainerLayerGeneration);
|
||||
|
||||
lmd->mDisplayItems.PutEntry(data);
|
||||
lmd->mDisplayItems.push_back(data);
|
||||
}
|
||||
|
||||
FrameLayerBuilder::ClippedDisplayItem::ClippedDisplayItem(nsDisplayItem* aItem,
|
||||
|
|
@ -5558,10 +5580,19 @@ FrameLayerBuilder::BuildContainerLayerFor(nsDisplayListBuilder* aBuilder,
|
|||
flattenToSingleLayer = true;
|
||||
|
||||
// Restore DisplayItemData
|
||||
for (auto iter = data->mDisplayItems.Iter(); !iter.Done(); iter.Next()) {
|
||||
DisplayItemData* data = iter.Get()->GetKey();
|
||||
if (data->mUsed && data->mContainerLayerGeneration >= mContainerLayerGeneration) {
|
||||
iter.Remove();
|
||||
auto iter = data->mDisplayItems.begin();
|
||||
while (iter != data->mDisplayItems.end()) {
|
||||
DisplayItemData* did = iter->get();
|
||||
if (did->mUsed && did->mContainerLayerGeneration >= mContainerLayerGeneration) {
|
||||
if (iter != data->mDisplayItems.end() - 1) {
|
||||
std::iter_swap(iter, data->mDisplayItems.end() - 1);
|
||||
data->mDisplayItems.pop_back();
|
||||
} else {
|
||||
data->mDisplayItems.pop_back();
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
iter++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,9 +2,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<!--
|
||||
user_pref("layout.css.grid.enabled", true);
|
||||
-->
|
||||
<script>
|
||||
|
||||
function boom()
|
||||
|
|
|
|||
|
|
@ -467,7 +467,7 @@ load 1116104.html
|
|||
load 1127198-1.html
|
||||
load 1140198.html
|
||||
load 1143535.html
|
||||
pref(layout.css.grid.enabled,true) load 1156588.html
|
||||
load 1156588.html
|
||||
load 1162813.xul
|
||||
load 1163583.html
|
||||
load 1234622-1.html
|
||||
|
|
|
|||
|
|
@ -90,16 +90,22 @@ public:
|
|||
// Removes all entries from the hash table
|
||||
void Clear();
|
||||
|
||||
protected:
|
||||
LinkedList<UndisplayedNode>* GetListFor(nsIContent* aParentContent);
|
||||
LinkedList<UndisplayedNode>* GetOrCreateListFor(nsIContent* aParentContent);
|
||||
void AppendNodeFor(UndisplayedNode* aNode, nsIContent* aParentContent);
|
||||
/**
|
||||
* Get the applicable parent for the map lookup. This is almost always the
|
||||
* provided argument, except if it's a <xbl:children> element, in which case
|
||||
* it's the parent of the children element.
|
||||
*
|
||||
* All functions that are entry points into code that handles "parent"
|
||||
* objects (used as the hash table keys) must ensure that the parent objects
|
||||
* that they act on (and pass to other code) have been normalized by calling
|
||||
* this method.
|
||||
*/
|
||||
nsIContent* GetApplicableParent(nsIContent* aParent);
|
||||
static nsIContent* GetApplicableParent(nsIContent* aParent);
|
||||
|
||||
protected:
|
||||
LinkedList<UndisplayedNode>* GetListFor(nsIContent* aParentContent);
|
||||
LinkedList<UndisplayedNode>* GetOrCreateListFor(nsIContent* aParentContent);
|
||||
void AppendNodeFor(UndisplayedNode* aNode, nsIContent* aParentContent);
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
@ -131,6 +137,20 @@ nsFrameManager::Destroy()
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
/* static */ nsIContent*
|
||||
nsFrameManager::ParentForUndisplayedMap(const nsIContent* aContent)
|
||||
{
|
||||
MOZ_ASSERT(aContent);
|
||||
|
||||
nsIContent* parent = aContent->GetParentElementCrossingShadowRoot();
|
||||
MOZ_ASSERT(parent || !aContent->GetParent(), "no non-elements");
|
||||
|
||||
// Normalize the parent
|
||||
parent = UndisplayedMap::GetApplicableParent(parent);
|
||||
|
||||
return parent;
|
||||
}
|
||||
|
||||
/* static */ nsStyleContext*
|
||||
nsFrameManager::GetStyleContextInMap(UndisplayedMap* aMap,
|
||||
const nsIContent* aContent)
|
||||
|
|
@ -138,8 +158,8 @@ nsFrameManager::GetStyleContextInMap(UndisplayedMap* aMap,
|
|||
if (!aContent) {
|
||||
return nullptr;
|
||||
}
|
||||
nsIContent* parent = aContent->GetParentElementCrossingShadowRoot();
|
||||
MOZ_ASSERT(parent || !aContent->GetParent(), "no non-elements");
|
||||
|
||||
nsIContent* parent = ParentForUndisplayedMap(aContent);
|
||||
for (UndisplayedNode* node = aMap->GetFirstNode(parent);
|
||||
node; node = node->getNext()) {
|
||||
if (node->mContent == aContent)
|
||||
|
|
@ -178,8 +198,7 @@ nsFrameManager::SetStyleContextInMap(UndisplayedMap* aMap,
|
|||
MOZ_ASSERT(!GetStyleContextInMap(aMap, aContent),
|
||||
"Already have an entry for aContent");
|
||||
|
||||
nsIContent* parent = aContent->GetParentElementCrossingShadowRoot();
|
||||
MOZ_ASSERT(parent || !aContent->GetParent(), "no non-elements");
|
||||
nsIContent* parent = ParentForUndisplayedMap(aContent);
|
||||
#ifdef DEBUG
|
||||
nsIPresShell* shell = aStyleContext->PresContext()->PresShell();
|
||||
NS_ASSERTION(parent || (shell && shell->GetDocument() &&
|
||||
|
|
@ -194,9 +213,9 @@ nsFrameManager::SetStyleContextInMap(UndisplayedMap* aMap,
|
|||
// mUndisplayedMap and mDisplayContentsMap if the bit isn't present on a node
|
||||
// that it's handling.
|
||||
|
||||
if (parent) {
|
||||
parent->SetMayHaveChildrenWithLayoutBoxesDisabled();
|
||||
}
|
||||
if (parent) {
|
||||
parent->SetMayHaveChildrenWithLayoutBoxesDisabled();
|
||||
}
|
||||
|
||||
aMap->AddNodeFor(parent, aContent, aStyleContext);
|
||||
}
|
||||
|
|
@ -223,8 +242,7 @@ nsFrameManager::ChangeStyleContextInMap(UndisplayedMap* aMap,
|
|||
printf("ChangeStyleContextInMap(%d): p=%p \n", i++, (void *)aContent);
|
||||
#endif
|
||||
|
||||
nsIContent* parent = aContent->GetParentElementCrossingShadowRoot();
|
||||
MOZ_ASSERT(parent || !aContent->GetParent(), "no non-elements");
|
||||
nsIContent* parent = ParentForUndisplayedMap(aContent);
|
||||
|
||||
for (UndisplayedNode* node = aMap->GetFirstNode(parent);
|
||||
node; node = node->getNext()) {
|
||||
|
|
@ -249,7 +267,11 @@ nsFrameManager::ClearUndisplayedContentIn(nsIContent* aContent,
|
|||
if (!mUndisplayedMap) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// This function is an entry point into UndisplayedMap handling code, so we
|
||||
// must call GetApplicableParent so the parent we pass around is correct.
|
||||
aParentContent = UndisplayedMap::GetApplicableParent(aParentContent);
|
||||
|
||||
if (aParentContent &&
|
||||
!aParentContent->MayHaveChildrenWithLayoutBoxesDisabled()) {
|
||||
MOZ_ASSERT(!mUndisplayedMap->GetFirstNode(aParentContent),
|
||||
|
|
@ -382,6 +404,10 @@ nsFrameManager::ClearDisplayContentsIn(nsIContent* aContent,
|
|||
return;
|
||||
}
|
||||
|
||||
// This function is an entry point into UndisplayedMap handling code, so we
|
||||
// must call GetApplicableParent so the parent we pass around is correct.
|
||||
aParentContent = UndisplayedMap::GetApplicableParent(aParentContent);
|
||||
|
||||
if (aParentContent &&
|
||||
!aParentContent->MayHaveChildrenWithLayoutBoxesDisabled()) {
|
||||
MOZ_ASSERT(!mDisplayContentsMap->GetFirstNode(aParentContent),
|
||||
|
|
@ -684,7 +710,8 @@ nsFrameManagerBase::UndisplayedMap::GetApplicableParent(nsIContent* aParent)
|
|||
LinkedList<UndisplayedNode>*
|
||||
nsFrameManagerBase::UndisplayedMap::GetListFor(nsIContent* aParent)
|
||||
{
|
||||
aParent = GetApplicableParent(aParent);
|
||||
MOZ_ASSERT(aParent == GetApplicableParent(aParent),
|
||||
"The parent that we use as the hash key must have been normalized");
|
||||
|
||||
LinkedList<UndisplayedNode>* list;
|
||||
if (Get(aParent, &list)) {
|
||||
|
|
@ -697,7 +724,9 @@ nsFrameManagerBase::UndisplayedMap::GetListFor(nsIContent* aParent)
|
|||
LinkedList<UndisplayedNode>*
|
||||
nsFrameManagerBase::UndisplayedMap::GetOrCreateListFor(nsIContent* aParent)
|
||||
{
|
||||
aParent = GetApplicableParent(aParent);
|
||||
MOZ_ASSERT(aParent == GetApplicableParent(aParent),
|
||||
"The parent that we use as the hash key must have been normalized");
|
||||
|
||||
return LookupOrAdd(aParent);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -182,6 +182,8 @@ public:
|
|||
void RestoreFrameStateFor(nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState);
|
||||
protected:
|
||||
static nsIContent* ParentForUndisplayedMap(const nsIContent* aContent);
|
||||
|
||||
void ClearAllMapsFor(nsIContent* aParentContent);
|
||||
|
||||
static nsStyleContext* GetStyleContextInMap(UndisplayedMap* aMap,
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ nsGenConList::Clear()
|
|||
delete node;
|
||||
}
|
||||
mSize = 0;
|
||||
mLastInserted = nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -41,6 +42,9 @@ nsGenConList::DestroyNodesFor(nsIFrame* aFrame)
|
|||
node = nextNode;
|
||||
}
|
||||
|
||||
// Modification of the list invalidates the cached pointer.
|
||||
mLastInserted = nullptr;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -108,6 +112,11 @@ nsGenConList::Insert(nsGenConNode* aNode)
|
|||
// Check for append.
|
||||
if (mList.isEmpty() || NodeAfter(aNode, mList.getLast())) {
|
||||
mList.insertBack(aNode);
|
||||
} else if (mLastInserted && mLastInserted != mList.getLast() &&
|
||||
NodeAfter(aNode, mLastInserted) &&
|
||||
NodeAfter(Next(mLastInserted), aNode)) {
|
||||
// Fast path for inserting many consecutive nodes in one place
|
||||
mLastInserted->setNext(aNode);
|
||||
} else {
|
||||
// Binary search.
|
||||
|
||||
|
|
@ -142,6 +151,8 @@ nsGenConList::Insert(nsGenConNode* aNode)
|
|||
}
|
||||
++mSize;
|
||||
|
||||
mLastInserted = aNode;
|
||||
|
||||
// Set the mapping only if it is the first node of the frame.
|
||||
// The DEBUG blocks below are for ensuring the invariant required by
|
||||
// nsGenConList::DestroyNodesFor. See comment there.
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ protected:
|
|||
uint32_t mSize;
|
||||
|
||||
public:
|
||||
nsGenConList() : mSize(0) {}
|
||||
nsGenConList() : mSize(0), mLastInserted(nullptr) {}
|
||||
~nsGenConList() { Clear(); }
|
||||
void Clear();
|
||||
static nsGenConNode* Next(nsGenConNode* aNode) {
|
||||
|
|
@ -127,6 +127,10 @@ private:
|
|||
|
||||
// Map from frame to the first nsGenConNode of it in the list.
|
||||
nsDataHashtable<nsPtrHashKey<nsIFrame>, nsGenConNode*> mNodes;
|
||||
|
||||
// A weak pointer to the node most recently inserted, used to avoid repeated
|
||||
// list traversals in Insert().
|
||||
nsGenConNode* mLastInserted;
|
||||
};
|
||||
|
||||
#endif /* nsGenConList_h___ */
|
||||
|
|
|
|||
|
|
@ -145,7 +145,6 @@ using namespace mozilla::layers;
|
|||
using namespace mozilla::layout;
|
||||
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"
|
||||
|
|
@ -198,51 +197,6 @@ static ContentMap& GetContentMap() {
|
|||
return *sContentMap;
|
||||
}
|
||||
|
||||
// When the pref "layout.css.grid.enabled" changes, this function is invoked
|
||||
// to let us update kDisplayKTable, to selectively disable or restore the
|
||||
// entries for "grid" and "inline-grid" in that table.
|
||||
static void
|
||||
GridEnabledPrefChangeCallback(const char* aPrefName, void* aClosure)
|
||||
{
|
||||
MOZ_ASSERT(strncmp(aPrefName, GRID_ENABLED_PREF_NAME,
|
||||
ArrayLength(GRID_ENABLED_PREF_NAME)) == 0,
|
||||
"We only registered this callback for a single pref, so it "
|
||||
"should only be called for that pref");
|
||||
|
||||
static int32_t sIndexOfGridInDisplayTable;
|
||||
static int32_t sIndexOfInlineGridInDisplayTable;
|
||||
static bool sAreGridKeywordIndicesInitialized; // initialized to false
|
||||
|
||||
bool isGridEnabled =
|
||||
Preferences::GetBool(GRID_ENABLED_PREF_NAME, false);
|
||||
if (!sAreGridKeywordIndicesInitialized) {
|
||||
// First run: find the position of "grid" and "inline-grid" in
|
||||
// kDisplayKTable.
|
||||
sIndexOfGridInDisplayTable =
|
||||
nsCSSProps::FindIndexOfKeyword(eCSSKeyword_grid,
|
||||
nsCSSProps::kDisplayKTable);
|
||||
MOZ_ASSERT(sIndexOfGridInDisplayTable >= 0,
|
||||
"Couldn't find grid in kDisplayKTable");
|
||||
sIndexOfInlineGridInDisplayTable =
|
||||
nsCSSProps::FindIndexOfKeyword(eCSSKeyword_inline_grid,
|
||||
nsCSSProps::kDisplayKTable);
|
||||
MOZ_ASSERT(sIndexOfInlineGridInDisplayTable >= 0,
|
||||
"Couldn't find inline-grid in kDisplayKTable");
|
||||
sAreGridKeywordIndicesInitialized = true;
|
||||
}
|
||||
|
||||
// OK -- now, stomp on or restore the "grid" entries in kDisplayKTable,
|
||||
// depending on whether the grid pref is enabled vs. disabled.
|
||||
if (sIndexOfGridInDisplayTable >= 0) {
|
||||
nsCSSProps::kDisplayKTable[sIndexOfGridInDisplayTable].mKeyword =
|
||||
isGridEnabled ? eCSSKeyword_grid : eCSSKeyword_UNKNOWN;
|
||||
}
|
||||
if (sIndexOfInlineGridInDisplayTable >= 0) {
|
||||
nsCSSProps::kDisplayKTable[sIndexOfInlineGridInDisplayTable].mKeyword =
|
||||
isGridEnabled ? eCSSKeyword_inline_grid : eCSSKeyword_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
// When the pref "layout.css.prefixes.webkit" changes, this function is invoked
|
||||
// to let us update kDisplayKTable, to selectively disable or restore the
|
||||
// entries for "-webkit-box" and "-webkit-inline-box" in that table.
|
||||
|
|
@ -7575,8 +7529,6 @@ struct PrefCallbacks
|
|||
PrefChangedFunc func;
|
||||
};
|
||||
static const PrefCallbacks kPrefCallbacks[] = {
|
||||
{ GRID_ENABLED_PREF_NAME,
|
||||
GridEnabledPrefChangeCallback },
|
||||
{ WEBKIT_PREFIXES_ENABLED_PREF_NAME,
|
||||
WebkitPrefixEnabledPrefChangeCallback },
|
||||
{ TEXT_ALIGN_UNSAFE_ENABLED_PREF_NAME,
|
||||
|
|
|
|||
|
|
@ -3,10 +3,6 @@
|
|||
<head>
|
||||
<script>
|
||||
|
||||
/*
|
||||
user_pref("layout.css.grid.enabled", true);
|
||||
*/
|
||||
|
||||
function boom()
|
||||
{
|
||||
document.getElementById("r").appendChild(document.createTextNode("B"));
|
||||
|
|
|
|||
|
|
@ -2,9 +2,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<!--
|
||||
user_pref("layout.css.grid.enabled", true);
|
||||
-->
|
||||
<script>
|
||||
function boom()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -566,7 +566,7 @@ load 986899.html
|
|||
load 1001233.html
|
||||
load 1001258-1.html
|
||||
load 1003441.xul
|
||||
pref(layout.css.grid.enabled,true) load 1015562.html
|
||||
load 1015562.html
|
||||
asserts(1-2) load 1015563-1.html
|
||||
asserts(1-2) load 1015563-2.html
|
||||
asserts(0-300) load 1015844.html # bug 574889
|
||||
|
|
@ -589,7 +589,7 @@ load 1146107.html
|
|||
load 1146114.html
|
||||
load 1153695.html
|
||||
load 1156222.html
|
||||
pref(layout.css.grid.enabled,true) load 1156257.html
|
||||
load 1156257.html
|
||||
load 1157011.html
|
||||
load 1169420-1.html
|
||||
load 1169420-2.html
|
||||
|
|
@ -601,9 +601,9 @@ load 1222783.xhtml
|
|||
load 1223568-1.html
|
||||
load 1223568-2.html
|
||||
load 1224230-1.html
|
||||
pref(layout.css.grid.enabled,true) load 1225118.html
|
||||
pref(layout.css.grid.enabled,true) load 1225376.html
|
||||
pref(layout.css.grid.enabled,true) load 1225592.html
|
||||
load 1225118.html
|
||||
load 1225376.html
|
||||
load 1225592.html
|
||||
load 1229437-1.html
|
||||
load 1229437-2.html
|
||||
pref(dom.details_element.enabled,true) load details-containing-only-text.html
|
||||
|
|
|
|||
|
|
@ -183,15 +183,15 @@ nsColumnSetFrame::GetAvailableContentBSize(const ReflowInput& aReflowInput)
|
|||
|
||||
static nscoord
|
||||
GetColumnGap(nsColumnSetFrame* aFrame,
|
||||
const nsStyleColumn* aColStyle,
|
||||
nscoord aPercentageBasis)
|
||||
{
|
||||
const auto& columnGap = aColStyle->mColumnGap;
|
||||
if (columnGap.GetUnit() == eStyleUnit_Normal) {
|
||||
const nsStylePosition* positionData = aFrame->StylePosition();
|
||||
if (positionData->mColumnGap.GetUnit() == eStyleUnit_Normal) {
|
||||
return aFrame->StyleFont()->mFont.size;
|
||||
}
|
||||
|
||||
return nsLayoutUtils::ResolveGapToLength(columnGap, aPercentageBasis);
|
||||
return nsLayoutUtils::ResolveGapToLength(positionData->mColumnGap,
|
||||
aPercentageBasis);
|
||||
}
|
||||
|
||||
nsColumnSetFrame::ReflowConfig
|
||||
|
|
@ -224,7 +224,7 @@ nsColumnSetFrame::ChooseColumnStrategy(const ReflowInput& aReflowInput,
|
|||
colBSize = std::min(colBSize, aReflowInput.ComputedMaxBSize());
|
||||
}
|
||||
|
||||
nscoord colGap = GetColumnGap(this, colStyle, aReflowInput.ComputedISize());
|
||||
nscoord colGap = GetColumnGap(this, aReflowInput.ComputedISize());
|
||||
int32_t numColumns = colStyle->mColumnCount;
|
||||
|
||||
// If column-fill is set to 'balance', then we want to balance the columns.
|
||||
|
|
@ -400,7 +400,7 @@ nsColumnSetFrame::GetMinISize(nsRenderingContext *aRenderingContext)
|
|||
// include n-1 column gaps.
|
||||
colISize = iSize;
|
||||
iSize *= colStyle->mColumnCount;
|
||||
nscoord colGap = GetColumnGap(this, colStyle, NS_UNCONSTRAINEDSIZE);
|
||||
nscoord colGap = GetColumnGap(this, NS_UNCONSTRAINEDSIZE);
|
||||
iSize += colGap * (colStyle->mColumnCount - 1);
|
||||
// The multiplication above can make 'width' negative (integer overflow),
|
||||
// so use std::max to protect against that.
|
||||
|
|
@ -421,7 +421,7 @@ nsColumnSetFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
|
|||
nscoord result = 0;
|
||||
DISPLAY_PREF_WIDTH(this, result);
|
||||
const nsStyleColumn* colStyle = StyleColumn();
|
||||
nscoord colGap = GetColumnGap(this, colStyle, NS_UNCONSTRAINEDSIZE);
|
||||
nscoord colGap = GetColumnGap(this, NS_UNCONSTRAINEDSIZE);
|
||||
|
||||
nscoord colISize;
|
||||
if (colStyle->mColumnWidth.GetUnit() == eStyleUnit_Coord) {
|
||||
|
|
|
|||
|
|
@ -947,8 +947,29 @@ nsContainerFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
|||
aBorder.ISize(aWM) - aPadding.ISize(aWM);
|
||||
// replaced elements always shrink-wrap
|
||||
if ((aFlags & ComputeSizeFlags::eShrinkWrap) || IsFrameOfType(eReplaced)) {
|
||||
// don't bother setting it if the result won't be used
|
||||
if (StylePosition()->ISize(aWM).GetUnit() == eStyleUnit_Auto) {
|
||||
const nsStylePosition* position = StylePosition();
|
||||
|
||||
bool isFlexBasisContent = false;
|
||||
if (IsFlexItem()) {
|
||||
uint32_t flexDirection =
|
||||
GetParent()->StylePosition()->mFlexDirection;
|
||||
bool isInlineFlexItem =
|
||||
flexDirection == NS_STYLE_FLEX_DIRECTION_ROW ||
|
||||
flexDirection == NS_STYLE_FLEX_DIRECTION_ROW_REVERSE;
|
||||
isFlexBasisContent =
|
||||
position->mFlexBasis.GetUnit() == eStyleUnit_Enumerated &&
|
||||
position->mFlexBasis.GetIntValue() == NS_STYLE_FLEX_BASIS_CONTENT &&
|
||||
isInlineFlexItem;
|
||||
}
|
||||
|
||||
// Only bother computing our 'auto' ISize if the result will be used.
|
||||
// It'll be used under two scenarios:
|
||||
// - If our ISize property is itself 'auto'.
|
||||
// - If we're using flex-basis in place of our ISize property (i.e. we're a
|
||||
// flex item with our inline axis being the main axis), AND we have
|
||||
// flex-basis:content.
|
||||
bool isAuto = position->ISize(aWM).GetUnit() == eStyleUnit_Auto;
|
||||
if (isAuto || isFlexBasisContent) {
|
||||
result.ISize(aWM) = ShrinkWidthToFit(aRenderingContext, availBased, aFlags);
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ typedef nsFlexContainerFrame::FlexboxAxisTracker FlexboxAxisTracker;
|
|||
typedef nsFlexContainerFrame::StrutInfo StrutInfo;
|
||||
typedef nsFlexContainerFrame::CachedMeasuringReflowResult
|
||||
CachedMeasuringReflowResult;
|
||||
typedef nsLayoutUtils::IntrinsicISizeType IntrinsicISizeType;
|
||||
|
||||
static mozilla::LazyLogModule gFlexContainerLog("nsFlexContainerFrame");
|
||||
|
||||
|
|
@ -811,17 +812,23 @@ protected:
|
|||
class nsFlexContainerFrame::FlexLine : public LinkedListElement<FlexLine>
|
||||
{
|
||||
public:
|
||||
FlexLine()
|
||||
explicit FlexLine(nscoord aMainGapSize)
|
||||
: mNumItems(0),
|
||||
mNumFrozenItems(0),
|
||||
mTotalInnerHypotheticalMainSize(0),
|
||||
mTotalOuterHypotheticalMainSize(0),
|
||||
mLineCrossSize(0),
|
||||
mFirstBaselineOffset(nscoord_MIN),
|
||||
mLastBaselineOffset(nscoord_MIN)
|
||||
mLastBaselineOffset(nscoord_MIN),
|
||||
mMainGapSize(aMainGapSize)
|
||||
{}
|
||||
|
||||
// Returns the sum of our FlexItems' outer hypothetical main sizes.
|
||||
nscoord GetSumOfGaps() const {
|
||||
return mNumItems > 0 ? (mNumItems - 1) * mMainGapSize : 0;
|
||||
}
|
||||
|
||||
// Returns the sum of our FlexItems' outer hypothetical main sizes
|
||||
// and the sum of the main axis {row,column}-gaps between items.
|
||||
// ("outer" = margin-box, and "hypothetical" = before flexing)
|
||||
nscoord GetTotalOuterHypotheticalMainSize() const {
|
||||
return mTotalOuterHypotheticalMainSize;
|
||||
|
|
@ -890,8 +897,16 @@ public:
|
|||
if (aItem->IsFrozen()) {
|
||||
mNumFrozenItems++;
|
||||
}
|
||||
mTotalInnerHypotheticalMainSize += aItemInnerHypotheticalMainSize;
|
||||
|
||||
mTotalInnerHypotheticalMainSize += (aItemOuterHypotheticalMainSize -
|
||||
aItemInnerHypotheticalMainSize);
|
||||
mTotalOuterHypotheticalMainSize += aItemOuterHypotheticalMainSize;
|
||||
|
||||
// If the item added was not the first item in the line, we add in
|
||||
// any gap space as needed.
|
||||
if (mNumItems >= 2) {
|
||||
mTotalOuterHypotheticalMainSize += mMainGapSize;
|
||||
}
|
||||
}
|
||||
|
||||
// Computes the cross-size and baseline position of this FlexLine, based on
|
||||
|
|
@ -935,6 +950,22 @@ public:
|
|||
return mLastBaselineOffset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of items held in this line. Used for total gap
|
||||
* calculations.
|
||||
*/
|
||||
uint32_t GetNumItems() const {
|
||||
return mNumItems;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the gap size in the main axis for this line. Used for gap
|
||||
* calculations.
|
||||
*/
|
||||
nscoord GetMainGapSize() const {
|
||||
return mMainGapSize;
|
||||
}
|
||||
|
||||
// Runs the "Resolving Flexible Lengths" algorithm from section 9.7 of the
|
||||
// CSS flexbox spec to distribute aFlexContainerMainSize among our flex items.
|
||||
void ResolveFlexibleLengths(nscoord aFlexContainerMainSize);
|
||||
|
|
@ -973,6 +1004,9 @@ private:
|
|||
nscoord mLineCrossSize;
|
||||
nscoord mFirstBaselineOffset;
|
||||
nscoord mLastBaselineOffset;
|
||||
|
||||
// Maintain size of each {row,column}-gap in the main axis
|
||||
const nscoord mMainGapSize;
|
||||
};
|
||||
|
||||
// Information about a strut left behind by a FlexItem that's been collapsed
|
||||
|
|
@ -2241,6 +2275,9 @@ public:
|
|||
"miscounted the number of auto margins");
|
||||
}
|
||||
|
||||
// Advances past the gap space (if any) between two flex items
|
||||
void TraverseGap(nscoord aGapSize) { mPosition += aGapSize; }
|
||||
|
||||
// Advances past the packing space (if any) between two flex items
|
||||
void TraversePackingSpace();
|
||||
|
||||
|
|
@ -2266,7 +2303,11 @@ public:
|
|||
const ReflowInput& aReflowInput,
|
||||
nscoord aContentBoxCrossSize,
|
||||
bool aIsCrossSizeDefinite,
|
||||
const FlexboxAxisTracker& aAxisTracker);
|
||||
const FlexboxAxisTracker& aAxisTracker,
|
||||
const nscoord aCrossGapSize);
|
||||
|
||||
// Advances past the gap (if any) between two flex lines
|
||||
void TraverseGap() { mPosition += mCrossGapSize; }
|
||||
|
||||
// Advances past the packing space (if any) between two flex lines
|
||||
void TraversePackingSpace();
|
||||
|
|
@ -2288,6 +2329,8 @@ private:
|
|||
uint32_t mNumPackingSpacesRemaining;
|
||||
// XXX this should be uint16_t when we add explicit fallback handling
|
||||
uint8_t mAlignContent;
|
||||
|
||||
const nscoord mCrossGapSize;
|
||||
};
|
||||
|
||||
// Utility class for managing our position along the cross axis, *within* a
|
||||
|
|
@ -2581,14 +2624,12 @@ FlexLine::ResolveFlexibleLengths(nscoord aFlexContainerMainSize)
|
|||
}
|
||||
MOZ_ASSERT(!IsEmpty(), "empty lines should take the early-return above");
|
||||
|
||||
// Subtract space occupied by our items' margins/borders/padding, so we can
|
||||
// just be dealing with the space available for our flex items' content
|
||||
// boxes.
|
||||
nscoord spaceReservedForMarginBorderPadding =
|
||||
mTotalOuterHypotheticalMainSize - mTotalInnerHypotheticalMainSize;
|
||||
|
||||
// Subtract space occupied by our items' margins/borders/padding/gaps, so
|
||||
// we can just be dealing with the space available for our flex items'
|
||||
// content boxes.
|
||||
nscoord spaceAvailableForFlexItemsContentBoxes =
|
||||
aFlexContainerMainSize - spaceReservedForMarginBorderPadding;
|
||||
aFlexContainerMainSize - (mTotalInnerHypotheticalMainSize +
|
||||
GetSumOfGaps());
|
||||
|
||||
nscoord origAvailableFreeSpace;
|
||||
bool isOrigAvailFreeSpaceInitialized = false;
|
||||
|
|
@ -2867,6 +2908,9 @@ MainAxisPositionTracker::
|
|||
mNumAutoMarginsInMainAxis += item->GetNumAutoMarginsInAxis(mAxis);
|
||||
}
|
||||
|
||||
// Subtract space required for row/col gap from the remaining packing space
|
||||
mPackingSpaceRemaining -= aLine->GetSumOfGaps();
|
||||
|
||||
if (mPackingSpaceRemaining <= 0) {
|
||||
// No available packing space to use for resolving auto margins.
|
||||
mNumAutoMarginsInMainAxis = 0;
|
||||
|
|
@ -3014,12 +3058,14 @@ CrossAxisPositionTracker::
|
|||
const ReflowInput& aReflowInput,
|
||||
nscoord aContentBoxCrossSize,
|
||||
bool aIsCrossSizeDefinite,
|
||||
const FlexboxAxisTracker& aAxisTracker)
|
||||
const FlexboxAxisTracker& aAxisTracker,
|
||||
const nscoord aCrossGapSize)
|
||||
: PositionTracker(aAxisTracker.GetCrossAxis(),
|
||||
aAxisTracker.IsCrossAxisReversed()),
|
||||
mPackingSpaceRemaining(0),
|
||||
mNumPackingSpacesRemaining(0),
|
||||
mAlignContent(aReflowInput.mStylePosition->mAlignContent)
|
||||
mAlignContent(aReflowInput.mStylePosition->mAlignContent),
|
||||
mCrossGapSize(aCrossGapSize)
|
||||
{
|
||||
MOZ_ASSERT(aFirstLine, "null first line pointer");
|
||||
|
||||
|
|
@ -3072,6 +3118,11 @@ CrossAxisPositionTracker::
|
|||
numLines++;
|
||||
}
|
||||
|
||||
// Subtract space required for row/col gap from the remaining packing space
|
||||
MOZ_ASSERT(numLines >= 1,
|
||||
"GenerateFlexLines should've produced at least 1 line");
|
||||
mPackingSpaceRemaining -= aCrossGapSize * (numLines - 1);
|
||||
|
||||
// If packing space is negative, 'space-between' and 'stretch' behave like
|
||||
// 'flex-start', and 'space-around' and 'space-evenly' behave like 'center'.
|
||||
// In those cases, it's simplest to just pretend we have a different
|
||||
|
|
@ -3673,9 +3724,10 @@ FlexboxAxisTracker::InitAxesFromModernProps(
|
|||
// back depending on aShouldInsertAtFront), and returns a pointer to it.
|
||||
static FlexLine*
|
||||
AddNewFlexLineToList(LinkedList<FlexLine>& aLines,
|
||||
bool aShouldInsertAtFront)
|
||||
bool aShouldInsertAtFront,
|
||||
nscoord aMainGapSize)
|
||||
{
|
||||
FlexLine* newLine = new FlexLine();
|
||||
FlexLine* newLine = new FlexLine(aMainGapSize);
|
||||
if (aShouldInsertAtFront) {
|
||||
aLines.insertFront(newLine);
|
||||
} else {
|
||||
|
|
@ -3692,6 +3744,7 @@ nsFlexContainerFrame::GenerateFlexLines(
|
|||
nscoord aAvailableBSizeForContent,
|
||||
const nsTArray<StrutInfo>& aStruts,
|
||||
const FlexboxAxisTracker& aAxisTracker,
|
||||
nscoord aMainGapSize,
|
||||
nsTArray<nsIFrame*>& aPlaceholders, /* out */
|
||||
LinkedList<FlexLine>& aLines /* out */)
|
||||
{
|
||||
|
|
@ -3710,7 +3763,8 @@ nsFlexContainerFrame::GenerateFlexLines(
|
|||
|
||||
// We have at least one FlexLine. Even an empty flex container has a single
|
||||
// (empty) flex line.
|
||||
FlexLine* curLine = AddNewFlexLineToList(aLines, shouldInsertAtFront);
|
||||
FlexLine* curLine = AddNewFlexLineToList(aLines, shouldInsertAtFront,
|
||||
aMainGapSize);
|
||||
|
||||
nscoord wrapThreshold;
|
||||
if (isSingleLine) {
|
||||
|
|
@ -3759,7 +3813,8 @@ nsFlexContainerFrame::GenerateFlexLines(
|
|||
// Honor "page-break-before", if we're multi-line and this line isn't empty:
|
||||
if (!isSingleLine && !curLine->IsEmpty() &&
|
||||
childFrame->StyleDisplay()->mBreakBefore) {
|
||||
curLine = AddNewFlexLineToList(aLines, shouldInsertAtFront);
|
||||
curLine = AddNewFlexLineToList(aLines, shouldInsertAtFront,
|
||||
aMainGapSize);
|
||||
}
|
||||
|
||||
UniquePtr<FlexItem> item;
|
||||
|
|
@ -3782,11 +3837,16 @@ nsFlexContainerFrame::GenerateFlexLines(
|
|||
// Check if we need to wrap |item| to a new line
|
||||
// (i.e. check if its outer hypothetical main size pushes our line over
|
||||
// the threshold)
|
||||
if (wrapThreshold != NS_UNCONSTRAINEDSIZE &&
|
||||
!curLine->IsEmpty() && // No need to wrap at start of a line.
|
||||
wrapThreshold < (curLine->GetTotalOuterHypotheticalMainSize() +
|
||||
itemOuterHypotheticalMainSize)) {
|
||||
curLine = AddNewFlexLineToList(aLines, shouldInsertAtFront);
|
||||
// Don't wrap if unconstrained and if this will be line's first item.
|
||||
if (wrapThreshold != NS_UNCONSTRAINEDSIZE && !curLine->IsEmpty()) {
|
||||
nscoord newOuterSize = curLine->GetTotalOuterHypotheticalMainSize() +
|
||||
itemOuterHypotheticalMainSize;
|
||||
// Account for gap between this line's previous item and this item
|
||||
newOuterSize += aMainGapSize;
|
||||
if (newOuterSize == nscoord_MAX || newOuterSize > wrapThreshold) {
|
||||
curLine = AddNewFlexLineToList(aLines, shouldInsertAtFront,
|
||||
aMainGapSize);
|
||||
}
|
||||
}
|
||||
|
||||
// Add item to current flex line (and update the line's bookkeeping about
|
||||
|
|
@ -3798,7 +3858,8 @@ nsFlexContainerFrame::GenerateFlexLines(
|
|||
// Honor "page-break-after", if we're multi-line and have more children:
|
||||
if (!isSingleLine && childFrame->GetNextSibling() &&
|
||||
childFrame->StyleDisplay()->mBreakAfter) {
|
||||
curLine = AddNewFlexLineToList(aLines, shouldInsertAtFront);
|
||||
curLine = AddNewFlexLineToList(aLines, shouldInsertAtFront,
|
||||
aMainGapSize);
|
||||
}
|
||||
itemIdxInContainer++;
|
||||
}
|
||||
|
|
@ -3990,6 +4051,9 @@ FlexLine::PositionItemsInMainAxis(uint8_t aJustifyContent,
|
|||
mainAxisPosnTracker.ExitChildFrame(itemMainBorderBoxSize);
|
||||
mainAxisPosnTracker.ExitMargin(item->GetMargin());
|
||||
mainAxisPosnTracker.TraversePackingSpace();
|
||||
if (item->getNext()) {
|
||||
mainAxisPosnTracker.TraverseGap(mMainGapSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4178,16 +4242,37 @@ nsFlexContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||
nscoord contentBoxMainSize = GetMainSizeFromReflowInput(aReflowInput,
|
||||
axisTracker);
|
||||
|
||||
// Calculate gap size for main and cross axis
|
||||
nscoord mainGapSize;
|
||||
nscoord crossGapSize;
|
||||
if (axisTracker.IsRowOriented()) {
|
||||
mainGapSize = nsLayoutUtils::ResolveGapToLength(stylePos->mColumnGap,
|
||||
contentBoxMainSize);
|
||||
crossGapSize =
|
||||
nsLayoutUtils::ResolveGapToLength(stylePos->mRowGap,
|
||||
GetEffectiveComputedBSize(aReflowInput));
|
||||
} else {
|
||||
mainGapSize = nsLayoutUtils::ResolveGapToLength(stylePos->mRowGap,
|
||||
contentBoxMainSize);
|
||||
NS_WARNING_ASSERTION(aReflowInput.ComputedISize() != NS_UNCONSTRAINEDSIZE,
|
||||
"Unconstrained inline size; this should only result "
|
||||
"from huge sizes (not intrinsic sizing w/ orthogonal "
|
||||
"flows)");
|
||||
crossGapSize =
|
||||
nsLayoutUtils::ResolveGapToLength(stylePos->mColumnGap,
|
||||
aReflowInput.ComputedISize());
|
||||
}
|
||||
|
||||
AutoTArray<StrutInfo, 1> struts;
|
||||
DoFlexLayout(aPresContext, aDesiredSize, aReflowInput, aStatus,
|
||||
contentBoxMainSize, availableBSizeForContent,
|
||||
struts, axisTracker);
|
||||
struts, axisTracker, mainGapSize, crossGapSize);
|
||||
|
||||
if (!struts.IsEmpty()) {
|
||||
// We're restarting flex layout, with new knowledge of collapsed items.
|
||||
DoFlexLayout(aPresContext, aDesiredSize, aReflowInput, aStatus,
|
||||
contentBoxMainSize, availableBSizeForContent,
|
||||
struts, axisTracker);
|
||||
struts, axisTracker, mainGapSize, crossGapSize);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4312,7 +4397,9 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
|||
nscoord aContentBoxMainSize,
|
||||
nscoord aAvailableBSizeForContent,
|
||||
nsTArray<StrutInfo>& aStruts,
|
||||
const FlexboxAxisTracker& aAxisTracker)
|
||||
const FlexboxAxisTracker& aAxisTracker,
|
||||
nscoord aMainGapSize,
|
||||
nscoord aCrossGapSize)
|
||||
{
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
|
||||
|
|
@ -4324,6 +4411,7 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
|||
aContentBoxMainSize,
|
||||
aAvailableBSizeForContent,
|
||||
aStruts, aAxisTracker,
|
||||
aMainGapSize,
|
||||
placeholderKids, lines);
|
||||
|
||||
if (lines.getFirst()->IsEmpty() &&
|
||||
|
|
@ -4385,6 +4473,11 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
|||
// Now that we've finished with this line's items, size the line itself:
|
||||
line->ComputeCrossSizeAndBaseline(aAxisTracker);
|
||||
sumLineCrossSizes += line->GetLineCrossSize();
|
||||
|
||||
// Add the cross axis gap space if this is not the last line
|
||||
if (line->getNext()) {
|
||||
sumLineCrossSizes += aCrossGapSize;
|
||||
}
|
||||
}
|
||||
|
||||
bool isCrossSizeDefinite;
|
||||
|
|
@ -4397,7 +4490,8 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
|||
CrossAxisPositionTracker
|
||||
crossAxisPosnTracker(lines.getFirst(),
|
||||
aReflowInput, contentBoxCrossSize,
|
||||
isCrossSizeDefinite, aAxisTracker);
|
||||
isCrossSizeDefinite, aAxisTracker,
|
||||
aCrossGapSize);
|
||||
|
||||
// Now that we know the cross size of each line (including
|
||||
// "align-content:stretch" adjustments, from the CrossAxisPositionTracker
|
||||
|
|
@ -4447,6 +4541,10 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
|||
aAxisTracker);
|
||||
crossAxisPosnTracker.TraverseLine(*line);
|
||||
crossAxisPosnTracker.TraversePackingSpace();
|
||||
|
||||
if (line->getNext()) {
|
||||
crossAxisPosnTracker.TraverseGap();
|
||||
}
|
||||
}
|
||||
|
||||
// If the container should derive its baseline from the last FlexLine,
|
||||
|
|
@ -4817,33 +4915,70 @@ nsFlexContainerFrame::ReflowPlaceholders(nsPresContext* aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
nscoord
|
||||
nsFlexContainerFrame::GetIntrinsicISize(nsRenderingContext* aRenderingContext,
|
||||
IntrinsicISizeType aType)
|
||||
{
|
||||
nscoord containerISize = 0;
|
||||
RenumberList();
|
||||
|
||||
const nsStylePosition* stylePos = StylePosition();
|
||||
const FlexboxAxisTracker axisTracker(this, GetWritingMode());
|
||||
|
||||
nscoord mainGapSize;
|
||||
if (axisTracker.IsRowOriented()) {
|
||||
mainGapSize = nsLayoutUtils::ResolveGapToLength(stylePos->mColumnGap,
|
||||
NS_UNCONSTRAINEDSIZE);
|
||||
} else {
|
||||
mainGapSize = nsLayoutUtils::ResolveGapToLength(stylePos->mRowGap,
|
||||
NS_UNCONSTRAINEDSIZE);
|
||||
}
|
||||
|
||||
// The loop below sets aside space for a gap before each item besides the
|
||||
// first. This bool helps us handle that special-case.
|
||||
bool onFirstChild = true;
|
||||
|
||||
for (nsIFrame* childFrame : mFrames) {
|
||||
// Skip out-of-flow children because they don't participate in flex layout.
|
||||
if (childFrame->GetType() == nsGkAtoms::placeholderFrame) {
|
||||
continue;
|
||||
}
|
||||
|
||||
nscoord childISize = nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, childFrame, aType);
|
||||
// * For a row-oriented single-line flex container, the intrinsic
|
||||
// {min/pref}-isize is the sum of its items' {min/pref}-isizes and
|
||||
// (n-1) column gaps.
|
||||
// * For a column-oriented flex container, the intrinsic min isize
|
||||
// is the max of its items' min isizes.
|
||||
// * For a row-oriented multi-line flex container, the intrinsic
|
||||
// pref isize is former (sum), and its min isize is the latter (max).
|
||||
bool isSingleLine = (NS_STYLE_FLEX_WRAP_NOWRAP == stylePos->mFlexWrap);
|
||||
if (axisTracker.IsRowOriented() &&
|
||||
(isSingleLine || aType == nsLayoutUtils::PREF_ISIZE)) {
|
||||
containerISize += childISize;
|
||||
if (!onFirstChild) {
|
||||
containerISize += mainGapSize;
|
||||
}
|
||||
onFirstChild = false;
|
||||
} else {
|
||||
// col-oriented, or MIN_ISIZE for multi-line row flex container
|
||||
containerISize = std::max(containerISize, childISize);
|
||||
}
|
||||
}
|
||||
|
||||
return containerISize;
|
||||
}
|
||||
|
||||
/* virtual */ nscoord
|
||||
nsFlexContainerFrame::GetMinISize(nsRenderingContext* aRenderingContext)
|
||||
{
|
||||
nscoord minISize = 0;
|
||||
DISPLAY_MIN_WIDTH(this, minISize);
|
||||
|
||||
RenumberList();
|
||||
// TODO: See bug 1454822
|
||||
minISize = GetIntrinsicISize(aRenderingContext, nsLayoutUtils::MIN_ISIZE);
|
||||
|
||||
const nsStylePosition* stylePos = StylePosition();
|
||||
const FlexboxAxisTracker axisTracker(this, GetWritingMode());
|
||||
|
||||
for (nsIFrame* childFrame : mFrames) {
|
||||
nscoord childMinISize =
|
||||
nsLayoutUtils::IntrinsicForContainer(aRenderingContext, childFrame,
|
||||
nsLayoutUtils::MIN_ISIZE);
|
||||
// For a horizontal single-line flex container, the intrinsic min
|
||||
// isize is the sum of its items' min isizes.
|
||||
// For a column-oriented flex container, or for a multi-line row-
|
||||
// oriented flex container, the intrinsic min isize is the max of
|
||||
// its items' min isizes.
|
||||
if (axisTracker.IsRowOriented() &&
|
||||
NS_STYLE_FLEX_WRAP_NOWRAP == stylePos->mFlexWrap) {
|
||||
minISize += childMinISize;
|
||||
} else {
|
||||
minISize = std::max(minISize, childMinISize);
|
||||
}
|
||||
}
|
||||
return minISize;
|
||||
}
|
||||
|
||||
|
|
@ -4853,24 +4988,8 @@ nsFlexContainerFrame::GetPrefISize(nsRenderingContext* aRenderingContext)
|
|||
nscoord prefISize = 0;
|
||||
DISPLAY_PREF_WIDTH(this, prefISize);
|
||||
|
||||
RenumberList();
|
||||
// TODO: See bug 1454822
|
||||
prefISize = GetIntrinsicISize(aRenderingContext, nsLayoutUtils::PREF_ISIZE);
|
||||
|
||||
// XXXdholbert Optimization: We could cache our intrinsic widths like
|
||||
// nsBlockFrame does (and return it early from this function if it's set).
|
||||
// Whenever anything happens that might change it, set it to
|
||||
// NS_INTRINSIC_WIDTH_UNKNOWN (like nsBlockFrame::MarkIntrinsicISizesDirty
|
||||
// does)
|
||||
const FlexboxAxisTracker axisTracker(this, GetWritingMode());
|
||||
|
||||
for (nsIFrame* childFrame : mFrames) {
|
||||
nscoord childPrefISize =
|
||||
nsLayoutUtils::IntrinsicForContainer(aRenderingContext, childFrame,
|
||||
nsLayoutUtils::PREF_ISIZE);
|
||||
if (axisTracker.IsRowOriented()) {
|
||||
prefISize += childPrefISize;
|
||||
} else {
|
||||
prefISize = std::max(prefISize, childPrefISize);
|
||||
}
|
||||
}
|
||||
return prefISize;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,6 +72,9 @@ public:
|
|||
const ReflowInput& aReflowInput,
|
||||
nsReflowStatus& aStatus) override;
|
||||
|
||||
nscoord GetIntrinsicISize(nsRenderingContext* aRenderingContext,
|
||||
nsLayoutUtils::IntrinsicISizeType aType);
|
||||
|
||||
virtual nscoord
|
||||
GetMinISize(nsRenderingContext* aRenderingContext) override;
|
||||
virtual nscoord
|
||||
|
|
@ -160,7 +163,9 @@ protected:
|
|||
nscoord aContentBoxMainSize,
|
||||
nscoord aAvailableBSizeForContent,
|
||||
nsTArray<StrutInfo>& aStruts,
|
||||
const FlexboxAxisTracker& aAxisTracker);
|
||||
const FlexboxAxisTracker& aAxisTracker,
|
||||
nscoord aMainGapSize,
|
||||
nscoord aCrossGapSize);
|
||||
|
||||
/**
|
||||
* Checks whether our child-frame list "mFrames" is sorted, using the given
|
||||
|
|
@ -244,6 +249,7 @@ protected:
|
|||
nscoord aAvailableBSizeForContent,
|
||||
const nsTArray<StrutInfo>& aStruts,
|
||||
const FlexboxAxisTracker& aAxisTracker,
|
||||
nscoord aMainGapSize,
|
||||
nsTArray<nsIFrame*>& aPlaceholders,
|
||||
mozilla::LinkedList<FlexLine>& aLines);
|
||||
|
||||
|
|
|
|||
|
|
@ -4635,6 +4635,61 @@ nsFrame::GetIntrinsicRatio()
|
|||
return AspectRatio();
|
||||
}
|
||||
|
||||
void
|
||||
nsFrame::SetCoordToFlexBasis(bool aIsInlineFlexItem,
|
||||
bool aIntrinsic,
|
||||
const nsStyleCoord* aFlexBasis,
|
||||
const nsStyleCoord** aInlineStyle,
|
||||
const nsStyleCoord** aBlockStyle)
|
||||
{
|
||||
auto mainAxisCoord = aIsInlineFlexItem ?
|
||||
aInlineStyle :
|
||||
aBlockStyle;
|
||||
// NOTE: If we're a table-wrapper frame, we skip this clause and just stick
|
||||
// with 'main-size:auto' behavior (which -- unlike 'content'
|
||||
// i.e. 'max-content' -- will give us the ability to honor percent sizes on
|
||||
// our table-box child when resolving the flex base size). The flexbox spec
|
||||
// doesn't call for this special case, but webcompat & regression-avoidance
|
||||
// seems to require it, for the time being... Tables sure are special.
|
||||
bool isTableWrapperFrame = GetType() == nsGkAtoms::tableWrapperFrame;
|
||||
// We have a used flex-basis of 'content' if flex-basis explicitly has that
|
||||
// value, OR if flex-basis is 'auto' (deferring to the main-size property)
|
||||
// and the main-size property is also 'auto'.
|
||||
// See https://drafts.csswg.org/css-flexbox-1/#valdef-flex-basis-auto
|
||||
if ((aFlexBasis->GetUnit() == eStyleUnit_Enumerated &&
|
||||
aFlexBasis->GetIntValue() == NS_STYLE_FLEX_BASIS_CONTENT) ||
|
||||
(aFlexBasis->GetUnit() == eStyleUnit_Auto &&
|
||||
(*mainAxisCoord)->GetUnit() == eStyleUnit_Auto)) {
|
||||
// If we get here, we're resolving the flex base size for a flex item,
|
||||
// and we fall into the flexbox spec section 9.2 step 3, substep C (if
|
||||
// we have a definite cross size) or E (if not). And specifically:
|
||||
//
|
||||
// * If we have a definite cross size, we're supposed to resolve our
|
||||
// main-size based on that and our intrinsic ratio.
|
||||
// * Otherwise, we're supposed to produce our max-content size.
|
||||
//
|
||||
// Conveniently, we can handle both of those scenarios (regardless of
|
||||
// which substep we fall into) by using the 'auto' keyword for our
|
||||
// main-axis coordinate here. (This makes sense, because the spec is
|
||||
// effectively trying to produce the 'auto' sizing behavior).
|
||||
if (aIntrinsic || MOZ_LIKELY(isTableWrapperFrame)) {
|
||||
static const nsStyleCoord autoStyleCoord(eStyleUnit_Auto);
|
||||
*mainAxisCoord = &autoStyleCoord;
|
||||
} else {
|
||||
// (Note: if our main axis is the block axis, then this 'max-content'
|
||||
// value will be treated like 'auto', via the IsAutoBSize() call below.)
|
||||
static const nsStyleCoord maxContStyleCoord(NS_STYLE_WIDTH_MAX_CONTENT,
|
||||
eStyleUnit_Enumerated);
|
||||
*mainAxisCoord = &maxContStyleCoord;
|
||||
}
|
||||
} else if (aFlexBasis->GetUnit() != eStyleUnit_Auto) {
|
||||
// For all other non-'auto' flex-basis values, we just swap in the
|
||||
// flex-basis itself for the main-size property.
|
||||
*mainAxisCoord = aFlexBasis;
|
||||
} // else: flex-basis is 'auto', which is deferring to some explicit
|
||||
// value in mainAxisCoord. So we proceed w/o touching mainAxisCoord.
|
||||
}
|
||||
|
||||
/* virtual */
|
||||
LogicalSize
|
||||
nsFrame::ComputeSize(nsRenderingContext* aRenderingContext,
|
||||
|
|
@ -4689,35 +4744,14 @@ nsFrame::ComputeSize(nsRenderingContext* aRenderingContext,
|
|||
!(GetStateBits() & NS_FRAME_OUT_OF_FLOW));
|
||||
bool isInlineFlexItem = false;
|
||||
if (isFlexItem) {
|
||||
// Flex items use their "flex-basis" property in place of their main-size
|
||||
// property (e.g. "width") for sizing purposes, *unless* they have
|
||||
// "flex-basis:auto", in which case they use their main-size property after
|
||||
// all.
|
||||
uint32_t flexDirection = GetParent()->StylePosition()->mFlexDirection;
|
||||
isInlineFlexItem =
|
||||
flexDirection == NS_STYLE_FLEX_DIRECTION_ROW ||
|
||||
flexDirection == NS_STYLE_FLEX_DIRECTION_ROW_REVERSE;
|
||||
|
||||
// NOTE: The logic here should match the similar chunk for determining
|
||||
// inlineStyleCoord and blockStyleCoord in
|
||||
// nsFrame::ComputeSizeWithIntrinsicDimensions().
|
||||
const nsStyleCoord* flexBasis = &(stylePos->mFlexBasis);
|
||||
if (flexBasis->GetUnit() != eStyleUnit_Auto) {
|
||||
if (isInlineFlexItem) {
|
||||
inlineStyleCoord = flexBasis;
|
||||
} else {
|
||||
// One caveat for vertical flex items: We don't support enumerated
|
||||
// values (e.g. "max-content") for height properties yet. So, if our
|
||||
// computed flex-basis is an enumerated value, we'll just behave as if
|
||||
// it were "auto", which means "use the main-size property after all"
|
||||
// (which is "height", in this case).
|
||||
// NOTE: Once we support intrinsic sizing keywords for "height",
|
||||
// we should remove this check.
|
||||
if (flexBasis->GetUnit() != eStyleUnit_Enumerated) {
|
||||
blockStyleCoord = flexBasis;
|
||||
}
|
||||
}
|
||||
}
|
||||
SetCoordToFlexBasis(isInlineFlexItem, false, flexBasis,
|
||||
&inlineStyleCoord, &blockStyleCoord);
|
||||
}
|
||||
|
||||
// Compute inline-axis size
|
||||
|
|
@ -4949,31 +4983,10 @@ nsFrame::ComputeSizeWithIntrinsicDimensions(nsRenderingContext* aRenderingConte
|
|||
} else {
|
||||
blockStyleCoord = imposedMainSizeStyleCoord.ptr();
|
||||
}
|
||||
|
||||
} else {
|
||||
// Flex items use their "flex-basis" property in place of their main-size
|
||||
// property (e.g. "width") for sizing purposes, *unless* they have
|
||||
// "flex-basis:auto", in which case they use their main-size property
|
||||
// after all.
|
||||
// NOTE: The logic here should match the similar chunk for determining
|
||||
// inlineStyleCoord and blockStyleCoord in nsFrame::ComputeSize().
|
||||
const nsStyleCoord* flexBasis = &(stylePos->mFlexBasis);
|
||||
if (flexBasis->GetUnit() != eStyleUnit_Auto) {
|
||||
if (isInlineFlexItem) {
|
||||
inlineStyleCoord = flexBasis;
|
||||
} else {
|
||||
// One caveat for vertical flex items: We don't support enumerated
|
||||
// values (e.g. "max-content") for height properties yet. So, if our
|
||||
// computed flex-basis is an enumerated value, we'll just behave as if
|
||||
// it were "auto", which means "use the main-size property after all"
|
||||
// (which is "height", in this case).
|
||||
// NOTE: Once we support intrinsic sizing keywords for "height",
|
||||
// we should remove this check.
|
||||
if (flexBasis->GetUnit() != eStyleUnit_Enumerated) {
|
||||
blockStyleCoord = flexBasis;
|
||||
}
|
||||
}
|
||||
}
|
||||
SetCoordToFlexBasis(isInlineFlexItem, true, flexBasis,
|
||||
&inlineStyleCoord, &blockStyleCoord);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -266,6 +266,17 @@ public:
|
|||
virtual mozilla::IntrinsicSize GetIntrinsicSize() override;
|
||||
virtual mozilla::AspectRatio GetIntrinsicRatio() override;
|
||||
|
||||
/**
|
||||
* Helper function for determining if flex items should use their
|
||||
* 'flex-basis' property instead of their main-size property, such
|
||||
* as 'width', for sizing purposes.
|
||||
*/
|
||||
void SetCoordToFlexBasis(bool aIsInlineFlexItem,
|
||||
bool aIntrinsic,
|
||||
const nsStyleCoord* aFlexBasis,
|
||||
const nsStyleCoord** aInlineStyle,
|
||||
const nsStyleCoord** aBlockStyle);
|
||||
|
||||
virtual mozilla::LogicalSize
|
||||
ComputeSize(nsRenderingContext* aRenderingContext,
|
||||
mozilla::WritingMode aWM,
|
||||
|
|
@ -295,7 +306,7 @@ public:
|
|||
// Compute tight bounds assuming this frame honours its border, background
|
||||
// and outline, its children's tight bounds, and nothing else.
|
||||
nsRect ComputeSimpleTightBounds(mozilla::gfx::DrawTarget* aDrawTarget) const;
|
||||
|
||||
|
||||
/**
|
||||
* A helper, used by |nsFrame::ComputeSize| (for frames that need to
|
||||
* override only this part of ComputeSize), that computes the size
|
||||
|
|
|
|||
|
|
@ -2622,9 +2622,9 @@ nsGridContainerFrame::GridReflowInput::CalculateTrackSizes(
|
|||
const LogicalSize& aContentBox,
|
||||
SizingConstraint aConstraint)
|
||||
{
|
||||
mCols.Initialize(mColFunctions, mGridStyle->mGridColumnGap,
|
||||
mCols.Initialize(mColFunctions, mGridStyle->mColumnGap,
|
||||
aGrid.mGridColEnd, aContentBox.ISize(mWM));
|
||||
mRows.Initialize(mRowFunctions, mGridStyle->mGridRowGap,
|
||||
mRows.Initialize(mRowFunctions, mGridStyle->mRowGap,
|
||||
aGrid.mGridRowEnd, aContentBox.BSize(mWM));
|
||||
|
||||
mCols.CalculateSizes(*this, mGridItems, mColFunctions,
|
||||
|
|
@ -3378,7 +3378,7 @@ nsGridContainerFrame::Grid::PlaceGridItems(GridReflowInput& aState,
|
|||
// to a 0,0 based grid after placing definite lines.
|
||||
auto areas = gridStyle->mGridTemplateAreas.get();
|
||||
uint32_t numRepeatCols = aState.mColFunctions.InitRepeatTracks(
|
||||
gridStyle->mGridColumnGap,
|
||||
gridStyle->mColumnGap,
|
||||
aComputedMinSize.ISize(aState.mWM),
|
||||
aComputedSize.ISize(aState.mWM),
|
||||
aComputedMaxSize.ISize(aState.mWM));
|
||||
|
|
@ -3387,7 +3387,7 @@ nsGridContainerFrame::Grid::PlaceGridItems(GridReflowInput& aState,
|
|||
LineNameMap colLineNameMap(gridStyle->mGridTemplateColumns, numRepeatCols);
|
||||
|
||||
uint32_t numRepeatRows = aState.mRowFunctions.InitRepeatTracks(
|
||||
gridStyle->mGridRowGap,
|
||||
gridStyle->mRowGap,
|
||||
aComputedMinSize.BSize(aState.mWM),
|
||||
aComputedSize.BSize(aState.mWM),
|
||||
aComputedMaxSize.BSize(aState.mWM));
|
||||
|
|
@ -6214,6 +6214,11 @@ nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||
computedISize, bSize);
|
||||
|
||||
if (!prevInFlow) {
|
||||
if (computedBSize == NS_AUTOHEIGHT && stylePos->mRowGap.HasPercent()) {
|
||||
// Re-resolve the row-gap now that we know our intrinsic block-size.
|
||||
gridReflowInput.mRows.mGridGap =
|
||||
nsLayoutUtils::ResolveGapToLength(stylePos->mRowGap, bSize);
|
||||
}
|
||||
// Apply 'align/justify-content' to the grid.
|
||||
// CalculateTrackSizes did the columns.
|
||||
gridReflowInput.mRows.AlignJustifyContent(stylePos, wm, contentArea.Size(wm));
|
||||
|
|
@ -6585,7 +6590,7 @@ nsGridContainerFrame::IntrinsicISize(nsRenderingContext* aRenderingContext,
|
|||
if (grid.mGridColEnd == 0) {
|
||||
return 0;
|
||||
}
|
||||
state.mCols.Initialize(state.mColFunctions, state.mGridStyle->mGridColumnGap,
|
||||
state.mCols.Initialize(state.mColFunctions, state.mGridStyle->mColumnGap,
|
||||
grid.mGridColEnd, NS_UNCONSTRAINEDSIZE);
|
||||
auto constraint = aType == nsLayoutUtils::MIN_ISIZE ?
|
||||
SizingConstraint::eMinContent : SizingConstraint::eMaxContent;
|
||||
|
|
@ -6593,7 +6598,7 @@ nsGridContainerFrame::IntrinsicISize(nsRenderingContext* aRenderingContext,
|
|||
NS_UNCONSTRAINEDSIZE, &GridArea::mCols,
|
||||
constraint);
|
||||
state.mCols.mGridGap =
|
||||
nsLayoutUtils::ResolveGapToLength(state.mGridStyle->mGridColumnGap,
|
||||
nsLayoutUtils::ResolveGapToLength(state.mGridStyle->mColumnGap,
|
||||
NS_UNCONSTRAINEDSIZE);
|
||||
nscoord length = 0;
|
||||
for (const TrackSize& sz : state.mCols.mSizes) {
|
||||
|
|
|
|||
|
|
@ -1841,7 +1841,7 @@ fuzzy-if(skiaContent,1,24000) == 1025914-1.html 1025914-1-ref.html
|
|||
== 1050493-1.html 1050493-1-ref.html
|
||||
== 1050788-1.html about:blank
|
||||
== 1053035-1-flex.html 1053035-1-ref.html
|
||||
test-pref(layout.css.grid.enabled,true) == 1053035-1-grid.html 1053035-1-ref.html
|
||||
== 1053035-1-grid.html 1053035-1-ref.html
|
||||
== 1059167-1.html 1059167-1-ref.html
|
||||
== 1059498-1.html 1059498-1-ref.html
|
||||
== 1059498-2.html 1059498-1-ref.html
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ br { clear: both; }
|
|||
</div>
|
||||
|
||||
<div class="float">
|
||||
<div class="grid" style="width:60px; height:60px; grid-column-gap:12px">
|
||||
<div class="grid" style="width:60px; height:60px; gap:12px">
|
||||
<span><x></x></span>
|
||||
<span><x></x></span>
|
||||
<span><x></x></span>
|
||||
|
|
@ -74,7 +74,7 @@ br { clear: both; }
|
|||
</div>
|
||||
|
||||
<div class="inline-grid">
|
||||
<div class="grid" style="width:60px; height:60px; grid-column-gap:12px; align-self:start; justify-self:start;">
|
||||
<div class="grid" style="width:60px; height:60px; gap:12px; align-self:start; justify-self:start;">
|
||||
<span><x></x></span>
|
||||
<span><x></x></span>
|
||||
<span><x></x></span>
|
||||
|
|
@ -142,7 +142,7 @@ br { clear: both; }
|
|||
</div>
|
||||
|
||||
<div class="float" style="margin-top:-50px; width:62px">
|
||||
<div class="grid" style="padding-left:186px; height:60px; grid-column-gap:calc(186px * 0.2);">
|
||||
<div class="grid" style="padding-left:186px; height:60px; gap:12px calc(186px * 0.2);">
|
||||
<span style="margin-left:-186px; width:30px"><x></x></span>
|
||||
<span style="margin-left:-186px; width:30px"><x></x></span>
|
||||
<span style="margin-left:-186px; width:30px"><x></x></span>
|
||||
|
|
|
|||
|
|
@ -83,15 +83,18 @@ fill,fit {
|
|||
|
||||
.zero-progress {
|
||||
grid-row-gap: calc(10px - 1%);
|
||||
grid-template-rows: [a] 10px repeat(3, [b] 0 [c]) [d];
|
||||
grid-template-rows: [a] 10px repeat(3, [b] calc(4px / 10) [c]) [d];
|
||||
height:40px;
|
||||
}
|
||||
.w50.zero-progress {
|
||||
grid-row-gap: calc(10px - 1%);
|
||||
grid-template-rows: [a] 10px repeat(3, [b] 0 [c]) [d];
|
||||
height:50px;
|
||||
}
|
||||
.mw50.zero-progress {
|
||||
grid-row-gap: calc(10px - 1%);
|
||||
grid-template-rows: [a] 10px repeat(4, [b] 0 [c]) [d];
|
||||
grid-template-rows: [a] 10px repeat(4, [b] calc(5px / 10) [c]) [d];
|
||||
height:50px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
default-preferences pref(layout.css.grid.enabled,true)
|
||||
|
||||
fails == grid-whitespace-handling-1a.xhtml grid-whitespace-handling-1-ref.xhtml
|
||||
fails == grid-whitespace-handling-1b.xhtml grid-whitespace-handling-1-ref.xhtml
|
||||
== grid-whitespace-handling-2.xhtml grid-whitespace-handling-2-ref.xhtml
|
||||
|
|
|
|||
64
layout/reftests/flexbox/flexbox-table-flex-items-2-ref.html
Normal file
64
layout/reftests/flexbox/flexbox-table-flex-items-2-ref.html
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Reftest Reference</title>
|
||||
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#flex-base-size">
|
||||
<style>
|
||||
.container {
|
||||
display: flex;
|
||||
width: 100px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
||||
/* Two types of flex items: */
|
||||
.table {
|
||||
border: 2px solid teal;
|
||||
}
|
||||
.block {
|
||||
border: 2px solid brown;
|
||||
}
|
||||
|
||||
/* Each flex item gets one of these as its contents,
|
||||
to have a nonzero content size: */
|
||||
ib {
|
||||
display: inline-block;
|
||||
background: blue;
|
||||
border: 1px solid gray;
|
||||
width: 15px;
|
||||
height: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- auto size: -->
|
||||
<div class="container">
|
||||
<div class="table"><ib></ib></div>
|
||||
<div class="block"><ib></ib></div>
|
||||
</div>
|
||||
|
||||
<!-- px size: -->
|
||||
<div class="container">
|
||||
<div class="table" style="width: 30px"><ib></ib></div>
|
||||
<div class="block" style="width: 30px"><ib></ib></div>
|
||||
</div>
|
||||
|
||||
<!-- % size: -->
|
||||
<div class="container">
|
||||
<div class="table" style="width: 30%"><ib></ib></div>
|
||||
<div class="block" style="width: 30%"><ib></ib></div>
|
||||
</div>
|
||||
|
||||
<!-- calc() size: -->
|
||||
<div class="container">
|
||||
<div class="table" style="width: calc(10px + 20%)"><ib></ib></div>
|
||||
<div class="block" style="width: calc(10px + 20%)"><ib></ib></div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
73
layout/reftests/flexbox/flexbox-table-flex-items-2.html
Normal file
73
layout/reftests/flexbox/flexbox-table-flex-items-2.html
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
CSS Test: Testing that implicit "flex-basis: content" on table wrapper box
|
||||
doesn't prevent explicit table size from influencing flex base size.
|
||||
</title>
|
||||
<!-- XXXdholbert NOTE: This probably eventually should move to our
|
||||
upstreamed reftest directory. But for now, this is just asserting
|
||||
backwards-compatible/interoperable (but not necessary spec-compliant)
|
||||
behavior, per https://github.com/w3c/csswg-drafts/issues/2604 -->
|
||||
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#flex-base-size">
|
||||
<link rel="match" href="flexbox-table-flex-items-2.html">
|
||||
<style>
|
||||
.container {
|
||||
display: flex;
|
||||
width: 100px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
||||
/* Two types of flex items: */
|
||||
.table {
|
||||
display: table;
|
||||
border: 2px solid teal;
|
||||
}
|
||||
.block {
|
||||
border: 2px solid brown;
|
||||
}
|
||||
|
||||
/* Each flex item gets one of these as its contents,
|
||||
to have a nonzero content size: */
|
||||
ib {
|
||||
display: inline-block;
|
||||
background: blue;
|
||||
border: 1px solid gray;
|
||||
width: 15px;
|
||||
height: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- auto size: -->
|
||||
<div class="container">
|
||||
<div class="table"><ib></ib></div>
|
||||
<div class="block"><ib></ib></div>
|
||||
</div>
|
||||
|
||||
<!-- px size: -->
|
||||
<div class="container">
|
||||
<div class="table" style="width: 30px"><ib></ib></div>
|
||||
<div class="block" style="width: 30px"><ib></ib></div>
|
||||
</div>
|
||||
|
||||
<!-- % size: -->
|
||||
<div class="container">
|
||||
<div class="table" style="width: 30%"><ib></ib></div>
|
||||
<div class="block" style="width: 30%"><ib></ib></div>
|
||||
</div>
|
||||
|
||||
<!-- calc() size: -->
|
||||
<div class="container">
|
||||
<div class="table" style="width: calc(10px + 20%)"><ib></ib></div>
|
||||
<div class="block" style="width: calc(10px + 20%)"><ib></ib></div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
66
layout/reftests/flexbox/flexbox-table-flex-items-3-ref.html
Normal file
66
layout/reftests/flexbox/flexbox-table-flex-items-3-ref.html
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Reftest Reference</title>
|
||||
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#flex-base-size">
|
||||
<style>
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100px;
|
||||
float: left;
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
||||
/* Two types of flex items: */
|
||||
.table {
|
||||
border: 2px solid teal;
|
||||
}
|
||||
.block {
|
||||
border: 2px solid brown;
|
||||
}
|
||||
|
||||
/* Each flex item gets one of these as its contents,
|
||||
to have a nonzero content size: */
|
||||
ib {
|
||||
display: inline-block;
|
||||
background: blue;
|
||||
border: 1px solid gray;
|
||||
width: 15px;
|
||||
height: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- auto size: -->
|
||||
<div class="container">
|
||||
<div class="table"><ib></ib></div>
|
||||
<div class="block"><ib></ib></div>
|
||||
</div>
|
||||
|
||||
<!-- px size: -->
|
||||
<div class="container">
|
||||
<div class="table" style="height: 30px"><ib></ib></div>
|
||||
<div class="block" style="height: 30px"><ib></ib></div>
|
||||
</div>
|
||||
|
||||
<!-- % size: -->
|
||||
<div class="container">
|
||||
<div class="table" style="height: 30%"><ib></ib></div>
|
||||
<div class="block" style="height: 30%"><ib></ib></div>
|
||||
</div>
|
||||
|
||||
<!-- calc() size: -->
|
||||
<div class="container">
|
||||
<div class="table" style="height: calc(10px + 20%)"><ib></ib></div>
|
||||
<div class="block" style="height: calc(10px + 20%)"><ib></ib></div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
75
layout/reftests/flexbox/flexbox-table-flex-items-3.html
Normal file
75
layout/reftests/flexbox/flexbox-table-flex-items-3.html
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
CSS Test: Testing that implicit "flex-basis: content" on table wrapper box
|
||||
doesn't prevent explicit table size from influencing flex base size.
|
||||
</title>
|
||||
<!-- XXXdholbert NOTE: This probably eventually should move to our
|
||||
upstreamed reftest directory. But for now, this is just asserting
|
||||
backwards-compatible/interoperable (but not necessary spec-compliant)
|
||||
behavior, per https://github.com/w3c/csswg-drafts/issues/2604 -->
|
||||
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#flex-base-size">
|
||||
<link rel="match" href="flexbox-table-flex-items-3.html">
|
||||
<style>
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100px;
|
||||
float: left;
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
||||
/* Two types of flex items: */
|
||||
.table {
|
||||
display: table;
|
||||
border: 2px solid teal;
|
||||
}
|
||||
.block {
|
||||
border: 2px solid brown;
|
||||
}
|
||||
|
||||
/* Each flex item gets one of these as its contents,
|
||||
to have a nonzero content size: */
|
||||
ib {
|
||||
display: inline-block;
|
||||
background: blue;
|
||||
border: 1px solid gray;
|
||||
width: 15px;
|
||||
height: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- auto size: -->
|
||||
<div class="container">
|
||||
<div class="table"><ib></ib></div>
|
||||
<div class="block"><ib></ib></div>
|
||||
</div>
|
||||
|
||||
<!-- px size: -->
|
||||
<div class="container">
|
||||
<div class="table" style="height: 30px"><ib></ib></div>
|
||||
<div class="block" style="height: 30px"><ib></ib></div>
|
||||
</div>
|
||||
|
||||
<!-- % size: -->
|
||||
<div class="container">
|
||||
<div class="table" style="height: 30%"><ib></ib></div>
|
||||
<div class="block" style="height: 30%"><ib></ib></div>
|
||||
</div>
|
||||
|
||||
<!-- calc() size: -->
|
||||
<div class="container">
|
||||
<div class="table" style="height: calc(10px + 20%)"><ib></ib></div>
|
||||
<div class="block" style="height: calc(10px + 20%)"><ib></ib></div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -116,3 +116,5 @@ fuzzy-if(gtkWidget,1,31) == flexbox-widget-flex-items-4.html flexbox-widget-flex
|
|||
|
||||
# Tests for table flex items
|
||||
== flexbox-table-flex-items-1-ref.html flexbox-table-flex-items-1-ref.html
|
||||
== flexbox-table-flex-items-2.html flexbox-table-flex-items-2-ref.html
|
||||
== flexbox-table-flex-items-3.html flexbox-table-flex-items-3-ref.html
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
fuzzy-if(OSX>=1008,55,4) == numbering-1.html numbering-1-ref.html
|
||||
== numbering-2.html numbering-2-ref.html
|
||||
pref(layout.css.grid.enabled,true) fuzzy-if(OSX>=1008,8,1) == numbering-3.html numbering-3-ref.html
|
||||
fuzzy-if(OSX>=1008,8,1) == numbering-3.html numbering-3-ref.html
|
||||
fuzzy-if(OSX>=1008,72,2) == numbering-4.html numbering-4-ref.html
|
||||
== ol-reversed-1a.html ol-reversed-1-ref.html
|
||||
asserts(1) == ol-reversed-1b.html ol-reversed-1-ref.html # bug 478135
|
||||
|
|
|
|||
|
|
@ -0,0 +1,97 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0
|
||||
-->
|
||||
<!--
|
||||
Reference for the correctness of gaps in horizontal and vertical multi-line
|
||||
flex containers.
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Reference: Testing row and column gaps in horizontal and vertical multi-line flex containers with the space-around property and auto margins</title>
|
||||
<link rel="author" title="Mihir Iyer" href="mailto:miyer@mozilla.com">
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
.outerBox {
|
||||
width: 200px;
|
||||
height: 220px;
|
||||
border: 1px solid black;
|
||||
float: left;
|
||||
}
|
||||
.flexContainer {
|
||||
display: flex;
|
||||
align-content: space-around;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.rowNoWrap {
|
||||
flex-flow: row nowrap;
|
||||
}
|
||||
.columnNoWrap {
|
||||
flex-flow: column nowrap;
|
||||
}
|
||||
.item {
|
||||
border: 1px solid blue;
|
||||
background: lightblue;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
}
|
||||
.autoLBMargins {
|
||||
margin-left: auto;
|
||||
margin-bottom: auto;
|
||||
}
|
||||
.autoBMargin {
|
||||
margin-bottom: auto;
|
||||
}
|
||||
.right20 {
|
||||
margin-right: 20px;
|
||||
}
|
||||
.bottom40 {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
.tb30100 {
|
||||
margin-top: 30px;
|
||||
margin-bottom: 100px;
|
||||
}
|
||||
.lr3080 {
|
||||
margin-left: 30px;
|
||||
margin-right: 80px;
|
||||
}
|
||||
.w200 {
|
||||
width: 200px;
|
||||
}
|
||||
.h220 {
|
||||
height: 220px;
|
||||
}
|
||||
.fleft {
|
||||
float: left;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="outerBox">
|
||||
<div class="flexContainer w200 rowNoWrap tb30100">
|
||||
<div class="item right20"></div>
|
||||
<div class="item right20"></div>
|
||||
<div class="item right20"></div>
|
||||
<div class="item"></div>
|
||||
</div>
|
||||
<div class="flexContainer w200 rowNoWrap">
|
||||
<div class="item autoLBMargins right20"></div>
|
||||
<div class="item"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="outerBox">
|
||||
<div class="flexContainer fleft h220 columnNoWrap lr3080">
|
||||
<div class="item bottom40"></div>
|
||||
<div class="item bottom40"></div>
|
||||
<div class="item"></div>
|
||||
</div>
|
||||
<div class="flexContainer fleft h220 columnNoWrap">
|
||||
<div class="item bottom40"></div>
|
||||
<div class="item bottom40"></div>
|
||||
<div class="item autoBMargin"></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0
|
||||
-->
|
||||
<!--
|
||||
Testcase for the correctness of gaps in horizontal and vertical multi-line
|
||||
flex containers.
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>CSS Test: Testing row and column gaps in horizontal and vertical multi-line flex containers with the space-around property and auto margins</title>
|
||||
<link rel="author" title="Mihir Iyer" href="mailto:miyer@mozilla.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-align/#gap-flex">
|
||||
<link rel="match" href="flexbox-column-row-gap-001-ref.html">
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
.flexContainer {
|
||||
display: flex;
|
||||
width: 200px;
|
||||
height: 220px;
|
||||
border: 1px solid black;
|
||||
column-gap: 10%;
|
||||
row-gap: 40px;
|
||||
align-content: space-around;
|
||||
justify-content: space-around;
|
||||
float: left;
|
||||
}
|
||||
.rowWrap {
|
||||
flex-flow: row wrap;
|
||||
}
|
||||
.columnWrap {
|
||||
flex-flow: column wrap;
|
||||
}
|
||||
.item {
|
||||
border: 1px solid blue;
|
||||
background: lightblue;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
}
|
||||
.autoLBMargins {
|
||||
margin-left: auto;
|
||||
margin-bottom: auto;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flexContainer rowWrap">
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item autoLBMargins"></div>
|
||||
<div class="item"></div>
|
||||
</div>
|
||||
<div class="flexContainer columnWrap">
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item autoLBMargins"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0
|
||||
-->
|
||||
<!--
|
||||
Testcase for the correctness of gaps in vertical writing mode
|
||||
multi-line flex containers.
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Reference: Testing row and column gaps in vertical writing mode multi-line flex containers</title>
|
||||
<link rel="author" title="Mihir Iyer" href="mailto:miyer@mozilla.com">
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
.flexContainer {
|
||||
display: flex;
|
||||
width: 220px;
|
||||
height: 200px;
|
||||
border: 1px solid black;
|
||||
align-content: flex-start;
|
||||
justify-content: flex-end;
|
||||
float: left;
|
||||
writing-mode: vertical-lr;
|
||||
}
|
||||
.rowWrap {
|
||||
flex-flow: row wrap;
|
||||
}
|
||||
.columnWrap {
|
||||
flex-flow: column wrap;
|
||||
}
|
||||
.item {
|
||||
border: 1px solid blue;
|
||||
background: lightblue;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
}
|
||||
.b20 {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.t20 {
|
||||
margin-top: 20px;
|
||||
}
|
||||
.l10 {
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flexContainer rowWrap">
|
||||
<div class="item b20"></div>
|
||||
<div class="item b20"></div>
|
||||
<div class="item b20"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item l10 b20"></div>
|
||||
<div class="item l10"></div>
|
||||
</div>
|
||||
<div class="flexContainer columnWrap">
|
||||
<div class="item"></div>
|
||||
<div class="item l10"></div>
|
||||
<div class="item l10"></div>
|
||||
<div class="item l10"></div>
|
||||
<div class="item l10"></div>
|
||||
<div class="item l10 t20"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0
|
||||
-->
|
||||
<!--
|
||||
Testcase for the correctness of gaps in vertical writing mode multi-line
|
||||
flex containers.
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>CSS Test: Testing row and column gaps in vertical writing mode multi-line flex containers</title>
|
||||
<link rel="author" title="Mihir Iyer" href="mailto:miyer@mozilla.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-align/#gap-flex">
|
||||
<link rel="match" href="flexbox-column-row-gap-002-ref.html">
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
.flexContainer {
|
||||
display: flex;
|
||||
width: 220px;
|
||||
height: 200px;
|
||||
border: 1px solid black;
|
||||
column-gap: 10%;
|
||||
row-gap: 10px;
|
||||
align-content: flex-start;
|
||||
justify-content: flex-end;
|
||||
float: left;
|
||||
writing-mode: vertical-lr;
|
||||
}
|
||||
.rowWrap {
|
||||
flex-flow: row wrap;
|
||||
}
|
||||
.columnWrap {
|
||||
flex-flow: column wrap;
|
||||
}
|
||||
.item {
|
||||
border: 1px solid blue;
|
||||
background: lightblue;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flexContainer rowWrap">
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
</div>
|
||||
<div class="flexContainer columnWrap">
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Reference: Testing cross size computation with row and column gaps in horizontal multi-line flex containers</title>
|
||||
<link rel="author" title="Mihir Iyer" href="mailto:miyer@mozilla.com">
|
||||
<meta charset="utf-8">
|
||||
</html>
|
||||
<style>
|
||||
.flexContainer {
|
||||
display: flex;
|
||||
border: 1px solid black;
|
||||
column-gap: 20px;
|
||||
row-gap: 40px;
|
||||
align-content: space-around;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.rowWrap {
|
||||
flex-flow: row wrap;
|
||||
}
|
||||
.item {
|
||||
border: 1px solid blue;
|
||||
background: lightblue;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
}
|
||||
.autoLBMargins {
|
||||
margin-left: auto;
|
||||
margin-bottom: auto;
|
||||
}
|
||||
.w200 {
|
||||
width: 200px;
|
||||
}
|
||||
.h100 {
|
||||
height: 100px;
|
||||
}
|
||||
.h90 {
|
||||
height: 90px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flexContainer rowWrap w200 h100">
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item autoLBMargins"></div>
|
||||
<div class="item"></div>
|
||||
</div>
|
||||
<div class="flexContainer rowWrap w200 h90">
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item autoLBMargins"></div>
|
||||
<div class="item"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>CSS Test: Testing cross size computation with row and column gaps in horizontal multi-line flex containers</title>
|
||||
<link rel="author" title="Mihir Iyer" href="mailto:miyer@mozilla.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-align/#gap-flex">
|
||||
<link rel="match" href="flexbox-column-row-gap-003-ref.html">
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
.flexContainer {
|
||||
display: flex;
|
||||
border: 1px solid black;
|
||||
column-gap: 20px;
|
||||
row-gap: 40px;
|
||||
align-content: space-around;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.rowWrap {
|
||||
flex-flow: row wrap;
|
||||
}
|
||||
.item {
|
||||
border: 1px solid blue;
|
||||
background: lightblue;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
}
|
||||
.autoLBMargins {
|
||||
margin-left: auto;
|
||||
margin-bottom: auto;
|
||||
}
|
||||
.w200 {
|
||||
width: 200px;
|
||||
}
|
||||
.hclamp {
|
||||
max-height: 90px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flexContainer rowWrap w200">
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item autoLBMargins"></div>
|
||||
<div class="item"></div>
|
||||
</div>
|
||||
<div class="flexContainer rowWrap w200 hclamp">
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item autoLBMargins"></div>
|
||||
<div class="item"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Reference: Testing percentage gap resolution in flex containers</title>
|
||||
<link rel="author" title="Mihir Iyer" href="mailto:miyer@mozilla.com">
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
.flexContainer {
|
||||
display: flex;
|
||||
border: 2px solid black;
|
||||
column-gap: 10px;
|
||||
align-content: start;
|
||||
justify-content: start;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.item {
|
||||
border: 1px solid blue;
|
||||
background: yellow;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
flex: none;
|
||||
}
|
||||
.vertLR {
|
||||
writing-mode: vertical-lr;
|
||||
}
|
||||
.rowWrap {
|
||||
flex-flow: row wrap;
|
||||
}
|
||||
.colWrap {
|
||||
flex-flow: column wrap;
|
||||
}
|
||||
.w50 {
|
||||
width: 50px;
|
||||
}
|
||||
.h100 {
|
||||
height: 100px;
|
||||
}
|
||||
.w100 {
|
||||
width: 100px;
|
||||
}
|
||||
.noWrap {
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flexContainer rowWrap w50 h100">
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
</div>
|
||||
<div class="flexContainer colWrap w50 h100 noWrap">
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
</div>
|
||||
<div class="flexContainer vertLR rowWrap h100 w100">
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
</div>
|
||||
<div class="flexContainer vertLR colWrap w100 noWrap">
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>CSS Test: Testing percentage gap resolution in flex containers</title>
|
||||
<link rel="author" title="Mihir Iyer" href="mailto:miyer@mozilla.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-align/#column-row-gap">
|
||||
<link rel="match" href="flexbox-column-row-gap-004-ref.html">
|
||||
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/5081">
|
||||
<meta charset="utf-8">
|
||||
<meta name="assert" content="% row-gaps in a flexbox with indefinite block size are treated as 'normal'." />
|
||||
<style>
|
||||
.flexContainer {
|
||||
display: flex;
|
||||
border: 2px solid black;
|
||||
row-gap: 20%;
|
||||
column-gap: 10%;
|
||||
align-content: start;
|
||||
justify-content: start;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.item {
|
||||
border: 1px solid blue;
|
||||
background: yellow;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
flex: none;
|
||||
}
|
||||
.vertLR {
|
||||
writing-mode: vertical-lr;
|
||||
}
|
||||
.rowWrap {
|
||||
flex-flow: row wrap;
|
||||
}
|
||||
.colWrap {
|
||||
flex-flow: column wrap;
|
||||
}
|
||||
.w50 {
|
||||
width: 50px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flexContainer rowWrap w50">
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
</div>
|
||||
<div class="flexContainer colWrap w50">
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
</div>
|
||||
<div class="flexContainer vertLR rowWrap">
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
</div>
|
||||
<div class="flexContainer vertLR colWrap">
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>CSS Reftest Reference</title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||
<link rel="stylesheet" type="text/css" href="support/ahem.css">
|
||||
<style>
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
border: 2px solid purple;
|
||||
padding: 2px;
|
||||
margin-bottom: 2em;
|
||||
height: 50px;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.container > * {
|
||||
flex-shrink: 0;
|
||||
min-width: 0;
|
||||
border: 2px solid teal;
|
||||
}
|
||||
|
||||
.smallText { font: 10px Ahem; }
|
||||
.bigText { font: 20px Ahem; }
|
||||
.spacerChild::before {
|
||||
content: '';
|
||||
display: block;
|
||||
background: brown;
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
}
|
||||
.justPadding {
|
||||
/* Empty div with 5px padding on each side */
|
||||
padding: 5px;
|
||||
background: cyan;
|
||||
}
|
||||
canvas { background: fuchsia }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Flex items have unspecified size properties: -->
|
||||
<div class="container">
|
||||
<div class="smallText">a b</div>
|
||||
<div class="bigText">c</div>
|
||||
<div class="spacerChild"></div>
|
||||
<div class="justPadding"></div>
|
||||
<canvas width="20"></canvas>
|
||||
</div>
|
||||
|
||||
<!-- Various specified main-size values, in testcase
|
||||
(removed here in reference case, because they shouldn't affect sizing): -->
|
||||
<div class="container">
|
||||
<div class="smallText">a b</div>
|
||||
<div class="bigText">c</div>
|
||||
<div class="spacerChild"></div>
|
||||
<div class="justPadding"></div>
|
||||
<canvas width="20"></canvas>
|
||||
</div>
|
||||
|
||||
<!-- Various specified cross-size values (should be honored): -->
|
||||
<div class="container">
|
||||
<div class="smallText" style="height: 0px">a b</div>
|
||||
<div class="bigText" style="height: 40px">c</div>
|
||||
<div class="spacerChild" style="height: 20px"></div>
|
||||
<div class="justPadding" style="height: 10px"></div>
|
||||
<canvas width="20" style="height: 8px"></canvas>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
CSS Test: Testing "flex-basis: content" in a row-oriented flex container
|
||||
</title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#propdef-flex-basis">
|
||||
<link rel="match" href="flexbox-flex-basis-content-001-ref.html">
|
||||
<link rel="stylesheet" type="text/css" href="support/ahem.css">
|
||||
<style>
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
border: 2px solid purple;
|
||||
padding: 2px;
|
||||
margin-bottom: 2em;
|
||||
height: 50px;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.container > * {
|
||||
/* All flex items have "flex-basis: content" (and zero flex-shrink and
|
||||
min-main-size, to avoid any influence from those). */
|
||||
flex-basis: content;
|
||||
flex-shrink: 0;
|
||||
min-width: 0;
|
||||
border: 2px solid teal;
|
||||
}
|
||||
|
||||
.smallText { font: 10px Ahem; }
|
||||
.bigText { font: 20px Ahem; }
|
||||
.spacerChild::before {
|
||||
content: '';
|
||||
display: block;
|
||||
background: brown;
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
}
|
||||
.justPadding {
|
||||
/* Empty div with 5px padding on each side */
|
||||
padding: 5px;
|
||||
background: cyan;
|
||||
}
|
||||
canvas { background: fuchsia }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Flex items have unspecified size properties: -->
|
||||
<div class="container">
|
||||
<div class="smallText">a b</div>
|
||||
<div class="bigText">c</div>
|
||||
<div class="spacerChild"></div>
|
||||
<div class="justPadding"></div>
|
||||
<canvas width="20"></canvas>
|
||||
</div>
|
||||
|
||||
<!-- Various specified main-size values (should be ignored): -->
|
||||
<div class="container">
|
||||
<div class="smallText" style="width: 0px">a b</div>
|
||||
<div class="bigText" style="width: 40px">c</div>
|
||||
<div class="spacerChild" style="width: 20px"></div>
|
||||
<div class="justPadding" style="width: 10px"></div>
|
||||
<canvas width="20" style="width: 8px"></canvas>
|
||||
</div>
|
||||
|
||||
<!-- Various specified cross-size values (should be honored): -->
|
||||
<div class="container">
|
||||
<div class="smallText" style="height: 0px">a b</div>
|
||||
<div class="bigText" style="height: 40px">c</div>
|
||||
<div class="spacerChild" style="height: 20px"></div>
|
||||
<div class="justPadding" style="height: 10px"></div>
|
||||
<canvas width="20" style="height: 8px"></canvas>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
CSS Test: Testing "flex-basis: content" (set via the "flex" shorthand)
|
||||
in a row-oriented flex container.
|
||||
</title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#propdef-flex-basis">
|
||||
<link rel="match" href="flexbox-flex-basis-content-001-ref.html">
|
||||
<link rel="stylesheet" type="text/css" href="support/ahem.css">
|
||||
<style>
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
border: 2px solid purple;
|
||||
padding: 2px;
|
||||
margin-bottom: 2em;
|
||||
height: 50px;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.container > * {
|
||||
/* All flex items have "flex-basis: content" (and zero flex-shrink and
|
||||
min-main-size, to avoid any influence from those). */
|
||||
flex: 0 0 content;
|
||||
min-width: 0;
|
||||
border: 2px solid teal;
|
||||
}
|
||||
|
||||
.smallText { font: 10px Ahem; }
|
||||
.bigText { font: 20px Ahem; }
|
||||
.spacerChild::before {
|
||||
content: '';
|
||||
display: block;
|
||||
background: brown;
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
}
|
||||
.justPadding {
|
||||
/* Empty div with 5px padding on each side */
|
||||
padding: 5px;
|
||||
background: cyan;
|
||||
}
|
||||
canvas { background: fuchsia }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Flex items have unspecified size properties: -->
|
||||
<div class="container">
|
||||
<div class="smallText">a b</div>
|
||||
<div class="bigText">c</div>
|
||||
<div class="spacerChild"></div>
|
||||
<div class="justPadding"></div>
|
||||
<canvas width="20"></canvas>
|
||||
</div>
|
||||
|
||||
<!-- Various specified main-size values (should be ignored): -->
|
||||
<div class="container">
|
||||
<div class="smallText" style="width: 0px">a b</div>
|
||||
<div class="bigText" style="width: 40px">c</div>
|
||||
<div class="spacerChild" style="width: 20px"></div>
|
||||
<div class="justPadding" style="width: 10px"></div>
|
||||
<canvas width="20" style="width: 8px"></canvas>
|
||||
</div>
|
||||
|
||||
<!-- Various specified cross-size values (should be honored): -->
|
||||
<div class="container">
|
||||
<div class="smallText" style="height: 0px">a b</div>
|
||||
<div class="bigText" style="height: 40px">c</div>
|
||||
<div class="spacerChild" style="height: 20px"></div>
|
||||
<div class="justPadding" style="height: 10px"></div>
|
||||
<canvas width="20" style="height: 8px"></canvas>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>CSS Reftest Reference</title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||
<link rel="stylesheet" type="text/css" href="support/ahem.css">
|
||||
<style>
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
border: 2px solid purple;
|
||||
padding: 2px;
|
||||
margin-right: 2em;
|
||||
width: 50px;
|
||||
height: 200px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.container > * {
|
||||
flex-shrink: 0;
|
||||
min-height: 0;
|
||||
border: 2px solid teal;
|
||||
}
|
||||
|
||||
.smallText { font: 10px Ahem; }
|
||||
.bigText { font: 20px Ahem; }
|
||||
.spacerChild::before {
|
||||
content: '';
|
||||
display: block;
|
||||
background: brown;
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
}
|
||||
.justPadding {
|
||||
/* Empty div with 5px padding on each side */
|
||||
padding: 5px;
|
||||
background: cyan;
|
||||
}
|
||||
canvas { background: fuchsia }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Flex items have unspecified size properties: -->
|
||||
<div class="container">
|
||||
<div class="smallText">a b</div>
|
||||
<div class="bigText">c</div>
|
||||
<div class="spacerChild"></div>
|
||||
<div class="justPadding"></div>
|
||||
<canvas height="20"></canvas>
|
||||
</div>
|
||||
|
||||
<!-- Various specified main-size values, in testcase
|
||||
(removed here in reference case, because they shouldn't affect sizing): -->
|
||||
<div class="container">
|
||||
<div class="smallText">a b</div>
|
||||
<div class="bigText">c</div>
|
||||
<div class="spacerChild"></div>
|
||||
<div class="justPadding"></div>
|
||||
<canvas height="20"></canvas>
|
||||
</div>
|
||||
|
||||
<!-- Various specified cross-size values (should be honored): -->
|
||||
<div class="container">
|
||||
<div class="smallText" style="width: 0px">a b</div>
|
||||
<div class="bigText" style="width: 40px">c</div>
|
||||
<div class="spacerChild" style="width: 20px"></div>
|
||||
<div class="justPadding" style="width: 10px"></div>
|
||||
<canvas height="20" style="width: 8px"></canvas>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
CSS Test: Testing "flex-basis: content" in a column-oriented flex container
|
||||
</title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#propdef-flex-basis">
|
||||
<link rel="match" href="flexbox-flex-basis-content-002-ref.html">
|
||||
<link rel="stylesheet" type="text/css" href="support/ahem.css">
|
||||
<style>
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
border: 2px solid purple;
|
||||
padding: 2px;
|
||||
margin-right: 2em;
|
||||
width: 50px;
|
||||
height: 200px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.container > * {
|
||||
/* All flex items have "flex-basis: content" (and zero flex-shrink and
|
||||
min-main-size, to avoid any influence from those). */
|
||||
flex-basis: content;
|
||||
flex-shrink: 0;
|
||||
min-height: 0;
|
||||
border: 2px solid teal;
|
||||
}
|
||||
|
||||
.smallText { font: 10px Ahem; }
|
||||
.bigText { font: 20px Ahem; }
|
||||
.spacerChild::before {
|
||||
content: '';
|
||||
display: block;
|
||||
background: brown;
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
}
|
||||
.justPadding {
|
||||
/* Empty div with 5px padding on each side */
|
||||
padding: 5px;
|
||||
background: cyan;
|
||||
}
|
||||
canvas { background: fuchsia }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Flex items have unspecified size properties: -->
|
||||
<div class="container">
|
||||
<div class="smallText">a b</div>
|
||||
<div class="bigText">c</div>
|
||||
<div class="spacerChild"></div>
|
||||
<div class="justPadding"></div>
|
||||
<canvas height="20"></canvas>
|
||||
</div>
|
||||
|
||||
<!-- Various specified main-size values (should be ignored): -->
|
||||
<div class="container">
|
||||
<div class="smallText" style="height: 0px">a b</div>
|
||||
<div class="bigText" style="height: 40px">c</div>
|
||||
<div class="spacerChild" style="height: 20px"></div>
|
||||
<div class="justPadding" style="height: 10px"></div>
|
||||
<canvas height="20" style="height: 8px"></canvas>
|
||||
</div>
|
||||
|
||||
<!-- Various specified cross-size values (should be honored): -->
|
||||
<div class="container">
|
||||
<div class="smallText" style="width: 0px">a b</div>
|
||||
<div class="bigText" style="width: 40px">c</div>
|
||||
<div class="spacerChild" style="width: 20px"></div>
|
||||
<div class="justPadding" style="width: 10px"></div>
|
||||
<canvas height="20" style="width: 8px"></canvas>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
CSS Test: Testing "flex-basis: content" (set via the "flex" shorthand)
|
||||
in a column-oriented flex container.
|
||||
</title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#propdef-flex-basis">
|
||||
<link rel="match" href="flexbox-flex-basis-content-002-ref.html">
|
||||
<link rel="stylesheet" type="text/css" href="support/ahem.css">
|
||||
<style>
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
border: 2px solid purple;
|
||||
padding: 2px;
|
||||
margin-right: 2em;
|
||||
width: 50px;
|
||||
height: 200px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.container > * {
|
||||
/* All flex items have "flex-basis: content" (and zero flex-shrink and
|
||||
min-main-size, to avoid any influence from those). */
|
||||
flex: 0 0 content;
|
||||
min-height: 0;
|
||||
border: 2px solid teal;
|
||||
}
|
||||
|
||||
.smallText { font: 10px Ahem; }
|
||||
.bigText { font: 20px Ahem; }
|
||||
.spacerChild::before {
|
||||
content: '';
|
||||
display: block;
|
||||
background: brown;
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
}
|
||||
.justPadding {
|
||||
/* Empty div with 5px padding on each side */
|
||||
padding: 5px;
|
||||
background: cyan;
|
||||
}
|
||||
canvas { background: fuchsia }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Flex items have unspecified size properties: -->
|
||||
<div class="container">
|
||||
<div class="smallText">a b</div>
|
||||
<div class="bigText">c</div>
|
||||
<div class="spacerChild"></div>
|
||||
<div class="justPadding"></div>
|
||||
<canvas height="20"></canvas>
|
||||
</div>
|
||||
|
||||
<!-- Various specified main-size values (should be ignored): -->
|
||||
<div class="container">
|
||||
<div class="smallText" style="height: 0px">a b</div>
|
||||
<div class="bigText" style="height: 40px">c</div>
|
||||
<div class="spacerChild" style="height: 20px"></div>
|
||||
<div class="justPadding" style="height: 10px"></div>
|
||||
<canvas height="20" style="height: 8px"></canvas>
|
||||
</div>
|
||||
|
||||
<!-- Various specified cross-size values (should be honored): -->
|
||||
<div class="container">
|
||||
<div class="smallText" style="width: 0px">a b</div>
|
||||
<div class="bigText" style="width: 40px">c</div>
|
||||
<div class="spacerChild" style="width: 20px"></div>
|
||||
<div class="justPadding" style="width: 10px"></div>
|
||||
<canvas height="20" style="width: 8px"></canvas>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>CSS Reftest Reference</title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||
<style>
|
||||
.container {
|
||||
clear: both; /* In this reference case, we use floats instead of
|
||||
flex items (see below), so the container just
|
||||
needs to reset the float state for each example. */
|
||||
}
|
||||
|
||||
.item {
|
||||
border: 2px solid teal;
|
||||
float: left; /* Use floated elements as a reference for (hopefully)
|
||||
max-content sized flex items in testcase. */
|
||||
}
|
||||
ib {
|
||||
display: inline-block;
|
||||
background: blue;
|
||||
border: 1px solid gray;
|
||||
width: 15px;
|
||||
height: 10px;
|
||||
}
|
||||
float {
|
||||
float: left;
|
||||
background: fuchsia;
|
||||
border: 1px solid gray;
|
||||
width: 15px;
|
||||
height: 10px;
|
||||
}
|
||||
canvas {
|
||||
background: brown;
|
||||
border: 1px solid gray;
|
||||
}
|
||||
.innerFlex {
|
||||
display: flex;
|
||||
}
|
||||
innerItem {
|
||||
background: salmon;
|
||||
border: 1px solid gray;
|
||||
height: 10px;
|
||||
width: 15px;
|
||||
flex: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- In testcase, flex item has several inline-blocks
|
||||
(no spaces, to avoid any text-layout dependency): -->
|
||||
<div class="container">
|
||||
<div class="item"><ib></ib><ib></ib><ib></ib></div>
|
||||
</div>
|
||||
|
||||
<!-- In testcase, flex item has several floats: -->
|
||||
<div class="container">
|
||||
<div class="item">
|
||||
<float></float>
|
||||
<float></float>
|
||||
<float></float>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- In testcase, flex item has several inline replaced elements:
|
||||
(no spaces, to avoid any text-layout dependency): -->
|
||||
<div class="container">
|
||||
<div class="item">
|
||||
<canvas width="15" height="10"></canvas
|
||||
><canvas width="15" height="10"></canvas
|
||||
><canvas width="15" height="10"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- In testcase, flex item *is* a replaced element: -->
|
||||
<div class="container">
|
||||
<canvas class="item" width="25" height="10"></canvas>
|
||||
</div>
|
||||
|
||||
<!-- In testcase, flex item is itself a flex container: -->
|
||||
<div class="container">
|
||||
<div class="item innerFlex">
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- In testcase, flex item is itself a multi-line flex container: -->
|
||||
<div class="container">
|
||||
<div class="item innerFlex" style="flex-wrap: wrap">
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
CSS Test: Testing that explicit "flex-basis: content" is treated as
|
||||
"max-content" when calculating flex base size
|
||||
</title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#flex-base-size">
|
||||
<link rel="match" href="flexbox-flex-basis-content-003-ref.html">
|
||||
<style>
|
||||
.container {
|
||||
display: flex;
|
||||
/* flex container has an extremely-constrained width (and items will
|
||||
overflow horizontally). This is intentional, as part of stress-testing
|
||||
item sizing. */
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
.item {
|
||||
/* We give all flex items "flex-basis: content".
|
||||
We also give them zero flex-grow, flex-shrink, and min-main-size, so
|
||||
that the flex base size entirely determines the flex item's size. */
|
||||
flex: 0 0 content;
|
||||
min-width: 0;
|
||||
border: 2px solid teal;
|
||||
}
|
||||
ib {
|
||||
display: inline-block;
|
||||
background: blue;
|
||||
border: 1px solid gray;
|
||||
width: 15px;
|
||||
height: 10px;
|
||||
}
|
||||
float {
|
||||
float: left;
|
||||
background: fuchsia;
|
||||
border: 1px solid gray;
|
||||
width: 15px;
|
||||
height: 10px;
|
||||
}
|
||||
canvas {
|
||||
background: brown;
|
||||
border: 1px solid gray;
|
||||
}
|
||||
.innerFlex {
|
||||
display: flex;
|
||||
}
|
||||
innerItem {
|
||||
background: salmon;
|
||||
border: 1px solid gray;
|
||||
height: 10px;
|
||||
width: 15px;
|
||||
flex: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- The idea of this test is to be sure the UA is using the "max-content" size
|
||||
(and not e.g. the "fit-content size") when resolving the flex base size
|
||||
inside each flex container. To differentiate between max-content and
|
||||
other intrinsic size possibilities (min-content/fit-content), we:
|
||||
- use flex items with a large difference between its min-content size &
|
||||
its max-content size (e.g. wrappable content).
|
||||
- use a very small container (to compress the size, if the UA incorrectly
|
||||
allows the size to be influenced by the container size).
|
||||
-->
|
||||
|
||||
<!-- Flex item has several inline-blocks
|
||||
(no spaces, to avoid any text-layout dependency): -->
|
||||
<div class="container">
|
||||
<div class="item"><ib></ib><ib></ib><ib></ib></div>
|
||||
</div>
|
||||
|
||||
<!-- Flex item has several floats: -->
|
||||
<div class="container">
|
||||
<div class="item">
|
||||
<float></float>
|
||||
<float></float>
|
||||
<float></float>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Flex item has several inline replaced elements:
|
||||
(no spaces, to avoid any text-layout dependency): -->
|
||||
<div class="container">
|
||||
<div class="item">
|
||||
<canvas width="15" height="10"></canvas
|
||||
><canvas width="15" height="10"></canvas
|
||||
><canvas width="15" height="10"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Flex item *is* a replaced element: -->
|
||||
<div class="container">
|
||||
<canvas class="item" width="25" height="10"></canvas>
|
||||
</div>
|
||||
|
||||
<!-- Flex item is itself a flex container: -->
|
||||
<div class="container">
|
||||
<div class="item innerFlex">
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Flex item is itself a multi-line flex container: -->
|
||||
<div class="container">
|
||||
<div class="item innerFlex" style="flex-wrap: wrap">
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
CSS Test: Testing that used "flex-basis: content" is treated as
|
||||
"max-content" when calculating flex base size
|
||||
</title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#flex-base-size">
|
||||
<link rel="match" href="flexbox-flex-basis-content-003-ref.html">
|
||||
<style>
|
||||
.container {
|
||||
display: flex;
|
||||
/* flex container has an extremely-constrained width (and items will
|
||||
overflow horizontally). This is intentional, as part of stress-testing
|
||||
item sizing. */
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
.item {
|
||||
/* We give all flex items a used "flex-basis" of "content"
|
||||
(from "flex-basis:auto" and default "width:auto").
|
||||
We also give them zero flex-grow, flex-shrink, and min-main-size, so
|
||||
that the flex base size entirely determines the flex item's size. */
|
||||
flex: 0 0 auto;
|
||||
min-width: 0;
|
||||
border: 2px solid teal;
|
||||
}
|
||||
ib {
|
||||
display: inline-block;
|
||||
background: blue;
|
||||
border: 1px solid gray;
|
||||
width: 15px;
|
||||
height: 10px;
|
||||
}
|
||||
float {
|
||||
float: left;
|
||||
background: fuchsia;
|
||||
border: 1px solid gray;
|
||||
width: 15px;
|
||||
height: 10px;
|
||||
}
|
||||
canvas {
|
||||
background: brown;
|
||||
border: 1px solid gray;
|
||||
}
|
||||
.innerFlex {
|
||||
display: flex;
|
||||
}
|
||||
innerItem {
|
||||
background: salmon;
|
||||
border: 1px solid gray;
|
||||
height: 10px;
|
||||
width: 15px;
|
||||
flex: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- The idea of this test is to be sure the UA is using the "max-content" size
|
||||
(and not e.g. the "fit-content size") when resolving the flex base size
|
||||
inside each flex container. To differentiate between max-content and
|
||||
other intrinsic size possibilities (min-content/fit-content), we:
|
||||
- use flex items with a large difference between its min-content size &
|
||||
its max-content size (e.g. wrappable content).
|
||||
- use a very small container (to compress the size, if the UA incorrectly
|
||||
allows the size to be influenced by the container size).
|
||||
-->
|
||||
|
||||
<!-- Flex item has several inline-blocks
|
||||
(no spaces, to avoid any text-layout dependency): -->
|
||||
<div class="container">
|
||||
<div class="item"><ib></ib><ib></ib><ib></ib></div>
|
||||
</div>
|
||||
|
||||
<!-- Flex item has several floats: -->
|
||||
<div class="container">
|
||||
<div class="item">
|
||||
<float></float>
|
||||
<float></float>
|
||||
<float></float>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Flex item has several inline replaced elements:
|
||||
(no spaces, to avoid any text-layout dependency): -->
|
||||
<div class="container">
|
||||
<div class="item">
|
||||
<canvas width="15" height="10"></canvas
|
||||
><canvas width="15" height="10"></canvas
|
||||
><canvas width="15" height="10"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Flex item *is* a replaced element: -->
|
||||
<div class="container">
|
||||
<canvas class="item" width="25" height="10"></canvas>
|
||||
</div>
|
||||
|
||||
<!-- Flex item is itself a flex container: -->
|
||||
<div class="container">
|
||||
<div class="item innerFlex">
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Flex item is itself a multi-line flex container: -->
|
||||
<div class="container">
|
||||
<div class="item innerFlex" style="flex-wrap: wrap">
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>CSS Reftest Reference</title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||
<style>
|
||||
.container {
|
||||
clear: both; /* In this reference case, we use floats instead of
|
||||
flex items (see below), so the container just
|
||||
needs to reset the float state for each example. */
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
.item {
|
||||
border: 2px solid teal;
|
||||
float: left; /* Use floated elements as a reference for (hopefully)
|
||||
max-content sized flex items in testcase. */
|
||||
}
|
||||
ib {
|
||||
display: inline-block;
|
||||
background: blue;
|
||||
border: 1px solid gray;
|
||||
width: 15px;
|
||||
height: 10px;
|
||||
}
|
||||
float {
|
||||
float: left;
|
||||
background: fuchsia;
|
||||
border: 1px solid gray;
|
||||
width: 15px;
|
||||
height: 10px;
|
||||
}
|
||||
canvas {
|
||||
background: brown;
|
||||
border: 1px solid gray;
|
||||
}
|
||||
.innerFlex {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
innerItem {
|
||||
background: salmon;
|
||||
border: 1px solid gray;
|
||||
height: 10px;
|
||||
width: 15px;
|
||||
flex: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- In testcase, flex item has several inline-blocks
|
||||
(no spaces, to avoid any text-layout dependency): -->
|
||||
<div class="container">
|
||||
<div class="item"><ib></ib><ib></ib><ib></ib></div>
|
||||
</div>
|
||||
|
||||
<!-- In testcase, flex item has several floats: -->
|
||||
<div class="container">
|
||||
<div class="item">
|
||||
<float></float>
|
||||
<float></float>
|
||||
<float></float>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- In testcase, flex item has several inline replaced elements:
|
||||
(no spaces, to avoid any text-layout dependency): -->
|
||||
<div class="container">
|
||||
<div class="item">
|
||||
<canvas width="15" height="10"></canvas
|
||||
><canvas width="15" height="10"></canvas
|
||||
><canvas width="15" height="10"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- In testcase, flex item *is* a replaced element: -->
|
||||
<div class="container">
|
||||
<canvas class="item" width="25" height="10"></canvas>
|
||||
</div>
|
||||
|
||||
<!-- In testcase, flex item is itself a flex container: -->
|
||||
<div class="container">
|
||||
<div class="item innerFlex">
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- In testcase, flex item is itself a multi-line flex container: -->
|
||||
<div class="container">
|
||||
<div class="item innerFlex" style="flex-wrap: wrap">
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
CSS Test: Testing that explicit "flex-basis: content" is treated as
|
||||
"max-content" when calculating flex base size
|
||||
</title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#flex-base-size">
|
||||
<link rel="match" href="flexbox-flex-basis-content-004-ref.html">
|
||||
<style>
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
/* flex container has an extremely-constrained height (and items will
|
||||
overflow vertically). This is intentional, as part of stress-testing
|
||||
item sizing. We add a large margin-bottom so that overflowing
|
||||
items don't overlap between examples. */
|
||||
height: 1px;
|
||||
margin-bottom: 49px;
|
||||
}
|
||||
|
||||
.item {
|
||||
/* We give all flex items "flex-basis: content".
|
||||
We also give them zero flex-grow, flex-shrink, and min-main-size, so
|
||||
that the flex base size entirely determines the flex item's size. */
|
||||
flex: 0 0 content;
|
||||
min-height: 0;
|
||||
border: 2px solid teal;
|
||||
}
|
||||
ib {
|
||||
display: inline-block;
|
||||
background: blue;
|
||||
border: 1px solid gray;
|
||||
width: 15px;
|
||||
height: 10px;
|
||||
}
|
||||
float {
|
||||
float: left;
|
||||
background: fuchsia;
|
||||
border: 1px solid gray;
|
||||
width: 15px;
|
||||
height: 10px;
|
||||
}
|
||||
canvas {
|
||||
background: brown;
|
||||
border: 1px solid gray;
|
||||
}
|
||||
.innerFlex {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
innerItem {
|
||||
background: salmon;
|
||||
border: 1px solid gray;
|
||||
height: 10px;
|
||||
width: 15px;
|
||||
flex: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- This test exists for symmetry with the previous set of tests
|
||||
(flexbox-flex-basis-content-003*). Those previous tests check how
|
||||
"flex-basis:content" is resolved to a flex base size, in the inline axis,
|
||||
when the container's size is constrained in that axis. This test does the
|
||||
same, but for the *block* axis, using flex-direction:column. As with the
|
||||
previous set of tests, the expectation here is that we should use the
|
||||
item's max-content size as its flex base size. Note that there's a bit
|
||||
less subtlety here because intrinsic sizes (min-content, max-content) are
|
||||
typically all the same in the block axis.
|
||||
-->
|
||||
|
||||
<!-- Flex item has several inline-blocks
|
||||
(no spaces, to avoid any text-layout dependency): -->
|
||||
<div class="container">
|
||||
<div class="item"><ib></ib><ib></ib><ib></ib></div>
|
||||
</div>
|
||||
|
||||
<!-- Flex item has several floats: -->
|
||||
<div class="container">
|
||||
<div class="item">
|
||||
<float></float>
|
||||
<float></float>
|
||||
<float></float>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Flex item has several inline replaced elements:
|
||||
(no spaces, to avoid any text-layout dependency): -->
|
||||
<div class="container">
|
||||
<div class="item">
|
||||
<canvas width="15" height="10"></canvas
|
||||
><canvas width="15" height="10"></canvas
|
||||
><canvas width="15" height="10"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Flex item *is* a replaced element: -->
|
||||
<div class="container">
|
||||
<canvas class="item" width="25" height="10"></canvas>
|
||||
</div>
|
||||
|
||||
<!-- Flex item is itself a flex container: -->
|
||||
<div class="container">
|
||||
<div class="item innerFlex">
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Flex item is itself a multi-line flex container: -->
|
||||
<div class="container">
|
||||
<div class="item innerFlex" style="flex-wrap: wrap">
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
CSS Test: Testing that used "flex-basis: content" is treated as
|
||||
"max-content" when calculating flex base size
|
||||
</title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#flex-base-size">
|
||||
<link rel="match" href="flexbox-flex-basis-content-004-ref.html">
|
||||
<style>
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
/* flex container has an extremely-constrained height (and items will
|
||||
overflow vertically). This is intentional, as part of stress-testing
|
||||
item sizing. We add a large margin-bottom so that overflowing
|
||||
items don't overlap between examples. */
|
||||
height: 1px;
|
||||
margin-bottom: 49px;
|
||||
}
|
||||
|
||||
.item {
|
||||
/* We give all flex items a used "flex-basis" of "content"
|
||||
(from "flex-basis:auto" and default "width:auto").
|
||||
We also give them zero flex-grow, flex-shrink, and min-main-size, so
|
||||
that the flex base size entirely determines the flex item's size. */
|
||||
flex: 0 0 auto;
|
||||
min-height: 0;
|
||||
border: 2px solid teal;
|
||||
}
|
||||
ib {
|
||||
display: inline-block;
|
||||
background: blue;
|
||||
border: 1px solid gray;
|
||||
width: 15px;
|
||||
height: 10px;
|
||||
}
|
||||
float {
|
||||
float: left;
|
||||
background: fuchsia;
|
||||
border: 1px solid gray;
|
||||
width: 15px;
|
||||
height: 10px;
|
||||
}
|
||||
canvas {
|
||||
background: brown;
|
||||
border: 1px solid gray;
|
||||
}
|
||||
.innerFlex {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
innerItem {
|
||||
background: salmon;
|
||||
border: 1px solid gray;
|
||||
height: 10px;
|
||||
width: 15px;
|
||||
flex: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- This test exists for symmetry with the previous set of tests
|
||||
(flexbox-flex-basis-content-003*). Those previous tests check how
|
||||
"flex-basis:content" is resolved to a flex base size, in the inline axis,
|
||||
when the container's size is constrained in that axis. This test does the
|
||||
same, but for the *block* axis, using flex-direction:column. As with the
|
||||
previous set of tests, the expectation here is that we should use the
|
||||
item's max-content size as its flex base size. Note that there's a bit
|
||||
less subtlety here because intrinsic sizes (min-content, max-content) are
|
||||
typically all the same in the block axis.
|
||||
-->
|
||||
|
||||
<!-- Flex item has several inline-blocks
|
||||
(no spaces, to avoid any text-layout dependency): -->
|
||||
<div class="container">
|
||||
<div class="item"><ib></ib><ib></ib><ib></ib></div>
|
||||
</div>
|
||||
|
||||
<!-- Flex item has several floats: -->
|
||||
<div class="container">
|
||||
<div class="item">
|
||||
<float></float>
|
||||
<float></float>
|
||||
<float></float>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Flex item has several inline replaced elements:
|
||||
(no spaces, to avoid any text-layout dependency): -->
|
||||
<div class="container">
|
||||
<div class="item">
|
||||
<canvas width="15" height="10"></canvas
|
||||
><canvas width="15" height="10"></canvas
|
||||
><canvas width="15" height="10"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Flex item *is* a replaced element: -->
|
||||
<div class="container">
|
||||
<canvas class="item" width="25" height="10"></canvas>
|
||||
</div>
|
||||
|
||||
<!-- Flex item is itself a flex container: -->
|
||||
<div class="container">
|
||||
<div class="item innerFlex">
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Flex item is itself a multi-line flex container: -->
|
||||
<div class="container">
|
||||
<div class="item innerFlex" style="flex-wrap: wrap">
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
<innerItem></innerItem>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Flexible Box Layout Test Reference: Test flexbox intrinsic inline-size, gap, and absolute-positioned children</title>
|
||||
<link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com">
|
||||
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
|
||||
|
||||
<style>
|
||||
div {
|
||||
display: inline-flex;
|
||||
background: fuchsia;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div>
|
||||
<span>B</span>
|
||||
<span style="width: 100px;"></span>
|
||||
<span>C</span>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Flexible Box Layout Test: Test flexbox intrinsic inline-size, gap, and absolute-positioned children</title>
|
||||
<link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com">
|
||||
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#intrinsic-sizes">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-align-3/#gaps">
|
||||
<link rel="match" href="flexbox-gap-position-absolute-ref.html">
|
||||
<meta name="assert" content="This test verifies the absolute-positioned children do not contribute the gap size to the flexbox's intrinsic inline-size.">
|
||||
|
||||
<style>
|
||||
div {
|
||||
display: inline-flex;
|
||||
gap: 100px;
|
||||
background: fuchsia;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div>
|
||||
<span style="position: absolute;"></span>
|
||||
<span style="position: fixed;"></span>
|
||||
<span>B</span>
|
||||
<span>C</span>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -91,6 +91,23 @@
|
|||
== flexbox-collapsed-item-horiz-002.html flexbox-collapsed-item-horiz-002-ref.html
|
||||
== flexbox-collapsed-item-horiz-003.html flexbox-collapsed-item-horiz-003-ref.html
|
||||
|
||||
# Tests for "row gap" and "column gap"
|
||||
== flexbox-column-row-gap-001.html flexbox-column-row-gap-001-ref.html
|
||||
== flexbox-column-row-gap-002.html flexbox-column-row-gap-002-ref.html
|
||||
== flexbox-column-row-gap-003.html flexbox-column-row-gap-003-ref.html
|
||||
== flexbox-column-row-gap-004.html flexbox-column-row-gap-004-ref.html
|
||||
== flexbox-gap-position-absolute.html flexbox-gap-position-absolute-ref.html
|
||||
|
||||
# Tests for "flex-basis: content"
|
||||
== flexbox-flex-basis-content-001a.html flexbox-flex-basis-content-001-ref.html
|
||||
== flexbox-flex-basis-content-001b.html flexbox-flex-basis-content-001-ref.html
|
||||
== flexbox-flex-basis-content-002a.html flexbox-flex-basis-content-002-ref.html
|
||||
== flexbox-flex-basis-content-002b.html flexbox-flex-basis-content-002-ref.html
|
||||
== flexbox-flex-basis-content-003a.html flexbox-flex-basis-content-003-ref.html
|
||||
== flexbox-flex-basis-content-003b.html flexbox-flex-basis-content-003-ref.html
|
||||
== flexbox-flex-basis-content-004a.html flexbox-flex-basis-content-004-ref.html
|
||||
== flexbox-flex-basis-content-004b.html flexbox-flex-basis-content-004-ref.html
|
||||
|
||||
# Tests for flex-flow shorthand property
|
||||
== flexbox-flex-flow-001.html flexbox-flex-flow-001-ref.html
|
||||
== flexbox-flex-flow-002.html flexbox-flex-flow-002-ref.html
|
||||
|
|
|
|||
|
|
@ -1248,18 +1248,6 @@ Declaration::GetPropertyValueInternal(
|
|||
// #2 <'grid-template-rows'> / [ auto-flow && dense? ] <'grid-auto-columns'>?
|
||||
// #3 [ auto-flow && dense? ] <'grid-auto-rows'>? / <'grid-template-columns'>
|
||||
case eCSSProperty_grid: {
|
||||
const nsCSSValue& columnGapValue =
|
||||
*data->ValueFor(eCSSProperty_grid_column_gap);
|
||||
if (columnGapValue.GetUnit() != eCSSUnit_Pixel ||
|
||||
columnGapValue.GetFloatValue() != 0.0f) {
|
||||
return; // Not serializable, bail.
|
||||
}
|
||||
const nsCSSValue& rowGapValue =
|
||||
*data->ValueFor(eCSSProperty_grid_row_gap);
|
||||
if (rowGapValue.GetUnit() != eCSSUnit_Pixel ||
|
||||
rowGapValue.GetFloatValue() != 0.0f) {
|
||||
return; // Not serializable, bail.
|
||||
}
|
||||
const nsCSSValue& areasValue =
|
||||
*data->ValueFor(eCSSProperty_grid_template_areas);
|
||||
const nsCSSValue& columnsValue =
|
||||
|
|
@ -1475,7 +1463,7 @@ Declaration::GetPropertyValueInternal(
|
|||
}
|
||||
MOZ_FALLTHROUGH;
|
||||
}
|
||||
case eCSSProperty_grid_gap: {
|
||||
case eCSSProperty_gap: {
|
||||
const nsCSSPropertyID* subprops =
|
||||
nsCSSProps::SubpropertyEntryFor(aProperty);
|
||||
MOZ_ASSERT(subprops[2] == eCSSProperty_UNKNOWN,
|
||||
|
|
|
|||
|
|
@ -205,6 +205,7 @@ CSS_KEY(column, column)
|
|||
CSS_KEY(column-reverse, column_reverse)
|
||||
CSS_KEY(condensed, condensed)
|
||||
CSS_KEY(contain, contain)
|
||||
CSS_KEY(content, content)
|
||||
CSS_KEY(content-box, content_box)
|
||||
CSS_KEY(contents, contents)
|
||||
CSS_KEY(context-fill, context_fill)
|
||||
|
|
|
|||
|
|
@ -1015,7 +1015,7 @@ protected:
|
|||
bool ParseGridColumnRow(nsCSSPropertyID aStartPropID,
|
||||
nsCSSPropertyID aEndPropID);
|
||||
bool ParseGridArea();
|
||||
bool ParseGridGap();
|
||||
bool ParseGap();
|
||||
|
||||
bool ParseInitialLetter();
|
||||
|
||||
|
|
@ -8638,7 +8638,7 @@ CSSParserImpl::ParseFlex()
|
|||
// "a unitless zero that is not already preceded by two flex factors must be
|
||||
// interpreted as a flex factor.
|
||||
if (ParseNonNegativeVariant(tmpVal, flexBasisVariantMask | VARIANT_NUMBER,
|
||||
nsCSSProps::kWidthKTable) != CSSParseResult::Ok) {
|
||||
nsCSSProps::kFlexBasisKTable) != CSSParseResult::Ok) {
|
||||
// First component was not a valid flex-basis or flex-grow value. Fail.
|
||||
return false;
|
||||
}
|
||||
|
|
@ -8687,7 +8687,7 @@ CSSParserImpl::ParseFlex()
|
|||
if (!wasFirstComponentFlexBasis) {
|
||||
CSSParseResult result =
|
||||
ParseNonNegativeVariant(tmpVal, flexBasisVariantMask,
|
||||
nsCSSProps::kWidthKTable);
|
||||
nsCSSProps::kFlexBasisKTable);
|
||||
if (result == CSSParseResult::Error) {
|
||||
return false;
|
||||
} else if (result == CSSParseResult::Ok) {
|
||||
|
|
@ -9774,13 +9774,6 @@ CSSParserImpl::ParseGrid()
|
|||
return true;
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/css-grid/#grid-shorthand
|
||||
// "Also, the gutter properties are reset by this shorthand,
|
||||
// even though they can't be set by it."
|
||||
value.SetFloatValue(0.0f, eCSSUnit_Pixel);
|
||||
AppendValue(eCSSProperty_grid_row_gap, value);
|
||||
AppendValue(eCSSProperty_grid_column_gap, value);
|
||||
|
||||
// [ auto-flow && dense? ] <'grid-auto-rows'>? / <'grid-template-columns'>
|
||||
auto res = ParseGridShorthandAutoProps(NS_STYLE_GRID_AUTO_FLOW_ROW);
|
||||
if (res == CSSParseResult::Error) {
|
||||
|
|
@ -10087,12 +10080,12 @@ CSSParserImpl::ParseGridArea()
|
|||
}
|
||||
|
||||
bool
|
||||
CSSParserImpl::ParseGridGap()
|
||||
CSSParserImpl::ParseGap()
|
||||
{
|
||||
nsCSSValue first;
|
||||
if (ParseSingleTokenVariant(first, VARIANT_INHERIT, nullptr)) {
|
||||
AppendValue(eCSSProperty_grid_row_gap, first);
|
||||
AppendValue(eCSSProperty_grid_column_gap, first);
|
||||
AppendValue(eCSSProperty_row_gap, first);
|
||||
AppendValue(eCSSProperty_column_gap, first);
|
||||
return true;
|
||||
}
|
||||
if (ParseNonNegativeVariant(first, VARIANT_LPCALC, nullptr) !=
|
||||
|
|
@ -10104,8 +10097,8 @@ CSSParserImpl::ParseGridGap()
|
|||
if (result == CSSParseResult::Error) {
|
||||
return false;
|
||||
}
|
||||
AppendValue(eCSSProperty_grid_row_gap, first);
|
||||
AppendValue(eCSSProperty_grid_column_gap,
|
||||
AppendValue(eCSSProperty_row_gap, first);
|
||||
AppendValue(eCSSProperty_column_gap,
|
||||
result == CSSParseResult::NotFound ? first : second);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -12005,8 +11998,8 @@ CSSParserImpl::ParsePropertyByFunction(nsCSSPropertyID aPropID)
|
|||
eCSSProperty_grid_row_end);
|
||||
case eCSSProperty_grid_area:
|
||||
return ParseGridArea();
|
||||
case eCSSProperty_grid_gap:
|
||||
return ParseGridGap();
|
||||
case eCSSProperty_gap:
|
||||
return ParseGap();
|
||||
case eCSSProperty_image_region:
|
||||
return ParseRect(eCSSProperty_image_region);
|
||||
case eCSSProperty_align_content:
|
||||
|
|
|
|||
|
|
@ -34,6 +34,18 @@
|
|||
|
||||
******/
|
||||
|
||||
CSS_PROP_ALIAS(grid-gap,
|
||||
gap,
|
||||
GridGap,
|
||||
"")
|
||||
CSS_PROP_ALIAS(grid-column-gap,
|
||||
column_gap,
|
||||
GridColumnGap,
|
||||
"")
|
||||
CSS_PROP_ALIAS(grid-row-gap,
|
||||
row_gap,
|
||||
GridRowGap,
|
||||
"")
|
||||
CSS_PROP_ALIAS(word-wrap,
|
||||
overflow_wrap,
|
||||
WordWrap,
|
||||
|
|
|
|||
|
|
@ -1516,7 +1516,7 @@ CSS_PROP_COLUMN(
|
|||
kColumnFillKTable,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
eStyleAnimType_Discrete)
|
||||
CSS_PROP_COLUMN(
|
||||
CSS_PROP_POSITION(
|
||||
column-gap,
|
||||
column_gap,
|
||||
ColumnGap,
|
||||
|
|
@ -1525,7 +1525,7 @@ CSS_PROP_COLUMN(
|
|||
"",
|
||||
VARIANT_HLP | VARIANT_NORMAL | VARIANT_CALC,
|
||||
nullptr,
|
||||
offsetof(nsStyleColumn, mColumnGap),
|
||||
offsetof(nsStylePosition, mColumnGap),
|
||||
eStyleAnimType_Coord)
|
||||
CSS_PROP_SHORTHAND(
|
||||
column-rule,
|
||||
|
|
@ -1758,7 +1758,7 @@ CSS_PROP_POSITION(
|
|||
// its own code to parse each subproperty. It does not depend on the
|
||||
// longhand parsing defined here.
|
||||
VARIANT_AHKLP | VARIANT_CALC,
|
||||
kWidthKTable,
|
||||
kFlexBasisKTable,
|
||||
offsetof(nsStylePosition, mFlexBasis),
|
||||
eStyleAnimType_Coord)
|
||||
CSS_PROP_POSITION(
|
||||
|
|
@ -2099,26 +2099,31 @@ CSS_PROP_UIRESET(
|
|||
nullptr,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
eStyleAnimType_Discrete) // bug 58646
|
||||
CSS_PROP_SHORTHAND(
|
||||
gap,
|
||||
gap,
|
||||
Gap,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"")
|
||||
CSS_PROP_SHORTHAND(
|
||||
grid,
|
||||
grid,
|
||||
Grid,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"layout.css.grid.enabled")
|
||||
"")
|
||||
CSS_PROP_SHORTHAND(
|
||||
grid-area,
|
||||
grid_area,
|
||||
GridArea,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"layout.css.grid.enabled")
|
||||
"")
|
||||
CSS_PROP_POSITION(
|
||||
grid-auto-columns,
|
||||
grid_auto_columns,
|
||||
GridAutoColumns,
|
||||
CSS_PROPERTY_PARSE_FUNCTION |
|
||||
CSS_PROPERTY_STORES_CALC |
|
||||
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
|
||||
"layout.css.grid.enabled",
|
||||
CSS_PROPERTY_STORES_CALC,
|
||||
"",
|
||||
0,
|
||||
kGridTrackBreadthKTable,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
|
|
@ -2127,9 +2132,8 @@ CSS_PROP_POSITION(
|
|||
grid-auto-flow,
|
||||
grid_auto_flow,
|
||||
GridAutoFlow,
|
||||
CSS_PROPERTY_PARSE_FUNCTION |
|
||||
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
|
||||
"layout.css.grid.enabled",
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"",
|
||||
0,
|
||||
kGridAutoFlowKTable,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
|
|
@ -2139,9 +2143,8 @@ CSS_PROP_POSITION(
|
|||
grid_auto_rows,
|
||||
GridAutoRows,
|
||||
CSS_PROPERTY_PARSE_FUNCTION |
|
||||
CSS_PROPERTY_STORES_CALC |
|
||||
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
|
||||
"layout.css.grid.enabled",
|
||||
CSS_PROPERTY_STORES_CALC,
|
||||
"",
|
||||
0,
|
||||
kGridTrackBreadthKTable,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
|
|
@ -2151,79 +2154,49 @@ CSS_PROP_SHORTHAND(
|
|||
grid_column,
|
||||
GridColumn,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"layout.css.grid.enabled")
|
||||
"")
|
||||
CSS_PROP_POSITION(
|
||||
grid-column-end,
|
||||
grid_column_end,
|
||||
GridColumnEnd,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"layout.css.grid.enabled",
|
||||
"",
|
||||
0,
|
||||
nullptr,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
eStyleAnimType_Discrete)
|
||||
CSS_PROP_POSITION(
|
||||
grid-column-gap,
|
||||
grid_column_gap,
|
||||
GridColumnGap,
|
||||
CSS_PROPERTY_PARSE_VALUE |
|
||||
CSS_PROPERTY_VALUE_NONNEGATIVE |
|
||||
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
|
||||
"layout.css.grid.enabled",
|
||||
VARIANT_HLP | VARIANT_CALC,
|
||||
nullptr,
|
||||
offsetof(nsStylePosition, mGridColumnGap),
|
||||
eStyleAnimType_Coord)
|
||||
CSS_PROP_POSITION(
|
||||
grid-column-start,
|
||||
grid_column_start,
|
||||
GridColumnStart,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"layout.css.grid.enabled",
|
||||
"",
|
||||
0,
|
||||
nullptr,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
eStyleAnimType_Discrete)
|
||||
CSS_PROP_SHORTHAND(
|
||||
grid-gap,
|
||||
grid_gap,
|
||||
GridGap,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"layout.css.grid.enabled")
|
||||
CSS_PROP_SHORTHAND(
|
||||
grid-row,
|
||||
grid_row,
|
||||
GridRow,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"layout.css.grid.enabled")
|
||||
"")
|
||||
CSS_PROP_POSITION(
|
||||
grid-row-end,
|
||||
grid_row_end,
|
||||
GridRowEnd,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"layout.css.grid.enabled",
|
||||
"",
|
||||
0,
|
||||
nullptr,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
eStyleAnimType_Discrete)
|
||||
CSS_PROP_POSITION(
|
||||
grid-row-gap,
|
||||
grid_row_gap,
|
||||
GridRowGap,
|
||||
CSS_PROPERTY_PARSE_VALUE |
|
||||
CSS_PROPERTY_VALUE_NONNEGATIVE |
|
||||
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
|
||||
"layout.css.grid.enabled",
|
||||
VARIANT_HLP | VARIANT_CALC,
|
||||
nullptr,
|
||||
offsetof(nsStylePosition, mGridRowGap),
|
||||
eStyleAnimType_Coord)
|
||||
CSS_PROP_POSITION(
|
||||
grid-row-start,
|
||||
grid_row_start,
|
||||
GridRowStart,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"layout.css.grid.enabled",
|
||||
"",
|
||||
0,
|
||||
nullptr,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
|
|
@ -2233,14 +2206,13 @@ CSS_PROP_SHORTHAND(
|
|||
grid_template,
|
||||
GridTemplate,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"layout.css.grid.enabled")
|
||||
"")
|
||||
CSS_PROP_POSITION(
|
||||
grid-template-areas,
|
||||
grid_template_areas,
|
||||
GridTemplateAreas,
|
||||
CSS_PROPERTY_PARSE_FUNCTION |
|
||||
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
|
||||
"layout.css.grid.enabled",
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"",
|
||||
0,
|
||||
nullptr,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
|
|
@ -2251,9 +2223,8 @@ CSS_PROP_POSITION(
|
|||
GridTemplateColumns,
|
||||
CSS_PROPERTY_PARSE_FUNCTION |
|
||||
CSS_PROPERTY_STORES_CALC |
|
||||
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
|
||||
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
|
||||
"layout.css.grid.enabled",
|
||||
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
|
||||
"",
|
||||
0,
|
||||
kGridTrackBreadthKTable,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
|
|
@ -2264,9 +2235,8 @@ CSS_PROP_POSITION(
|
|||
GridTemplateRows,
|
||||
CSS_PROPERTY_PARSE_FUNCTION |
|
||||
CSS_PROPERTY_STORES_CALC |
|
||||
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
|
||||
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
|
||||
"layout.css.grid.enabled",
|
||||
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
|
||||
"",
|
||||
0,
|
||||
kGridTrackBreadthKTable,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
|
|
@ -3560,6 +3530,17 @@ CSS_PROP_POSITION(
|
|||
nullptr,
|
||||
offsetof(nsStylePosition, mOffset),
|
||||
eStyleAnimType_Sides_Right)
|
||||
CSS_PROP_POSITION(
|
||||
row-gap,
|
||||
row_gap,
|
||||
RowGap,
|
||||
CSS_PROPERTY_PARSE_VALUE |
|
||||
CSS_PROPERTY_VALUE_NONNEGATIVE,
|
||||
"",
|
||||
VARIANT_HLP | VARIANT_NORMAL | VARIANT_CALC,
|
||||
nullptr,
|
||||
offsetof(nsStylePosition, mRowGap),
|
||||
eStyleAnimType_Coord)
|
||||
CSS_PROP_TEXT(
|
||||
ruby-align,
|
||||
ruby_align,
|
||||
|
|
|
|||
|
|
@ -1334,7 +1334,6 @@ KTableEntry nsCSSProps::kDisplayKTable[] = {
|
|||
{ eCSSKeyword_ruby_base_container, StyleDisplay::RubyBaseContainer },
|
||||
{ eCSSKeyword_ruby_text, StyleDisplay::RubyText },
|
||||
{ eCSSKeyword_ruby_text_container, StyleDisplay::RubyTextContainer },
|
||||
// The next two entries are controlled by the layout.css.grid.enabled pref.
|
||||
{ eCSSKeyword_grid, StyleDisplay::Grid },
|
||||
{ eCSSKeyword_inline_grid, StyleDisplay::InlineGrid },
|
||||
// The next 4 entries are controlled by the layout.css.prefixes.webkit pref.
|
||||
|
|
@ -2264,6 +2263,20 @@ const KTableEntry nsCSSProps::kWidthKTable[] = {
|
|||
{ eCSSKeyword_UNKNOWN, -1 }
|
||||
};
|
||||
|
||||
// This must be the same as kWidthKTable, but just with 'content' added:
|
||||
const KTableEntry nsCSSProps::kFlexBasisKTable[] = {
|
||||
{ eCSSKeyword__moz_max_content, NS_STYLE_WIDTH_MAX_CONTENT },
|
||||
{ eCSSKeyword__moz_min_content, NS_STYLE_WIDTH_MIN_CONTENT },
|
||||
{ eCSSKeyword__moz_fit_content, NS_STYLE_WIDTH_FIT_CONTENT },
|
||||
{ eCSSKeyword__moz_available, NS_STYLE_WIDTH_AVAILABLE },
|
||||
{ eCSSKeyword_content, NS_STYLE_FLEX_BASIS_CONTENT },
|
||||
{ eCSSKeyword_UNKNOWN, -1 }
|
||||
};
|
||||
static_assert(ArrayLength(nsCSSProps::kFlexBasisKTable) ==
|
||||
ArrayLength(nsCSSProps::kWidthKTable) + 1,
|
||||
"kFlexBasisKTable should have the same entries as "
|
||||
"kWidthKTable, plus one more for 'content'");
|
||||
|
||||
const KTableEntry nsCSSProps::kWindowDraggingKTable[] = {
|
||||
{ eCSSKeyword_default, StyleWindowDragging::Default },
|
||||
{ eCSSKeyword_drag, StyleWindowDragging::Drag },
|
||||
|
|
@ -2955,8 +2968,6 @@ static const nsCSSPropertyID gGridSubpropTable[] = {
|
|||
eCSSProperty_grid_auto_flow,
|
||||
eCSSProperty_grid_auto_rows,
|
||||
eCSSProperty_grid_auto_columns,
|
||||
eCSSProperty_grid_row_gap, // can only be reset, not get/set
|
||||
eCSSProperty_grid_column_gap, // can only be reset, not get/set
|
||||
eCSSProperty_UNKNOWN
|
||||
};
|
||||
|
||||
|
|
@ -2980,9 +2991,9 @@ static const nsCSSPropertyID gGridAreaSubpropTable[] = {
|
|||
eCSSProperty_UNKNOWN
|
||||
};
|
||||
|
||||
static const nsCSSPropertyID gGridGapSubpropTable[] = {
|
||||
eCSSProperty_grid_row_gap,
|
||||
eCSSProperty_grid_column_gap,
|
||||
static const nsCSSPropertyID gGapSubpropTable[] = {
|
||||
eCSSProperty_row_gap,
|
||||
eCSSProperty_column_gap,
|
||||
eCSSProperty_UNKNOWN
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -892,6 +892,7 @@ public:
|
|||
static const KTableEntry kVolumeKTable[];
|
||||
static const KTableEntry kWhitespaceKTable[];
|
||||
static const KTableEntry kWidthKTable[]; // also min-width, max-width
|
||||
static const KTableEntry kFlexBasisKTable[];
|
||||
static const KTableEntry kWindowDraggingKTable[];
|
||||
static const KTableEntry kWindowShadowKTable[];
|
||||
static const KTableEntry kWordBreakKTable[];
|
||||
|
|
|
|||
|
|
@ -1092,21 +1092,6 @@ nsComputedDOMStyle::DoGetColumnWidth()
|
|||
return val.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<CSSValue>
|
||||
nsComputedDOMStyle::DoGetColumnGap()
|
||||
{
|
||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||
|
||||
const nsStyleColumn* column = StyleColumn();
|
||||
if (column->mColumnGap.GetUnit() == eStyleUnit_Normal) {
|
||||
val->SetAppUnits(StyleFont()->mFont.size);
|
||||
} else {
|
||||
SetValueToCoord(val, StyleColumn()->mColumnGap, true);
|
||||
}
|
||||
|
||||
return val.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<CSSValue>
|
||||
nsComputedDOMStyle::DoGetColumnFill()
|
||||
{
|
||||
|
|
@ -3003,18 +2988,32 @@ nsComputedDOMStyle::DoGetGridRowEnd()
|
|||
}
|
||||
|
||||
already_AddRefed<CSSValue>
|
||||
nsComputedDOMStyle::DoGetGridColumnGap()
|
||||
nsComputedDOMStyle::DoGetColumnGap()
|
||||
{
|
||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||
SetValueToCoord(val, StylePosition()->mGridColumnGap, true);
|
||||
|
||||
const nsStylePosition* positionData = StylePosition();
|
||||
if (positionData->mColumnGap.GetUnit() == eStyleUnit_Normal) {
|
||||
val->SetIdent(eCSSKeyword_normal);
|
||||
} else {
|
||||
SetValueToCoord(val, positionData->mColumnGap, true);
|
||||
}
|
||||
|
||||
return val.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<CSSValue>
|
||||
nsComputedDOMStyle::DoGetGridRowGap()
|
||||
nsComputedDOMStyle::DoGetRowGap()
|
||||
{
|
||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||
SetValueToCoord(val, StylePosition()->mGridRowGap, true);
|
||||
|
||||
const nsStylePosition* positionData = StylePosition();
|
||||
if (positionData->mRowGap.GetUnit() == eStyleUnit_Normal) {
|
||||
val->SetIdent(eCSSKeyword_normal);
|
||||
} else {
|
||||
SetValueToCoord(val, positionData->mRowGap, true);
|
||||
}
|
||||
|
||||
return val.forget();
|
||||
}
|
||||
|
||||
|
|
@ -4425,7 +4424,7 @@ nsComputedDOMStyle::DoGetFlexBasis()
|
|||
// }
|
||||
|
||||
SetValueToCoord(val, StylePosition()->mFlexBasis, true,
|
||||
nullptr, nsCSSProps::kWidthKTable);
|
||||
nullptr, nsCSSProps::kFlexBasisKTable);
|
||||
return val.forget();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -286,8 +286,6 @@ private:
|
|||
already_AddRefed<CSSValue> DoGetGridColumnEnd();
|
||||
already_AddRefed<CSSValue> DoGetGridRowStart();
|
||||
already_AddRefed<CSSValue> DoGetGridRowEnd();
|
||||
already_AddRefed<CSSValue> DoGetGridColumnGap();
|
||||
already_AddRefed<CSSValue> DoGetGridRowGap();
|
||||
|
||||
/* StyleImageLayer properties */
|
||||
already_AddRefed<CSSValue> DoGetImageLayerImage(const nsStyleImageLayers& aLayers);
|
||||
|
|
@ -503,7 +501,6 @@ private:
|
|||
already_AddRefed<CSSValue> DoGetColumnCount();
|
||||
already_AddRefed<CSSValue> DoGetColumnFill();
|
||||
already_AddRefed<CSSValue> DoGetColumnWidth();
|
||||
already_AddRefed<CSSValue> DoGetColumnGap();
|
||||
already_AddRefed<CSSValue> DoGetColumnRuleWidth();
|
||||
already_AddRefed<CSSValue> DoGetColumnRuleStyle();
|
||||
already_AddRefed<CSSValue> DoGetColumnRuleColor();
|
||||
|
|
@ -541,6 +538,8 @@ private:
|
|||
already_AddRefed<CSSValue> DoGetJustifyContent();
|
||||
already_AddRefed<CSSValue> DoGetJustifyItems();
|
||||
already_AddRefed<CSSValue> DoGetJustifySelf();
|
||||
already_AddRefed<CSSValue> DoGetColumnGap();
|
||||
already_AddRefed<CSSValue> DoGetRowGap();
|
||||
|
||||
/* SVG properties */
|
||||
already_AddRefed<CSSValue> DoGetFill();
|
||||
|
|
|
|||
|
|
@ -151,10 +151,8 @@ COMPUTED_STYLE_PROP(grid_auto_columns, GridAutoColumns)
|
|||
COMPUTED_STYLE_PROP(grid_auto_flow, GridAutoFlow)
|
||||
COMPUTED_STYLE_PROP(grid_auto_rows, GridAutoRows)
|
||||
COMPUTED_STYLE_PROP(grid_column_end, GridColumnEnd)
|
||||
COMPUTED_STYLE_PROP(grid_column_gap, GridColumnGap)
|
||||
COMPUTED_STYLE_PROP(grid_column_start, GridColumnStart)
|
||||
COMPUTED_STYLE_PROP(grid_row_end, GridRowEnd)
|
||||
COMPUTED_STYLE_PROP(grid_row_gap, GridRowGap)
|
||||
COMPUTED_STYLE_PROP(grid_row_start, GridRowStart)
|
||||
COMPUTED_STYLE_PROP(grid_template_areas, GridTemplateAreas)
|
||||
COMPUTED_STYLE_PROP(grid_template_columns, GridTemplateColumns)
|
||||
|
|
@ -217,6 +215,7 @@ COMPUTED_STYLE_PROP(position, Position)
|
|||
COMPUTED_STYLE_PROP(quotes, Quotes)
|
||||
COMPUTED_STYLE_PROP(resize, Resize)
|
||||
COMPUTED_STYLE_PROP(right, Right)
|
||||
COMPUTED_STYLE_PROP(row_gap, RowGap)
|
||||
COMPUTED_STYLE_PROP(ruby_align, RubyAlign)
|
||||
COMPUTED_STYLE_PROP(ruby_position, RubyPosition)
|
||||
COMPUTED_STYLE_PROP(scroll_behavior, ScrollBehavior)
|
||||
|
|
|
|||
|
|
@ -379,8 +379,6 @@ nsLayoutStylesheetCache::For(StyleBackendType aType)
|
|||
// style sheets will be re-parsed.
|
||||
// Preferences::RegisterCallback(&DependentPrefChanged,
|
||||
// "layout.css.example-pref.enabled");
|
||||
Preferences::RegisterCallback(&DependentPrefChanged,
|
||||
"layout.css.grid.enabled");
|
||||
Preferences::RegisterCallback(&DependentPrefChanged,
|
||||
"dom.details_element.enabled");
|
||||
}
|
||||
|
|
@ -553,7 +551,7 @@ nsLayoutStylesheetCache::DependentPrefChanged(const char* aPref, void* aData)
|
|||
InvalidateSheet(gStyleCache_Gecko ? &gStyleCache_Gecko->sheet_ : nullptr, \
|
||||
gStyleCache_Servo ? &gStyleCache_Servo->sheet_ : nullptr);
|
||||
|
||||
INVALIDATE(mUASheet); // for layout.css.grid.enabled
|
||||
// INVALIDATE(mUASheet); // for layout.css.example-pref.enabled
|
||||
INVALIDATE(mHTMLSheet); // for dom.details_element.enabled
|
||||
|
||||
#undef INVALIDATE
|
||||
|
|
|
|||
|
|
@ -8877,25 +8877,27 @@ nsRuleNode::ComputePositionData(void* aStartStruct,
|
|||
parentPos->mGridRowEnd,
|
||||
conditions);
|
||||
|
||||
// grid-column-gap
|
||||
if (SetCoord(*aRuleData->ValueForGridColumnGap(),
|
||||
pos->mGridColumnGap, parentPos->mGridColumnGap,
|
||||
SETCOORD_LPH | SETCOORD_INITIAL_ZERO | SETCOORD_STORE_CALC |
|
||||
SETCOORD_CALC_CLAMP_NONNEGATIVE | SETCOORD_UNSET_INITIAL,
|
||||
// column-gap: normal, length, percent, calc, inherit, initial
|
||||
if (SetCoord(*aRuleData->ValueForColumnGap(),
|
||||
pos->mColumnGap, parentPos->mColumnGap,
|
||||
SETCOORD_LPH | SETCOORD_NORMAL | SETCOORD_INITIAL_NORMAL |
|
||||
SETCOORD_STORE_CALC | SETCOORD_CALC_CLAMP_NONNEGATIVE |
|
||||
SETCOORD_UNSET_INITIAL,
|
||||
aContext, mPresContext, conditions)) {
|
||||
} else {
|
||||
MOZ_ASSERT(aRuleData->ValueForGridColumnGap()->GetUnit() == eCSSUnit_Null,
|
||||
MOZ_ASSERT(aRuleData->ValueForColumnGap()->GetUnit() == eCSSUnit_Null,
|
||||
"unexpected unit");
|
||||
}
|
||||
|
||||
// grid-row-gap
|
||||
if (SetCoord(*aRuleData->ValueForGridRowGap(),
|
||||
pos->mGridRowGap, parentPos->mGridRowGap,
|
||||
SETCOORD_LPH | SETCOORD_INITIAL_ZERO | SETCOORD_STORE_CALC |
|
||||
SETCOORD_CALC_CLAMP_NONNEGATIVE | SETCOORD_UNSET_INITIAL,
|
||||
// row-gap: normal, length, percent, calc, inherit, initial
|
||||
if (SetCoord(*aRuleData->ValueForRowGap(),
|
||||
pos->mRowGap, parentPos->mRowGap,
|
||||
SETCOORD_LPH | SETCOORD_NORMAL | SETCOORD_INITIAL_NORMAL |
|
||||
SETCOORD_STORE_CALC | SETCOORD_CALC_CLAMP_NONNEGATIVE |
|
||||
SETCOORD_UNSET_INITIAL,
|
||||
aContext, mPresContext, conditions)) {
|
||||
} else {
|
||||
MOZ_ASSERT(aRuleData->ValueForGridRowGap()->GetUnit() == eCSSUnit_Null,
|
||||
MOZ_ASSERT(aRuleData->ValueForRowGap()->GetUnit() == eCSSUnit_Null,
|
||||
"unexpected unit");
|
||||
}
|
||||
|
||||
|
|
@ -9302,18 +9304,6 @@ nsRuleNode::ComputeColumnData(void* aStartStruct,
|
|||
SETCOORD_UNSET_INITIAL,
|
||||
aContext, mPresContext, conditions);
|
||||
|
||||
// column-gap: length, inherit, normal
|
||||
SetCoord(*aRuleData->ValueForColumnGap(),
|
||||
column->mColumnGap, parent->mColumnGap,
|
||||
SETCOORD_LH | SETCOORD_NORMAL | SETCOORD_INITIAL_NORMAL |
|
||||
SETCOORD_CALC_LENGTH_ONLY | SETCOORD_UNSET_INITIAL,
|
||||
aContext, mPresContext, conditions);
|
||||
// clamp negative calc() to 0
|
||||
if (column->mColumnGap.GetUnit() == eStyleUnit_Coord) {
|
||||
column->mColumnGap.SetCoordValue(
|
||||
std::max(column->mColumnGap.GetCoordValue(), 0));
|
||||
}
|
||||
|
||||
// column-count: auto, integer, inherit
|
||||
const nsCSSValue* columnCountValue = aRuleData->ValueForColumnCount();
|
||||
if (eCSSUnit_Auto == columnCountValue->GetUnit() ||
|
||||
|
|
|
|||
|
|
@ -778,6 +778,12 @@ enum class StyleDisplay : uint8_t {
|
|||
#define NS_STYLE_WIDTH_MIN_CONTENT 1
|
||||
#define NS_STYLE_WIDTH_FIT_CONTENT 2
|
||||
#define NS_STYLE_WIDTH_AVAILABLE 3
|
||||
// The 'content' keyword is only valid for 'flex-basis' (not for 'width').
|
||||
// Since the 'flex-basis' property accepts exactly the same values as 'width',
|
||||
// this 'flex-basis'-specific enumerated value is listed alongside the
|
||||
// 'width' ones, to be sure we don't accidentally overload this numeric
|
||||
// value with two different meanings if new 'width' keywords are added.
|
||||
#define NS_STYLE_FLEX_BASIS_CONTENT 4
|
||||
|
||||
// See nsStyleDisplay.mPosition
|
||||
#define NS_STYLE_POSITION_STATIC 0
|
||||
|
|
|
|||
|
|
@ -825,7 +825,6 @@ nsStyleXUL::CalcDifference(const nsStyleXUL& aNewData) const
|
|||
nsStyleColumn::nsStyleColumn(StyleStructContext aContext)
|
||||
: mColumnCount(NS_STYLE_COLUMN_COUNT_AUTO)
|
||||
, mColumnWidth(eStyleUnit_Auto)
|
||||
, mColumnGap(eStyleUnit_Normal)
|
||||
, mColumnRuleColor(StyleComplexColor::CurrentColor())
|
||||
, mColumnRuleStyle(NS_STYLE_BORDER_STYLE_NONE)
|
||||
, mColumnFill(NS_STYLE_COLUMN_FILL_BALANCE)
|
||||
|
|
@ -844,7 +843,6 @@ nsStyleColumn::~nsStyleColumn()
|
|||
nsStyleColumn::nsStyleColumn(const nsStyleColumn& aSource)
|
||||
: mColumnCount(aSource.mColumnCount)
|
||||
, mColumnWidth(aSource.mColumnWidth)
|
||||
, mColumnGap(aSource.mColumnGap)
|
||||
, mColumnRuleColor(aSource.mColumnRuleColor)
|
||||
, mColumnRuleStyle(aSource.mColumnRuleStyle)
|
||||
, mColumnFill(aSource.mColumnFill)
|
||||
|
|
@ -867,7 +865,6 @@ nsStyleColumn::CalcDifference(const nsStyleColumn& aNewData) const
|
|||
}
|
||||
|
||||
if (mColumnWidth != aNewData.mColumnWidth ||
|
||||
mColumnGap != aNewData.mColumnGap ||
|
||||
mColumnFill != aNewData.mColumnFill) {
|
||||
return NS_STYLE_HINT_REFLOW;
|
||||
}
|
||||
|
|
@ -1423,8 +1420,8 @@ nsStylePosition::nsStylePosition(StyleStructContext aContext)
|
|||
, mFlexGrow(0.0f)
|
||||
, mFlexShrink(1.0f)
|
||||
, mZIndex(eStyleUnit_Auto)
|
||||
, mGridColumnGap(nscoord(0), nsStyleCoord::CoordConstructor)
|
||||
, mGridRowGap(nscoord(0), nsStyleCoord::CoordConstructor)
|
||||
, mColumnGap(eStyleUnit_Normal)
|
||||
, mRowGap(eStyleUnit_Normal)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsStylePosition);
|
||||
|
||||
|
|
@ -1489,8 +1486,8 @@ nsStylePosition::nsStylePosition(const nsStylePosition& aSource)
|
|||
, mGridColumnEnd(aSource.mGridColumnEnd)
|
||||
, mGridRowStart(aSource.mGridRowStart)
|
||||
, mGridRowEnd(aSource.mGridRowEnd)
|
||||
, mGridColumnGap(aSource.mGridColumnGap)
|
||||
, mGridRowGap(aSource.mGridRowGap)
|
||||
, mColumnGap(aSource.mColumnGap)
|
||||
, mRowGap(aSource.mRowGap)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsStylePosition);
|
||||
}
|
||||
|
|
@ -1590,8 +1587,8 @@ nsStylePosition::CalcDifference(const nsStylePosition& aNewData,
|
|||
mGridColumnEnd != aNewData.mGridColumnEnd ||
|
||||
mGridRowStart != aNewData.mGridRowStart ||
|
||||
mGridRowEnd != aNewData.mGridRowEnd ||
|
||||
mGridColumnGap != aNewData.mGridColumnGap ||
|
||||
mGridRowGap != aNewData.mGridRowGap) {
|
||||
mColumnGap != aNewData.mColumnGap ||
|
||||
mRowGap != aNewData.mRowGap) {
|
||||
return hint |
|
||||
nsChangeHint_AllReflowHints;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1848,8 +1848,8 @@ public:
|
|||
nsStyleGridLine mGridColumnEnd;
|
||||
nsStyleGridLine mGridRowStart;
|
||||
nsStyleGridLine mGridRowEnd;
|
||||
nsStyleCoord mGridColumnGap; // [reset] coord, percent, calc
|
||||
nsStyleCoord mGridRowGap; // [reset] coord, percent, calc
|
||||
nsStyleCoord mColumnGap; // [reset] normal, coord, percent, calc
|
||||
nsStyleCoord mRowGap; // [reset] normal, coord, percent, calc
|
||||
|
||||
// FIXME: Logical-coordinate equivalents to these WidthDepends... and
|
||||
// HeightDepends... methods have been introduced (see below); we probably
|
||||
|
|
@ -3502,7 +3502,6 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleColumn
|
|||
|
||||
uint32_t mColumnCount; // [reset] see nsStyleConsts.h
|
||||
nsStyleCoord mColumnWidth; // [reset] coord, auto
|
||||
nsStyleCoord mColumnGap; // [reset] <length-percentage> | normal
|
||||
|
||||
mozilla::StyleComplexColor mColumnRuleColor; // [reset]
|
||||
uint8_t mColumnRuleStyle; // [reset]
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -69,8 +69,6 @@ var supported_properties = {
|
|||
"box-shadow": [ test_shadow_transition ],
|
||||
"column-count": [ test_pos_integer_or_auto_transition,
|
||||
test_integer_at_least_one_clamping ],
|
||||
"column-gap": [ test_length_transition,
|
||||
test_length_clamped ],
|
||||
"column-rule-color": [ test_color_transition,
|
||||
test_true_currentcolor_transition ],
|
||||
"column-rule-width": [ test_length_transition,
|
||||
|
|
@ -161,8 +159,8 @@ var supported_properties = {
|
|||
/* test_float_zeroToOne_clamped */ ],
|
||||
"font-stretch": [ test_font_stretch ],
|
||||
"font-weight": [ test_font_weight ],
|
||||
"grid-column-gap": [ test_grid_gap ],
|
||||
"grid-row-gap": [ test_grid_gap ],
|
||||
"column-gap": [ test_gap ],
|
||||
"row-gap": [ test_gap ],
|
||||
"height": [ test_length_transition, test_percent_transition,
|
||||
test_length_percent_calc_transition,
|
||||
test_length_clamped, test_percent_clamped ],
|
||||
|
|
@ -1922,10 +1920,7 @@ function test_font_weight(prop) {
|
|||
div.style.setProperty("transition-timing-function", "linear", "");
|
||||
}
|
||||
|
||||
function test_grid_gap(prop) {
|
||||
if (!SpecialPowers.getBoolPref("layout.css.grid.enabled")) {
|
||||
return;
|
||||
}
|
||||
function test_gap(prop) {
|
||||
test_length_transition(prop);
|
||||
test_length_clamped(prop);
|
||||
test_percent_transition(prop);
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ int mar_enum_items(MarFile *mar, MarItemCallback callback, void *data);
|
|||
* @return The number of bytes written or a negative value if an
|
||||
* error occurs.
|
||||
*/
|
||||
int mar_read(MarFile *mar, const MarItem *item, int offset, char *buf,
|
||||
int mar_read(MarFile *mar, const MarItem *item, int offset, uint8_t *buf,
|
||||
int bufsize);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ static int mar_ensure_parent_dir(const char *path)
|
|||
|
||||
static int mar_test_callback(MarFile *mar, const MarItem *item, void *unused) {
|
||||
FILE *fp;
|
||||
char buf[BLOCKSIZE];
|
||||
uint8_t buf[BLOCKSIZE];
|
||||
int fd, len, offset = 0;
|
||||
|
||||
if (mar_ensure_parent_dir(item->name))
|
||||
|
|
|
|||
|
|
@ -530,7 +530,7 @@ int mar_enum_items(MarFile *mar, MarItemCallback callback, void *closure) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int mar_read(MarFile *mar, const MarItem *item, int offset, char *buf,
|
||||
int mar_read(MarFile *mar, const MarItem *item, int offset, uint8_t *buf,
|
||||
int bufsize) {
|
||||
int nr;
|
||||
|
||||
|
|
|
|||
|
|
@ -2547,9 +2547,6 @@ pref("layout.css.variables.enabled", true);
|
|||
// Is support for CSS overflow-clip-box enabled for non-UA sheets?
|
||||
pref("layout.css.overflow-clip-box.enabled", false);
|
||||
|
||||
// Is support for CSS grid enabled?
|
||||
pref("layout.css.grid.enabled", true);
|
||||
|
||||
// Is support for CSS "grid-template-{columns,rows}: subgrid X" enabled?
|
||||
pref("layout.css.grid-template-subgrid-value.enabled", false);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
This is the XZ Embedded decompression library from
|
||||
http://tukaani.org/xz/embedded.html.
|
||||
https://tukaani.org/xz/embedded.html.
|
||||
|
||||
Upstream code can be viewed at
|
||||
http://git.tukaani.org/xz-embedded.git
|
||||
https://git.tukaani.org/xz-embedded.git
|
||||
|
||||
and cloned by
|
||||
git clone http://git.tukaani.org/xz-embedded.git
|
||||
git clone https://git.tukaani.org/xz-embedded.git
|
||||
|
||||
The in-tree copy is updated by running
|
||||
sh update.sh
|
||||
from within the modules/xz-embedded directory.
|
||||
|
||||
Current version: [e75f4eb79165213a02d567940d344f5c2ff1be03].
|
||||
Current version: [3f438e15109229bb14ab45f285f4bff5412a9542].
|
||||
|
|
|
|||
|
|
@ -29,4 +29,7 @@ elif '86' in CONFIG['TARGET_CPU']:
|
|||
|
||||
DEFINES['XZ_USE_CRC64'] = 1
|
||||
|
||||
if CONFIG['OS_ARCH'] == 'WINNT':
|
||||
USE_STATIC_LIBS = True
|
||||
|
||||
Library('xz-embedded')
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
* XZ decompressor
|
||||
*
|
||||
* Authors: Lasse Collin <lasse.collin@tukaani.org>
|
||||
* Igor Pavlov <http://7-zip.org/>
|
||||
* Igor Pavlov <https://7-zip.org/>
|
||||
*
|
||||
* This file has been put into the public domain.
|
||||
* You can do whatever you want with this file.
|
||||
|
|
@ -32,7 +32,7 @@ extern "C" {
|
|||
* enum xz_mode - Operation mode
|
||||
*
|
||||
* @XZ_SINGLE: Single-call mode. This uses less RAM than
|
||||
* than multi-call modes, because the LZMA2
|
||||
* multi-call modes, because the LZMA2
|
||||
* dictionary doesn't need to be allocated as
|
||||
* part of the decoder state. All required data
|
||||
* structures are allocated at initialization,
|
||||
|
|
@ -198,7 +198,7 @@ struct xz_dec;
|
|||
XZ_EXTERN struct xz_dec *xz_dec_init(enum xz_mode mode, uint32_t dict_max);
|
||||
|
||||
/**
|
||||
* xz_dec_run() - Run the XZ decoder
|
||||
* xz_dec_run() - Run the XZ decoder for a single XZ stream
|
||||
* @s: Decoder state allocated using xz_dec_init()
|
||||
* @b: Input and output buffers
|
||||
*
|
||||
|
|
@ -214,9 +214,51 @@ XZ_EXTERN struct xz_dec *xz_dec_init(enum xz_mode mode, uint32_t dict_max);
|
|||
* cannot give the single-call decoder a too small buffer and then expect to
|
||||
* get that amount valid data from the beginning of the stream. You must use
|
||||
* the multi-call decoder if you don't want to uncompress the whole stream.
|
||||
*
|
||||
* Use xz_dec_run() when XZ data is stored inside some other file format.
|
||||
* The decoding will stop after one XZ stream has been decompresed. To
|
||||
* decompress regular .xz files which might have multiple concatenated
|
||||
* streams, use xz_dec_catrun() instead.
|
||||
*/
|
||||
XZ_EXTERN enum xz_ret xz_dec_run(struct xz_dec *s, struct xz_buf *b);
|
||||
|
||||
/**
|
||||
* xz_dec_catrun() - Run the XZ decoder with support for concatenated streams
|
||||
* @s: Decoder state allocated using xz_dec_init()
|
||||
* @b: Input and output buffers
|
||||
* @finish: This is an int instead of bool to avoid requiring stdbool.h.
|
||||
* As long as more input might be coming, finish must be false.
|
||||
* When the caller knows that it has provided all the input to
|
||||
* the decoder (some possibly still in b->in), it must set finish
|
||||
* to true. Only when finish is true can this function return
|
||||
* XZ_STREAM_END to indicate successful decompression of the
|
||||
* file. In single-call mode (XZ_SINGLE) finish is assumed to
|
||||
* always be true; the caller-provided value is ignored.
|
||||
*
|
||||
* This is like xz_dec_run() except that this makes it easy to decode .xz
|
||||
* files with multiple streams (multiple .xz files concatenated as is).
|
||||
* The rarely-used Stream Padding feature is supported too, that is, there
|
||||
* can be null bytes after or between the streams. The number of null bytes
|
||||
* must be a multiple of four.
|
||||
*
|
||||
* When finish is false and b->in_pos == b->in_size, it is possible that
|
||||
* XZ_BUF_ERROR isn't returned even when no progress is possible (XZ_OK is
|
||||
* returned instead). This shouldn't matter because in this situation a
|
||||
* reasonable caller will attempt to provide more input or set finish to
|
||||
* true for the next xz_dec_catrun() call anyway.
|
||||
*
|
||||
* For any struct xz_dec that has been initialized for multi-call mode:
|
||||
* Once decoding has been started with xz_dec_run() or xz_dec_catrun(),
|
||||
* the same function must be used until xz_dec_reset() or xz_dec_end().
|
||||
* Switching between the two decoding functions without resetting results
|
||||
* in undefined behavior.
|
||||
*
|
||||
* xz_dec_catrun() is only available if XZ_DEC_CONCATENATED was defined
|
||||
* at compile time.
|
||||
*/
|
||||
XZ_EXTERN enum xz_ret xz_dec_catrun(struct xz_dec *s, struct xz_buf *b,
|
||||
int finish);
|
||||
|
||||
/**
|
||||
* xz_dec_reset() - Reset an already allocated decoder state
|
||||
* @s: Decoder state allocated using xz_dec_init()
|
||||
|
|
@ -237,6 +279,112 @@ XZ_EXTERN void xz_dec_reset(struct xz_dec *s);
|
|||
*/
|
||||
XZ_EXTERN void xz_dec_end(struct xz_dec *s);
|
||||
|
||||
/*
|
||||
* Decompressor for MicroLZMA, an LZMA variant with a very minimal header.
|
||||
* See xz_dec_microlzma_alloc() below for details.
|
||||
*
|
||||
* These functions aren't used or available in preboot code and thus aren't
|
||||
* marked with XZ_EXTERN. This avoids warnings about static functions that
|
||||
* are never defined.
|
||||
*/
|
||||
/**
|
||||
* struct xz_dec_microlzma - Opaque type to hold the MicroLZMA decoder state
|
||||
*/
|
||||
struct xz_dec_microlzma;
|
||||
|
||||
/**
|
||||
* xz_dec_microlzma_alloc() - Allocate memory for the MicroLZMA decoder
|
||||
* @mode XZ_SINGLE or XZ_PREALLOC
|
||||
* @dict_size LZMA dictionary size. This must be at least 4 KiB and
|
||||
* at most 3 GiB.
|
||||
*
|
||||
* In contrast to xz_dec_init(), this function only allocates the memory
|
||||
* and remembers the dictionary size. xz_dec_microlzma_reset() must be used
|
||||
* before calling xz_dec_microlzma_run().
|
||||
*
|
||||
* The amount of allocated memory is a little less than 30 KiB with XZ_SINGLE.
|
||||
* With XZ_PREALLOC also a dictionary buffer of dict_size bytes is allocated.
|
||||
*
|
||||
* On success, xz_dec_microlzma_alloc() returns a pointer to
|
||||
* struct xz_dec_microlzma. If memory allocation fails or
|
||||
* dict_size is invalid, NULL is returned.
|
||||
*
|
||||
* The compressed format supported by this decoder is a raw LZMA stream
|
||||
* whose first byte (always 0x00) has been replaced with bitwise-negation
|
||||
* of the LZMA properties (lc/lp/pb) byte. For example, if lc/lp/pb is
|
||||
* 3/0/2, the first byte is 0xA2. This way the first byte can never be 0x00.
|
||||
* Just like with LZMA2, lc + lp <= 4 must be true. The LZMA end-of-stream
|
||||
* marker must not be used. The unused values are reserved for future use.
|
||||
* This MicroLZMA header format was created for use in EROFS but may be used
|
||||
* by others too.
|
||||
*/
|
||||
extern struct xz_dec_microlzma *xz_dec_microlzma_alloc(enum xz_mode mode,
|
||||
uint32_t dict_size);
|
||||
|
||||
/**
|
||||
* xz_dec_microlzma_reset() - Reset the MicroLZMA decoder state
|
||||
* @s Decoder state allocated using xz_dec_microlzma_alloc()
|
||||
* @comp_size Compressed size of the input stream
|
||||
* @uncomp_size Uncompressed size of the input stream. A value smaller
|
||||
* than the real uncompressed size of the input stream can
|
||||
* be specified if uncomp_size_is_exact is set to false.
|
||||
* uncomp_size can never be set to a value larger than the
|
||||
* expected real uncompressed size because it would eventually
|
||||
* result in XZ_DATA_ERROR.
|
||||
* @uncomp_size_is_exact This is an int instead of bool to avoid
|
||||
* requiring stdbool.h. This should normally be set to true.
|
||||
* When this is set to false, error detection is weaker.
|
||||
*/
|
||||
extern void xz_dec_microlzma_reset(struct xz_dec_microlzma *s,
|
||||
uint32_t comp_size, uint32_t uncomp_size,
|
||||
int uncomp_size_is_exact);
|
||||
|
||||
/**
|
||||
* xz_dec_microlzma_run() - Run the MicroLZMA decoder
|
||||
* @s Decoder state initialized using xz_dec_microlzma_reset()
|
||||
* @b: Input and output buffers
|
||||
*
|
||||
* This works similarly to xz_dec_run() with a few important differences.
|
||||
* Only the differences are documented here.
|
||||
*
|
||||
* The only possible return values are XZ_OK, XZ_STREAM_END, and
|
||||
* XZ_DATA_ERROR. This function cannot return XZ_BUF_ERROR: if no progress
|
||||
* is possible due to lack of input data or output space, this function will
|
||||
* keep returning XZ_OK. Thus, the calling code must be written so that it
|
||||
* will eventually provide input and output space matching (or exceeding)
|
||||
* comp_size and uncomp_size arguments given to xz_dec_microlzma_reset().
|
||||
* If the caller cannot do this (for example, if the input file is truncated
|
||||
* or otherwise corrupt), the caller must detect this error by itself to
|
||||
* avoid an infinite loop.
|
||||
*
|
||||
* If the compressed data seems to be corrupt, XZ_DATA_ERROR is returned.
|
||||
* This can happen also when incorrect dictionary, uncompressed, or
|
||||
* compressed sizes have been specified.
|
||||
*
|
||||
* With XZ_PREALLOC only: As an extra feature, b->out may be NULL to skip over
|
||||
* uncompressed data. This way the caller doesn't need to provide a temporary
|
||||
* output buffer for the bytes that will be ignored.
|
||||
*
|
||||
* With XZ_SINGLE only: In contrast to xz_dec_run(), the return value XZ_OK
|
||||
* is also possible and thus XZ_SINGLE is actually a limited multi-call mode.
|
||||
* After XZ_OK the bytes decoded so far may be read from the output buffer.
|
||||
* It is possible to continue decoding but the variables b->out and b->out_pos
|
||||
* MUST NOT be changed by the caller. Increasing the value of b->out_size is
|
||||
* allowed to make more output space available; one doesn't need to provide
|
||||
* space for the whole uncompressed data on the first call. The input buffer
|
||||
* may be changed normally like with XZ_PREALLOC. This way input data can be
|
||||
* provided from non-contiguous memory.
|
||||
*/
|
||||
extern enum xz_ret xz_dec_microlzma_run(struct xz_dec_microlzma *s,
|
||||
struct xz_buf *b);
|
||||
|
||||
/**
|
||||
* xz_dec_microlzma_end() - Free the memory allocated for the decoder state
|
||||
* @s: Decoder state allocated using xz_dec_microlzma_alloc().
|
||||
* If s is NULL, this function does nothing.
|
||||
*/
|
||||
extern void xz_dec_microlzma_end(struct xz_dec_microlzma *s);
|
||||
|
||||
/*
|
||||
* Standalone build (userspace build or in-kernel build for boot time use)
|
||||
* needs a CRC32 implementation. For normal in-kernel use, kernel's own
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@
|
|||
#ifndef XZ_CONFIG_H
|
||||
#define XZ_CONFIG_H
|
||||
|
||||
/* Uncomment to enable building of xz_dec_catrun(). */
|
||||
/* #define XZ_DEC_CONCATENATED */
|
||||
|
||||
/* Uncomment to enable CRC64 support. */
|
||||
/* #define XZ_USE_CRC64 */
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
* CRC32 using the polynomial from IEEE-802.3
|
||||
*
|
||||
* Authors: Lasse Collin <lasse.collin@tukaani.org>
|
||||
* Igor Pavlov <http://7-zip.org/>
|
||||
* Igor Pavlov <https://7-zip.org/>
|
||||
*
|
||||
* This file has been put into the public domain.
|
||||
* You can do whatever you want with this file.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* This file is similar to xz_crc32.c. See the comments there.
|
||||
*
|
||||
* Authors: Lasse Collin <lasse.collin@tukaani.org>
|
||||
* Igor Pavlov <http://7-zip.org/>
|
||||
* Igor Pavlov <https://7-zip.org/>
|
||||
*
|
||||
* This file has been put into the public domain.
|
||||
* You can do whatever you want with this file.
|
||||
|
|
@ -20,7 +20,11 @@ STATIC_RW_DATA uint64_t xz_crc64_table[256];
|
|||
|
||||
XZ_EXTERN void xz_crc64_init(void)
|
||||
{
|
||||
const uint64_t poly = 0xC96C5795D7870F42;
|
||||
/*
|
||||
* The ULL suffix is needed for -std=gnu89 compatibility
|
||||
* on 32-bit platforms.
|
||||
*/
|
||||
const uint64_t poly = 0xC96C5795D7870F42ULL;
|
||||
|
||||
uint32_t i;
|
||||
uint32_t j;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
* Branch/Call/Jump (BCJ) filter decoders
|
||||
*
|
||||
* Authors: Lasse Collin <lasse.collin@tukaani.org>
|
||||
* Igor Pavlov <http://7-zip.org/>
|
||||
* Igor Pavlov <https://7-zip.org/>
|
||||
*
|
||||
* This file has been put into the public domain.
|
||||
* You can do whatever you want with this file.
|
||||
|
|
@ -422,7 +422,7 @@ XZ_EXTERN enum xz_ret xz_dec_bcj_run(struct xz_dec_bcj *s,
|
|||
|
||||
/*
|
||||
* Flush pending already filtered data to the output buffer. Return
|
||||
* immediatelly if we couldn't flush everything, or if the next
|
||||
* immediately if we couldn't flush everything, or if the next
|
||||
* filter in the chain had already returned XZ_STREAM_END.
|
||||
*/
|
||||
if (s->temp.filtered > 0) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
* LZMA2 decoder
|
||||
*
|
||||
* Authors: Lasse Collin <lasse.collin@tukaani.org>
|
||||
* Igor Pavlov <http://7-zip.org/>
|
||||
* Igor Pavlov <https://7-zip.org/>
|
||||
*
|
||||
* This file has been put into the public domain.
|
||||
* You can do whatever you want with this file.
|
||||
|
|
@ -147,8 +147,8 @@ struct lzma_dec {
|
|||
|
||||
/*
|
||||
* LZMA properties or related bit masks (number of literal
|
||||
* context bits, a mask dervied from the number of literal
|
||||
* position bits, and a mask dervied from the number
|
||||
* context bits, a mask derived from the number of literal
|
||||
* position bits, and a mask derived from the number
|
||||
* position bits)
|
||||
*/
|
||||
uint32_t lc;
|
||||
|
|
@ -248,6 +248,10 @@ struct lzma2_dec {
|
|||
* before the first LZMA chunk.
|
||||
*/
|
||||
bool need_props;
|
||||
|
||||
#ifdef XZ_DEC_MICROLZMA
|
||||
bool pedantic_microlzma;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct xz_dec_lzma2 {
|
||||
|
|
@ -387,7 +391,14 @@ static void dict_uncompressed(struct dictionary *dict, struct xz_buf *b,
|
|||
|
||||
*left -= copy_size;
|
||||
|
||||
memcpy(dict->buf + dict->pos, b->in + b->in_pos, copy_size);
|
||||
/*
|
||||
* If doing in-place decompression in single-call mode and the
|
||||
* uncompressed size of the file is larger than the caller
|
||||
* thought (i.e. it is invalid input!), the buffers below may
|
||||
* overlap and cause undefined behavior with memcpy().
|
||||
* With valid inputs memcpy() would be fine here.
|
||||
*/
|
||||
memmove(dict->buf + dict->pos, b->in + b->in_pos, copy_size);
|
||||
dict->pos += copy_size;
|
||||
|
||||
if (dict->full < dict->pos)
|
||||
|
|
@ -397,7 +408,11 @@ static void dict_uncompressed(struct dictionary *dict, struct xz_buf *b,
|
|||
if (dict->pos == dict->end)
|
||||
dict->pos = 0;
|
||||
|
||||
memcpy(b->out + b->out_pos, b->in + b->in_pos,
|
||||
/*
|
||||
* Like above but for multi-call mode: use memmove()
|
||||
* to avoid undefined behavior with invalid input.
|
||||
*/
|
||||
memmove(b->out + b->out_pos, b->in + b->in_pos,
|
||||
copy_size);
|
||||
}
|
||||
|
||||
|
|
@ -408,6 +423,12 @@ static void dict_uncompressed(struct dictionary *dict, struct xz_buf *b,
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef XZ_DEC_MICROLZMA
|
||||
# define DICT_FLUSH_SUPPORTS_SKIPPING true
|
||||
#else
|
||||
# define DICT_FLUSH_SUPPORTS_SKIPPING false
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Flush pending data from dictionary to b->out. It is assumed that there is
|
||||
* enough space in b->out. This is guaranteed because caller uses dict_limit()
|
||||
|
|
@ -421,8 +442,19 @@ static uint32_t dict_flush(struct dictionary *dict, struct xz_buf *b)
|
|||
if (dict->pos == dict->end)
|
||||
dict->pos = 0;
|
||||
|
||||
memcpy(b->out + b->out_pos, dict->buf + dict->start,
|
||||
copy_size);
|
||||
/*
|
||||
* These buffers cannot overlap even if doing in-place
|
||||
* decompression because in multi-call mode dict->buf
|
||||
* has been allocated by us in this file; it's not
|
||||
* provided by the caller like in single-call mode.
|
||||
*
|
||||
* With MicroLZMA, b->out can be NULL to skip bytes that
|
||||
* the caller doesn't need. This cannot be done with XZ
|
||||
* because it would break BCJ filters.
|
||||
*/
|
||||
if (!DICT_FLUSH_SUPPORTS_SKIPPING || b->out != NULL)
|
||||
memcpy(b->out + b->out_pos, dict->buf + dict->start,
|
||||
copy_size);
|
||||
}
|
||||
|
||||
dict->start = dict->pos;
|
||||
|
|
@ -484,11 +516,11 @@ static __always_inline void rc_normalize(struct rc_dec *rc)
|
|||
}
|
||||
|
||||
/*
|
||||
* Decode one bit. In some versions, this function has been splitted in three
|
||||
* Decode one bit. In some versions, this function has been split in three
|
||||
* functions so that the compiler is supposed to be able to more easily avoid
|
||||
* an extra branch. In this particular version of the LZMA decoder, this
|
||||
* doesn't seem to be a good idea (tested with GCC 3.3.6, 3.4.6, and 4.3.3
|
||||
* on x86). Using a non-splitted version results in nicer looking code too.
|
||||
* on x86). Using a non-split version results in nicer looking code too.
|
||||
*
|
||||
* NOTE: This must return an int. Do not make it return a bool or the speed
|
||||
* of the code generated by GCC 3.x decreases 10-15 %. (GCC 4.3 doesn't care,
|
||||
|
|
@ -761,7 +793,7 @@ static bool lzma_main(struct xz_dec_lzma2 *s)
|
|||
}
|
||||
|
||||
/*
|
||||
* Reset the LZMA decoder and range decoder state. Dictionary is nore reset
|
||||
* Reset the LZMA decoder and range decoder state. Dictionary is not reset
|
||||
* here, because LZMA state may be reset without resetting the dictionary.
|
||||
*/
|
||||
static void lzma_reset(struct xz_dec_lzma2 *s)
|
||||
|
|
@ -774,6 +806,7 @@ static void lzma_reset(struct xz_dec_lzma2 *s)
|
|||
s->lzma.rep1 = 0;
|
||||
s->lzma.rep2 = 0;
|
||||
s->lzma.rep3 = 0;
|
||||
s->lzma.len = 0;
|
||||
|
||||
/*
|
||||
* All probabilities are initialized to the same value. This hack
|
||||
|
|
@ -1146,6 +1179,7 @@ XZ_EXTERN enum xz_ret xz_dec_lzma2_reset(struct xz_dec_lzma2 *s, uint8_t props)
|
|||
|
||||
if (DEC_IS_DYNALLOC(s->dict.mode)) {
|
||||
if (s->dict.allocated < s->dict.size) {
|
||||
s->dict.allocated = s->dict.size;
|
||||
vfree(s->dict.buf);
|
||||
s->dict.buf = vmalloc(s->dict.size);
|
||||
if (s->dict.buf == NULL) {
|
||||
|
|
@ -1156,8 +1190,6 @@ XZ_EXTERN enum xz_ret xz_dec_lzma2_reset(struct xz_dec_lzma2 *s, uint8_t props)
|
|||
}
|
||||
}
|
||||
|
||||
s->lzma.len = 0;
|
||||
|
||||
s->lzma2.sequence = SEQ_CONTROL;
|
||||
s->lzma2.need_dict_reset = true;
|
||||
|
||||
|
|
@ -1173,3 +1205,140 @@ XZ_EXTERN void xz_dec_lzma2_end(struct xz_dec_lzma2 *s)
|
|||
|
||||
kfree(s);
|
||||
}
|
||||
|
||||
#ifdef XZ_DEC_MICROLZMA
|
||||
/* This is a wrapper struct to have a nice struct name in the public API. */
|
||||
struct xz_dec_microlzma {
|
||||
struct xz_dec_lzma2 s;
|
||||
};
|
||||
|
||||
enum xz_ret xz_dec_microlzma_run(struct xz_dec_microlzma *s_ptr,
|
||||
struct xz_buf *b)
|
||||
{
|
||||
struct xz_dec_lzma2 *s = &s_ptr->s;
|
||||
|
||||
/*
|
||||
* sequence is SEQ_PROPERTIES before the first input byte,
|
||||
* SEQ_LZMA_PREPARE until a total of five bytes have been read,
|
||||
* and SEQ_LZMA_RUN for the rest of the input stream.
|
||||
*/
|
||||
if (s->lzma2.sequence != SEQ_LZMA_RUN) {
|
||||
if (s->lzma2.sequence == SEQ_PROPERTIES) {
|
||||
/* One byte is needed for the props. */
|
||||
if (b->in_pos >= b->in_size)
|
||||
return XZ_OK;
|
||||
|
||||
/*
|
||||
* Don't increment b->in_pos here. The same byte is
|
||||
* also passed to rc_read_init() which will ignore it.
|
||||
*/
|
||||
if (!lzma_props(s, ~b->in[b->in_pos]))
|
||||
return XZ_DATA_ERROR;
|
||||
|
||||
s->lzma2.sequence = SEQ_LZMA_PREPARE;
|
||||
}
|
||||
|
||||
/*
|
||||
* xz_dec_microlzma_reset() doesn't validate the compressed
|
||||
* size so we do it here. We have to limit the maximum size
|
||||
* to avoid integer overflows in lzma2_lzma(). 3 GiB is a nice
|
||||
* round number and much more than users of this code should
|
||||
* ever need.
|
||||
*/
|
||||
if (s->lzma2.compressed < RC_INIT_BYTES
|
||||
|| s->lzma2.compressed > (3U << 30))
|
||||
return XZ_DATA_ERROR;
|
||||
|
||||
if (!rc_read_init(&s->rc, b))
|
||||
return XZ_OK;
|
||||
|
||||
s->lzma2.compressed -= RC_INIT_BYTES;
|
||||
s->lzma2.sequence = SEQ_LZMA_RUN;
|
||||
|
||||
dict_reset(&s->dict, b);
|
||||
}
|
||||
|
||||
/* This is to allow increasing b->out_size between calls. */
|
||||
if (DEC_IS_SINGLE(s->dict.mode))
|
||||
s->dict.end = b->out_size - b->out_pos;
|
||||
|
||||
while (true) {
|
||||
dict_limit(&s->dict, min_t(size_t, b->out_size - b->out_pos,
|
||||
s->lzma2.uncompressed));
|
||||
|
||||
if (!lzma2_lzma(s, b))
|
||||
return XZ_DATA_ERROR;
|
||||
|
||||
s->lzma2.uncompressed -= dict_flush(&s->dict, b);
|
||||
|
||||
if (s->lzma2.uncompressed == 0) {
|
||||
if (s->lzma2.pedantic_microlzma) {
|
||||
if (s->lzma2.compressed > 0 || s->lzma.len > 0
|
||||
|| !rc_is_finished(&s->rc))
|
||||
return XZ_DATA_ERROR;
|
||||
}
|
||||
|
||||
return XZ_STREAM_END;
|
||||
}
|
||||
|
||||
if (b->out_pos == b->out_size)
|
||||
return XZ_OK;
|
||||
|
||||
if (b->in_pos == b->in_size
|
||||
&& s->temp.size < s->lzma2.compressed)
|
||||
return XZ_OK;
|
||||
}
|
||||
}
|
||||
|
||||
struct xz_dec_microlzma *xz_dec_microlzma_alloc(enum xz_mode mode,
|
||||
uint32_t dict_size)
|
||||
{
|
||||
struct xz_dec_microlzma *s;
|
||||
|
||||
/* Restrict dict_size to the same range as in the LZMA2 code. */
|
||||
if (dict_size < 4096 || dict_size > (3U << 30))
|
||||
return NULL;
|
||||
|
||||
s = kmalloc(sizeof(*s), GFP_KERNEL);
|
||||
if (s == NULL)
|
||||
return NULL;
|
||||
|
||||
s->s.dict.mode = mode;
|
||||
s->s.dict.size = dict_size;
|
||||
|
||||
if (DEC_IS_MULTI(mode)) {
|
||||
s->s.dict.end = dict_size;
|
||||
|
||||
s->s.dict.buf = vmalloc(dict_size);
|
||||
if (s->s.dict.buf == NULL) {
|
||||
kfree(s);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
void xz_dec_microlzma_reset(struct xz_dec_microlzma *s, uint32_t comp_size,
|
||||
uint32_t uncomp_size, int uncomp_size_is_exact)
|
||||
{
|
||||
/*
|
||||
* comp_size is validated in xz_dec_microlzma_run().
|
||||
* uncomp_size can safely be anything.
|
||||
*/
|
||||
s->s.lzma2.compressed = comp_size;
|
||||
s->s.lzma2.uncompressed = uncomp_size;
|
||||
s->s.lzma2.pedantic_microlzma = uncomp_size_is_exact;
|
||||
|
||||
s->s.lzma2.sequence = SEQ_PROPERTIES;
|
||||
s->s.temp.size = 0;
|
||||
}
|
||||
|
||||
void xz_dec_microlzma_end(struct xz_dec_microlzma *s)
|
||||
{
|
||||
if (DEC_IS_MULTI(s->s.dict.mode))
|
||||
vfree(s->s.dict.buf);
|
||||
|
||||
kfree(s);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@ struct xz_dec {
|
|||
SEQ_INDEX,
|
||||
SEQ_INDEX_PADDING,
|
||||
SEQ_INDEX_CRC32,
|
||||
SEQ_STREAM_FOOTER
|
||||
SEQ_STREAM_FOOTER,
|
||||
SEQ_STREAM_PADDING
|
||||
} sequence;
|
||||
|
||||
/* Position in variable-length integers and Check fields */
|
||||
|
|
@ -423,12 +424,12 @@ static enum xz_ret dec_stream_header(struct xz_dec *s)
|
|||
* check types too, but then the check won't be verified and
|
||||
* a warning (XZ_UNSUPPORTED_CHECK) will be given.
|
||||
*/
|
||||
if (s->temp.buf[HEADER_MAGIC_SIZE + 1] > XZ_CHECK_MAX)
|
||||
return XZ_OPTIONS_ERROR;
|
||||
|
||||
s->check_type = s->temp.buf[HEADER_MAGIC_SIZE + 1];
|
||||
|
||||
#ifdef XZ_DEC_ANY_CHECK
|
||||
if (s->check_type > XZ_CHECK_MAX)
|
||||
return XZ_OPTIONS_ERROR;
|
||||
|
||||
if (s->check_type > XZ_CHECK_CRC32 && !IS_CRC64(s->check_type))
|
||||
return XZ_UNSUPPORTED_CHECK;
|
||||
#else
|
||||
|
|
@ -604,6 +605,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
|
|||
if (ret != XZ_OK)
|
||||
return ret;
|
||||
|
||||
/* Fall through */
|
||||
|
||||
case SEQ_BLOCK_START:
|
||||
/* We need one byte of input to continue. */
|
||||
if (b->in_pos == b->in_size)
|
||||
|
|
@ -627,6 +630,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
|
|||
s->temp.pos = 0;
|
||||
s->sequence = SEQ_BLOCK_HEADER;
|
||||
|
||||
/* Fall through */
|
||||
|
||||
case SEQ_BLOCK_HEADER:
|
||||
if (!fill_temp(s, b))
|
||||
return XZ_OK;
|
||||
|
|
@ -637,6 +642,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
|
|||
|
||||
s->sequence = SEQ_BLOCK_UNCOMPRESS;
|
||||
|
||||
/* Fall through */
|
||||
|
||||
case SEQ_BLOCK_UNCOMPRESS:
|
||||
ret = dec_block(s, b);
|
||||
if (ret != XZ_STREAM_END)
|
||||
|
|
@ -644,6 +651,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
|
|||
|
||||
s->sequence = SEQ_BLOCK_PADDING;
|
||||
|
||||
/* Fall through */
|
||||
|
||||
case SEQ_BLOCK_PADDING:
|
||||
/*
|
||||
* Size of Compressed Data + Block Padding
|
||||
|
|
@ -664,6 +673,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
|
|||
|
||||
s->sequence = SEQ_BLOCK_CHECK;
|
||||
|
||||
/* Fall through */
|
||||
|
||||
case SEQ_BLOCK_CHECK:
|
||||
if (s->check_type == XZ_CHECK_CRC32) {
|
||||
ret = crc_validate(s, b, 32);
|
||||
|
|
@ -691,6 +702,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
|
|||
|
||||
s->sequence = SEQ_INDEX_PADDING;
|
||||
|
||||
/* Fall through */
|
||||
|
||||
case SEQ_INDEX_PADDING:
|
||||
while ((s->index.size + (b->in_pos - s->in_start))
|
||||
& 3) {
|
||||
|
|
@ -713,6 +726,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
|
|||
|
||||
s->sequence = SEQ_INDEX_CRC32;
|
||||
|
||||
/* Fall through */
|
||||
|
||||
case SEQ_INDEX_CRC32:
|
||||
ret = crc_validate(s, b, 32);
|
||||
if (ret != XZ_STREAM_END)
|
||||
|
|
@ -721,11 +736,17 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
|
|||
s->temp.size = STREAM_HEADER_SIZE;
|
||||
s->sequence = SEQ_STREAM_FOOTER;
|
||||
|
||||
/* Fall through */
|
||||
|
||||
case SEQ_STREAM_FOOTER:
|
||||
if (!fill_temp(s, b))
|
||||
return XZ_OK;
|
||||
|
||||
return dec_stream_footer(s);
|
||||
|
||||
case SEQ_STREAM_PADDING:
|
||||
/* Never reached, only silencing a warning */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -793,6 +814,79 @@ XZ_EXTERN enum xz_ret xz_dec_run(struct xz_dec *s, struct xz_buf *b)
|
|||
return ret;
|
||||
}
|
||||
|
||||
#ifdef XZ_DEC_CONCATENATED
|
||||
XZ_EXTERN enum xz_ret xz_dec_catrun(struct xz_dec *s, struct xz_buf *b,
|
||||
int finish)
|
||||
{
|
||||
enum xz_ret ret;
|
||||
|
||||
if (DEC_IS_SINGLE(s->mode)) {
|
||||
xz_dec_reset(s);
|
||||
finish = true;
|
||||
}
|
||||
|
||||
while (true) {
|
||||
if (s->sequence == SEQ_STREAM_PADDING) {
|
||||
/*
|
||||
* Skip Stream Padding. Its size must be a multiple
|
||||
* of four bytes which is tracked with s->pos.
|
||||
*/
|
||||
while (true) {
|
||||
if (b->in_pos == b->in_size) {
|
||||
/*
|
||||
* Note that if we are repeatedly
|
||||
* given no input and finish is false,
|
||||
* we will keep returning XZ_OK even
|
||||
* though no progress is being made.
|
||||
* The lack of XZ_BUF_ERROR support
|
||||
* isn't a problem here because a
|
||||
* reasonable caller will eventually
|
||||
* provide more input or set finish
|
||||
* to true.
|
||||
*/
|
||||
if (!finish)
|
||||
return XZ_OK;
|
||||
|
||||
if (s->pos != 0)
|
||||
return XZ_DATA_ERROR;
|
||||
|
||||
return XZ_STREAM_END;
|
||||
}
|
||||
|
||||
if (b->in[b->in_pos] != 0x00) {
|
||||
if (s->pos != 0)
|
||||
return XZ_DATA_ERROR;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
++b->in_pos;
|
||||
s->pos = (s->pos + 1) & 3;
|
||||
}
|
||||
|
||||
/*
|
||||
* More input remains. It should be a new Stream.
|
||||
*
|
||||
* In single-call mode xz_dec_run() will always call
|
||||
* xz_dec_reset(). Thus, we need to do it here only
|
||||
* in multi-call mode.
|
||||
*/
|
||||
if (DEC_IS_MULTI(s->mode))
|
||||
xz_dec_reset(s);
|
||||
}
|
||||
|
||||
ret = xz_dec_run(s, b);
|
||||
|
||||
if (ret != XZ_STREAM_END)
|
||||
break;
|
||||
|
||||
s->sequence = SEQ_STREAM_PADDING;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
XZ_EXTERN struct xz_dec *xz_dec_init(enum xz_mode mode, uint32_t dict_max)
|
||||
{
|
||||
struct xz_dec *s = kmalloc(sizeof(*s), GFP_KERNEL);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
* LZMA2 definitions
|
||||
*
|
||||
* Authors: Lasse Collin <lasse.collin@tukaani.org>
|
||||
* Igor Pavlov <http://7-zip.org/>
|
||||
* Igor Pavlov <https://7-zip.org/>
|
||||
*
|
||||
* This file has been put into the public domain.
|
||||
* You can do whatever you want with this file.
|
||||
|
|
|
|||
|
|
@ -37,6 +37,9 @@
|
|||
# ifdef CONFIG_XZ_DEC_SPARC
|
||||
# define XZ_DEC_SPARC
|
||||
# endif
|
||||
# ifdef CONFIG_XZ_DEC_MICROLZMA
|
||||
# define XZ_DEC_MICROLZMA
|
||||
# endif
|
||||
# define memeq(a, b, size) (memcmp(a, b, size) == 0)
|
||||
# define memzero(buf, size) memset(buf, 0, size)
|
||||
# endif
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
/*
|
||||
* See the .xz file format specification at
|
||||
* http://tukaani.org/xz/xz-file-format.txt
|
||||
* https://tukaani.org/xz/xz-file-format.txt
|
||||
* to understand the container format.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -4,11 +4,12 @@
|
|||
|
||||
MY_TEMP_DIR=$(mktemp -d -t xz-embedded_update.XXXXXX) || exit 1
|
||||
|
||||
git clone http://git.tukaani.org/xz-embedded.git ${MY_TEMP_DIR}/xz-embedded
|
||||
git clone https://git.tukaani.org/xz-embedded.git ${MY_TEMP_DIR}/xz-embedded
|
||||
|
||||
COMMIT=$(git -C ${MY_TEMP_DIR}/xz-embedded rev-parse HEAD)
|
||||
cd $(dirname $0)
|
||||
perl -p -i -e "s/\[commit [0-9a-f]{40}\]/[${COMMIT}]/" README.mozilla;
|
||||
perl -p -i -e "s/\[[0-9a-f]{40}\]/[${COMMIT}]/" README.mozilla;
|
||||
rm -f README.mozilla.bak;
|
||||
|
||||
rm -rf src
|
||||
mkdir src
|
||||
|
|
@ -23,7 +24,6 @@ mv ${MY_TEMP_DIR}/xz-embedded/linux/lib/xz/xz_dec_bcj.c src/
|
|||
mv ${MY_TEMP_DIR}/xz-embedded/linux/lib/xz/xz_dec_stream.c src/
|
||||
mv ${MY_TEMP_DIR}/xz-embedded/linux/lib/xz/xz_dec_lzma2.c src/
|
||||
rm -rf ${MY_TEMP_DIR}
|
||||
hg addremove src
|
||||
|
||||
echo "###"
|
||||
echo "### Updated xz-embedded/src to $COMMIT."
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include <string.h>
|
||||
#include <limits>
|
||||
|
||||
#include "mozilla/RangedPtr.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1137,8 +1137,13 @@ class Mar(MachCommandBase):
|
|||
|
||||
@Command('mar', category='post-build',
|
||||
description='Create the mar file for the built product for distribution.')
|
||||
def mar(self):
|
||||
return self._run_make(directory="./tools/update-packaging/", target='', ensure_exit_code=False)
|
||||
@CommandArgument('--bz2', action='store_true',
|
||||
help='Compress the mar package with old-style bz2 instead of xz')
|
||||
def mar(self, bz2):
|
||||
if bz2:
|
||||
return self._run_make(directory="./tools/update-packaging/", target='mar-package-bz2', ensure_exit_code=False)
|
||||
else:
|
||||
return self._run_make(directory="./tools/update-packaging/", target='mar-package', ensure_exit_code=False)
|
||||
|
||||
@CommandProvider
|
||||
class Install(MachCommandBase):
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ PKG_UPDATE_BASENAME = $(PKG_BASENAME)
|
|||
CHECKSUMS_FILE_BASENAME = $(PKG_BASENAME)
|
||||
MOZ_INFO_BASENAME = $(PKG_BASENAME)
|
||||
PKG_UPDATE_PATH = $(PKG_PATH)
|
||||
BARE_MAR = $(PKG_UPDATE_PATH)$(PKG_UPDATE_BASENAME).mar
|
||||
COMPLETE_MAR = $(PKG_UPDATE_PATH)$(PKG_UPDATE_BASENAME).complete.mar
|
||||
# PARTIAL_MAR needs to be processed by $(wildcard) before you use it.
|
||||
PARTIAL_MAR = $(PKG_UPDATE_PATH)$(PKG_UPDATE_BASENAME).partial.*.mar
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
#define WRITE_ERROR_ACCESS_DENIED 35
|
||||
// #define WRITE_ERROR_SHARING_VIOLATION 36 // Replaced with errors 46-48
|
||||
#define WRITE_ERROR_CALLBACK_APP 37
|
||||
#define UNEXPECTED_BZIP_ERROR 39
|
||||
#define UNEXPECTED_XZ_ERROR 39
|
||||
#define UNEXPECTED_MAR_ERROR 40
|
||||
#define UNEXPECTED_BSPATCH_ERROR 41
|
||||
#define UNEXPECTED_FILE_OPERATION_ERROR 42
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
|
@ -15,6 +14,9 @@
|
|||
#include "updatehelper.h"
|
||||
#endif
|
||||
|
||||
#define XZ_USE_CRC64
|
||||
#include "xz.h"
|
||||
|
||||
// These are generated at compile time based on the DER file for the channel
|
||||
// being used
|
||||
#ifdef MOZ_VERIFY_MAR_SIGNATURE
|
||||
|
|
@ -36,10 +38,10 @@
|
|||
# include <io.h>
|
||||
#endif
|
||||
|
||||
static int inbuf_size = 262144;
|
||||
static int outbuf_size = 262144;
|
||||
static char *inbuf = nullptr;
|
||||
static char *outbuf = nullptr;
|
||||
static size_t inbuf_size = 262144;
|
||||
static size_t outbuf_size = 262144;
|
||||
static uint8_t *inbuf = nullptr;
|
||||
static uint8_t *outbuf = nullptr;
|
||||
|
||||
/**
|
||||
* Performs a verification on the opened MAR file with the passed in
|
||||
|
|
@ -182,22 +184,22 @@ ArchiveReader::Open(const NS_tchar *path)
|
|||
Close();
|
||||
|
||||
if (!inbuf) {
|
||||
inbuf = (char *)malloc(inbuf_size);
|
||||
inbuf = (uint8_t *)malloc(inbuf_size);
|
||||
if (!inbuf) {
|
||||
// Try again with a smaller buffer.
|
||||
inbuf_size = 1024;
|
||||
inbuf = (char *)malloc(inbuf_size);
|
||||
inbuf = (uint8_t *)malloc(inbuf_size);
|
||||
if (!inbuf)
|
||||
return ARCHIVE_READER_MEM_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
if (!outbuf) {
|
||||
outbuf = (char *)malloc(outbuf_size);
|
||||
outbuf = (uint8_t *)malloc(outbuf_size);
|
||||
if (!outbuf) {
|
||||
// Try again with a smaller buffer.
|
||||
outbuf_size = 1024;
|
||||
outbuf = (char *)malloc(outbuf_size);
|
||||
outbuf = (uint8_t *)malloc(outbuf_size);
|
||||
if (!outbuf)
|
||||
return ARCHIVE_READER_MEM_ERROR;
|
||||
}
|
||||
|
|
@ -211,6 +213,9 @@ ArchiveReader::Open(const NS_tchar *path)
|
|||
if (!mArchive)
|
||||
return READ_ERROR;
|
||||
|
||||
xz_crc32_init();
|
||||
xz_crc64_init();
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
|
@ -273,12 +278,21 @@ ArchiveReader::ExtractItemToStream(const MarItem *item, FILE *fp)
|
|||
{
|
||||
/* decompress the data chunk by chunk */
|
||||
|
||||
bz_stream strm;
|
||||
int offset, inlen, outlen, ret = OK;
|
||||
int offset, inlen, ret = OK;
|
||||
struct xz_buf strm = { 0 };
|
||||
enum xz_ret xz_rv = XZ_OK;
|
||||
|
||||
memset(&strm, 0, sizeof(strm));
|
||||
if (BZ2_bzDecompressInit(&strm, 0, 0) != BZ_OK)
|
||||
return UNEXPECTED_BZIP_ERROR;
|
||||
struct xz_dec * dec = xz_dec_init(XZ_DYNALLOC, 64 * 1024 * 1024);
|
||||
if (!dec) {
|
||||
return UNEXPECTED_XZ_ERROR;
|
||||
}
|
||||
|
||||
strm.in = inbuf;
|
||||
strm.in_pos = 0;
|
||||
strm.in_size = 0;
|
||||
strm.out = outbuf;
|
||||
strm.out_pos = 0;
|
||||
strm.out_size = outbuf_size;
|
||||
|
||||
offset = 0;
|
||||
for (;;) {
|
||||
|
|
@ -287,38 +301,50 @@ ArchiveReader::ExtractItemToStream(const MarItem *item, FILE *fp)
|
|||
break;
|
||||
}
|
||||
|
||||
if (offset < (int) item->length && strm.avail_in == 0) {
|
||||
if (offset < (int) item->length && strm.in_pos == strm.in_size) {
|
||||
inlen = mar_read(mArchive, item, offset, inbuf, inbuf_size);
|
||||
if (inlen <= 0)
|
||||
return READ_ERROR;
|
||||
if (inlen <= 0) {
|
||||
ret = READ_ERROR;
|
||||
break;
|
||||
}
|
||||
offset += inlen;
|
||||
strm.next_in = inbuf;
|
||||
strm.avail_in = inlen;
|
||||
strm.in_size = inlen;
|
||||
strm.in_pos = 0;
|
||||
}
|
||||
|
||||
strm.next_out = outbuf;
|
||||
strm.avail_out = outbuf_size;
|
||||
xz_rv = xz_dec_run(dec, &strm);
|
||||
|
||||
ret = BZ2_bzDecompress(&strm);
|
||||
if (ret != BZ_OK && ret != BZ_STREAM_END) {
|
||||
ret = UNEXPECTED_BZIP_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
outlen = outbuf_size - strm.avail_out;
|
||||
if (outlen) {
|
||||
if (fwrite(outbuf, outlen, 1, fp) != 1) {
|
||||
if (strm.out_pos == outbuf_size) {
|
||||
if (fwrite(outbuf, 1, strm.out_pos, fp) != strm.out_pos) {
|
||||
ret = WRITE_ERROR_EXTRACT;
|
||||
break;
|
||||
}
|
||||
|
||||
strm.out_pos = 0;
|
||||
}
|
||||
|
||||
if (ret == BZ_STREAM_END) {
|
||||
ret = OK;
|
||||
if (xz_rv == XZ_OK) {
|
||||
// There is still more data to decompress.
|
||||
continue;
|
||||
}
|
||||
|
||||
// The return value of xz_dec_run is not XZ_OK and if it isn't XZ_STREAM_END
|
||||
// an error has occured.
|
||||
if (xz_rv != XZ_STREAM_END) {
|
||||
ret = UNEXPECTED_XZ_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
// Write out the remainder of the decompressed data. In the case of
|
||||
// strm.out_pos == 0 this is needed to create empty files included in the
|
||||
// mar file.
|
||||
if (fwrite(outbuf, 1, strm.out_pos, fp) != strm.out_pos) {
|
||||
ret = WRITE_ERROR_EXTRACT;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
BZ2_bzDecompressEnd(&strm);
|
||||
xz_dec_end(dec);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ else:
|
|||
|
||||
USE_LIBS += [
|
||||
'mar',
|
||||
'xz-embedded',
|
||||
]
|
||||
|
||||
if CONFIG['MOZ_SYSTEM_BZ2']:
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ MAR_BIN = $(DIST)/host/bin/mar$(HOST_BIN_SUFFIX)
|
|||
MBSDIFF_BIN = $(DIST)/host/bin/mbsdiff$(HOST_BIN_SUFFIX)
|
||||
|
||||
OVERRIDE_DEFAULT_GOAL := full-update
|
||||
full-update:: complete-patch
|
||||
full-update:: mar-package
|
||||
|
||||
ifeq ($(OS_TARGET), WINNT)
|
||||
ifdef AB_CD
|
||||
|
|
@ -70,3 +70,23 @@ partial-patch:: $(dir-stage)
|
|||
ifdef MOZ_SIGN_CMD
|
||||
$(MOZ_SIGN_CMD) -f mar '$(STAGE_DIR)/$(PKG_UPDATE_BASENAME).partial.$(SRC_BUILD_ID)-$(DST_BUILD_ID).mar'
|
||||
endif
|
||||
|
||||
mar-package: $(call mkdir_deps,$(ABS_DIST)/$(PKG_STAGE_DIR))
|
||||
@echo 'Creating update mar (xz compressed)...'
|
||||
MAR=$(MAR_BIN) \
|
||||
$(srcdir)/make_full_update.sh \
|
||||
'$(DIST)/$(BARE_MAR)' \
|
||||
'$(PACKAGE_DIR)'
|
||||
ifdef MOZ_SIGN_CMD
|
||||
$(MOZ_SIGN_CMD) -f mar '$(DIST)/$(BARE_MAR)'
|
||||
endif
|
||||
|
||||
mar-package-bz2: $(call mkdir_deps,$(ABS_DIST)/$(PKG_STAGE_DIR))
|
||||
@echo 'Creating update mar (bz2 compressed)...'
|
||||
MAR_OLD_FORMAT=1 MAR=$(MAR_BIN) \
|
||||
$(srcdir)/make_full_update.sh \
|
||||
'$(DIST)/$(COMPLETE_MAR)' \
|
||||
'$(PACKAGE_DIR)'
|
||||
ifdef MOZ_SIGN_CMD
|
||||
$(MOZ_SIGN_CMD) -f mar '$(DIST)/$(COMPLETE_MAR)'
|
||||
endif
|
||||
|
|
@ -9,10 +9,15 @@
|
|||
#
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# By default just assume that these tools exist on our path
|
||||
# By default just assume that these tools exist in our path
|
||||
MAR=${MAR:-mar}
|
||||
BZIP2=${BZIP2:-bzip2}
|
||||
MBSDIFF=${MBSDIFF:-mbsdiff}
|
||||
if [[ -z "${MAR_OLD_FORMAT}" ]]; then
|
||||
XZ=${XZ:-xz}
|
||||
else
|
||||
MAR_OLD_FORMAT=1
|
||||
BZIP2=${BZIP2:-bzip2}
|
||||
fi
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Helper routines
|
||||
|
|
|
|||
|
|
@ -93,7 +93,11 @@ for ((i=0; $i<$num_files; i=$i+1)); do
|
|||
|
||||
dir=$(dirname "$f")
|
||||
mkdir -p "$workdir/$dir"
|
||||
$BZIP2 -cz9 "$targetdir/$f" > "$workdir/$f"
|
||||
if [[ -n $MAR_OLD_FORMAT ]]; then
|
||||
$BZIP2 -cz9 "$targetdir/$f" > "$workdir/$f"
|
||||
else
|
||||
$XZ --compress --x86 --lzma2 --format=xz --check=crc64 --force --stdout "$targetdir/$f" > "$workdir/$f"
|
||||
fi
|
||||
copy_perm "$targetdir/$f" "$workdir/$f"
|
||||
|
||||
targetfiles="$targetfiles \"$f\""
|
||||
|
|
@ -104,8 +108,13 @@ notice ""
|
|||
notice "Adding file and directory remove instructions from file 'removed-files'"
|
||||
append_remove_instructions "$targetdir" "$updatemanifestv2" "$updatemanifestv3"
|
||||
|
||||
$BZIP2 -z9 "$updatemanifestv2" && mv -f "$updatemanifestv2.bz2" "$updatemanifestv2"
|
||||
$BZIP2 -z9 "$updatemanifestv3" && mv -f "$updatemanifestv3.bz2" "$updatemanifestv3"
|
||||
if [[ -n $MAR_OLD_FORMAT ]]; then
|
||||
$BZIP2 -z9 "$updatemanifestv2" && mv -f "$updatemanifestv2.bz2" "$updatemanifestv2"
|
||||
$BZIP2 -z9 "$updatemanifestv3" && mv -f "$updatemanifestv3.bz2" "$updatemanifestv3"
|
||||
else
|
||||
$XZ --compress --x86 --lzma2 --format=xz --check=crc64 --force "$updatemanifestv2" && mv -f "$updatemanifestv2.xz" "$updatemanifestv2"
|
||||
$XZ --compress --x86 --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3"
|
||||
fi
|
||||
|
||||
eval "$MAR -C \"$workdir\" -c output.mar $targetfiles"
|
||||
mv -f "$workdir/output.mar" "$archive"
|
||||
|
|
|
|||
|
|
@ -169,7 +169,11 @@ for ((i=0; $i<$num_oldfiles; i=$i+1)); do
|
|||
if check_for_add_if_not_update "$f"; then
|
||||
# The full workdir may not exist yet, so create it if necessary.
|
||||
mkdir -p `dirname "$workdir/$f"`
|
||||
$BZIP2 -cz9 "$newdir/$f" > "$workdir/$f"
|
||||
if [[ -n $MAR_OLD_FORMAT ]]; then
|
||||
$BZIP2 -cz9 "$newdir/$f" > "$workdir/$f"
|
||||
else
|
||||
$XZ --compress --x86 --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
|
||||
fi
|
||||
copy_perm "$newdir/$f" "$workdir/$f"
|
||||
make_add_if_not_instruction "$f" "$updatemanifestv3"
|
||||
archivefiles="$archivefiles \"$f\""
|
||||
|
|
@ -179,7 +183,11 @@ for ((i=0; $i<$num_oldfiles; i=$i+1)); do
|
|||
if check_for_forced_update "$requested_forced_updates" "$f"; then
|
||||
# The full workdir may not exist yet, so create it if necessary.
|
||||
mkdir -p `dirname "$workdir/$f"`
|
||||
$BZIP2 -cz9 "$newdir/$f" > "$workdir/$f"
|
||||
if [[ -n $MAR_OLD_FORMAT ]]; then
|
||||
$BZIP2 -cz9 "$newdir/$f" > "$workdir/$f"
|
||||
else
|
||||
$XZ --compress --x86 --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
|
||||
fi
|
||||
copy_perm "$newdir/$f" "$workdir/$f"
|
||||
make_add_instruction "$f" "$updatemanifestv2" "$updatemanifestv3" 1
|
||||
archivefiles="$archivefiles \"$f\""
|
||||
|
|
@ -207,21 +215,44 @@ for ((i=0; $i<$num_oldfiles; i=$i+1)); do
|
|||
# if service is not enabled then default to old behavior
|
||||
if [ -z "$MBSDIFF_HOOK" ]; then
|
||||
$MBSDIFF "$olddir/$f" "$newdir/$f" "$workdir/$f.patch"
|
||||
$BZIP2 -z9 "$workdir/$f.patch"
|
||||
if [[ -n $MAR_OLD_FORMAT ]]; then
|
||||
$BZIP2 -z9 "$workdir/$f.patch"
|
||||
else
|
||||
$XZ --compress --x86 --lzma2 --format=xz --check=crc64 --force "$workdir/$f.patch"
|
||||
fi
|
||||
else
|
||||
# if service enabled then check patch existence for retrieval
|
||||
if $MBSDIFF_HOOK -g "$olddir/$f" "$newdir/$f" "$workdir/$f.patch.bz2"; then
|
||||
notice "file \"$f\" found in funsize, diffing skipped"
|
||||
if [[ -n $MAR_OLD_FORMAT ]]; then
|
||||
if $MBSDIFF_HOOK -g "$olddir/$f" "$newdir/$f" "$workdir/$f.patch.bz2"; then
|
||||
notice "file \"$f\" found in funsize, diffing skipped"
|
||||
else
|
||||
# if not found already - compute it and cache it for future use
|
||||
$MBSDIFF "$olddir/$f" "$newdir/$f" "$workdir/$f.patch"
|
||||
$BZIP2 -z9 "$workdir/$f.patch"
|
||||
$MBSDIFF_HOOK -u "$olddir/$f" "$newdir/$f" "$workdir/$f.patch.bz2"
|
||||
fi
|
||||
else
|
||||
# if not found already - compute it and cache it for future use
|
||||
$MBSDIFF "$olddir/$f" "$newdir/$f" "$workdir/$f.patch"
|
||||
$BZIP2 -z9 "$workdir/$f.patch"
|
||||
$MBSDIFF_HOOK -u "$olddir/$f" "$newdir/$f" "$workdir/$f.patch.bz2"
|
||||
if $MBSDIFF_HOOK -g "$olddir/$f" "$newdir/$f" "$workdir/$f.patch.xz"; then
|
||||
notice "file \"$f\" found in funsize, diffing skipped"
|
||||
else
|
||||
# if not found already - compute it and cache it for future use
|
||||
$MBSDIFF "$olddir/$f" "$newdir/$f" "$workdir/$f.patch"
|
||||
$XZ --compress --x86 --lzma2 --format=xz --check=crc64 --force "$workdir/$f.patch"
|
||||
$MBSDIFF_HOOK -u "$olddir/$f" "$newdir/$f" "$workdir/$f.patch.xz"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
$BZIP2 -cz9 "$newdir/$f" > "$workdir/$f"
|
||||
if [[ -n $MAR_OLD_FORMAT ]]; then
|
||||
$BZIP2 -cz9 "$newdir/$f" > "$workdir/$f"
|
||||
else
|
||||
$XZ --compress --x86 --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
|
||||
fi
|
||||
copy_perm "$newdir/$f" "$workdir/$f"
|
||||
patchfile="$workdir/$f.patch.bz2"
|
||||
if [[ -n $MAR_OLD_FORMAT ]]; then
|
||||
patchfile="$workdir/$f.patch.bz2"
|
||||
else
|
||||
patchfile="$workdir/$f.patch.xz"
|
||||
fi
|
||||
patchsize=$(get_file_size "$patchfile")
|
||||
fullsize=$(get_file_size "$workdir/$f")
|
||||
|
||||
|
|
@ -262,7 +293,11 @@ for ((i=0; $i<$num_newfiles; i=$i+1)); do
|
|||
dir=$(dirname "$workdir/$f")
|
||||
mkdir -p "$dir"
|
||||
|
||||
$BZIP2 -cz9 "$newdir/$f" > "$workdir/$f"
|
||||
if [[ -n $MAR_OLD_FORMAT ]]; then
|
||||
$BZIP2 -cz9 "$newdir/$f" > "$workdir/$f"
|
||||
else
|
||||
$XZ --compress --x86 --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
|
||||
fi
|
||||
copy_perm "$newdir/$f" "$workdir/$f"
|
||||
|
||||
if check_for_add_if_not_update "$f"; then
|
||||
|
|
@ -303,8 +338,13 @@ for ((i=0; $i<$num_olddirs; i=$i+1)); do
|
|||
fi
|
||||
done
|
||||
|
||||
$BZIP2 -z9 "$updatemanifestv2" && mv -f "$updatemanifestv2.bz2" "$updatemanifestv2"
|
||||
$BZIP2 -z9 "$updatemanifestv3" && mv -f "$updatemanifestv3.bz2" "$updatemanifestv3"
|
||||
if [[ -n $MAR_OLD_FORMAT ]]; then
|
||||
$BZIP2 -z9 "$updatemanifestv2" && mv -f "$updatemanifestv2.bz2" "$updatemanifestv2"
|
||||
$BZIP2 -z9 "$updatemanifestv3" && mv -f "$updatemanifestv3.bz2" "$updatemanifestv3"
|
||||
else
|
||||
$XZ --compress --x86 --lzma2 --format=xz --check=crc64 --force "$updatemanifestv2" && mv -f "$updatemanifestv2.xz" "$updatemanifestv2"
|
||||
$XZ --compress --x86 --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3"
|
||||
fi
|
||||
|
||||
mar_command="$MAR"
|
||||
if [[ -n $MOZ_PRODUCT_VERSION ]]
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue