зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1497589 Part 2: Rename Flex API classes to avoid namespace collision with nsFlexContainerFrame classes. r=dholbert
Depends on D9022 Differential Revision: https://phabricator.services.mozilla.com/D9023 --HG-- rename : dom/flex/FlexItem.cpp => dom/flex/FlexItemValues.cpp rename : dom/flex/FlexItem.h => dom/flex/FlexItemValues.h rename : dom/flex/FlexLine.cpp => dom/flex/FlexLineValues.cpp rename : dom/flex/FlexLine.h => dom/flex/FlexLineValues.h extra : moz-landing-system : lando
This commit is contained in:
Родитель
2813ca23fa
Коммит
04ba5f13c0
|
@ -12,7 +12,7 @@
|
|||
[ChromeOnly]
|
||||
interface Flex
|
||||
{
|
||||
sequence<FlexLine> getLines();
|
||||
sequence<FlexLineValues> getLines();
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -22,7 +22,7 @@ interface Flex
|
|||
enum FlexLineGrowthState { "unchanged", "shrinking", "growing" };
|
||||
|
||||
[ChromeOnly]
|
||||
interface FlexLine
|
||||
interface FlexLineValues
|
||||
{
|
||||
readonly attribute FlexLineGrowthState growthState;
|
||||
readonly attribute double crossStart;
|
||||
|
@ -35,14 +35,14 @@ interface FlexLine
|
|||
readonly attribute double lastBaselineOffset;
|
||||
|
||||
/**
|
||||
* getItems() returns FlexItems only for the Elements in this Flex
|
||||
* container -- ignoring struts and abs-pos Elements.
|
||||
* getItems() returns FlexItemValues only for the Elements in
|
||||
* this Flex container -- ignoring struts and abs-pos Elements.
|
||||
*/
|
||||
sequence<FlexItem> getItems();
|
||||
sequence<FlexItemValues> getItems();
|
||||
};
|
||||
|
||||
[ChromeOnly]
|
||||
interface FlexItem
|
||||
interface FlexItemValues
|
||||
{
|
||||
readonly attribute Node? node;
|
||||
readonly attribute double mainBaseSize;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "Flex.h"
|
||||
|
||||
#include "FlexLine.h"
|
||||
#include "FlexLineValues.h"
|
||||
#include "mozilla/dom/FlexBinding.h"
|
||||
#include "nsFlexContainerFrame.h"
|
||||
|
||||
|
@ -37,7 +37,7 @@ Flex::Flex(Element* aParent,
|
|||
mLines.SetLength(containerInfo->mLines.Length());
|
||||
uint32_t index = 0;
|
||||
for (auto&& l : containerInfo->mLines) {
|
||||
FlexLine* line = new FlexLine(this, &l);
|
||||
FlexLineValues* line = new FlexLineValues(this, &l);
|
||||
mLines.ElementAt(index) = line;
|
||||
index++;
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ Flex::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
|||
}
|
||||
|
||||
void
|
||||
Flex::GetLines(nsTArray<RefPtr<FlexLine>>& aResult)
|
||||
Flex::GetLines(nsTArray<RefPtr<FlexLineValues>>& aResult)
|
||||
{
|
||||
aResult.AppendElements(mLines);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ class nsFlexContainerFrame;
|
|||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class FlexLine;
|
||||
class FlexLineValues;
|
||||
|
||||
class Flex : public nsISupports
|
||||
, public nsWrapperCache
|
||||
|
@ -37,11 +37,11 @@ public:
|
|||
return mParent;
|
||||
}
|
||||
|
||||
void GetLines(nsTArray<RefPtr<FlexLine>>& aResult);
|
||||
void GetLines(nsTArray<RefPtr<FlexLineValues>>& aResult);
|
||||
|
||||
protected:
|
||||
nsCOMPtr<Element> mParent;
|
||||
nsTArray<RefPtr<FlexLine>> mLines;
|
||||
nsTArray<RefPtr<FlexLineValues>> mLines;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* 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/. */
|
||||
|
||||
#include "FlexItem.h"
|
||||
#include "FlexItemValues.h"
|
||||
|
||||
#include "mozilla/dom/FlexBinding.h"
|
||||
#include "nsFlexContainerFrame.h"
|
||||
|
@ -12,10 +12,10 @@
|
|||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(FlexItem, mParent)
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(FlexItem)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(FlexItem)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(FlexItem)
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(FlexItemValues, mParent)
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(FlexItemValues)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(FlexItemValues)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(FlexItemValues)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
@ -38,8 +38,8 @@ ToPossiblyUnconstrainedPixels(nscoord aSize)
|
|||
return nsPresContext::AppUnitsToDoubleCSSPixels(aSize);
|
||||
}
|
||||
|
||||
FlexItem::FlexItem(FlexLine* aParent,
|
||||
const ComputedFlexItemInfo* aItem)
|
||||
FlexItemValues::FlexItemValues(FlexLineValues* aParent,
|
||||
const ComputedFlexItemInfo* aItem)
|
||||
: mParent(aParent)
|
||||
{
|
||||
MOZ_ASSERT(aItem,
|
||||
|
@ -63,49 +63,49 @@ FlexItem::FlexItem(FlexLine* aParent,
|
|||
}
|
||||
|
||||
JSObject*
|
||||
FlexItem::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
FlexItemValues::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
{
|
||||
return FlexItem_Binding::Wrap(aCx, this, aGivenProto);
|
||||
return FlexItemValues_Binding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
||||
|
||||
nsINode*
|
||||
FlexItem::GetNode() const
|
||||
FlexItemValues::GetNode() const
|
||||
{
|
||||
return mNode;
|
||||
}
|
||||
|
||||
double
|
||||
FlexItem::MainBaseSize() const
|
||||
FlexItemValues::MainBaseSize() const
|
||||
{
|
||||
return mMainBaseSize;
|
||||
}
|
||||
|
||||
double
|
||||
FlexItem::MainDeltaSize() const
|
||||
FlexItemValues::MainDeltaSize() const
|
||||
{
|
||||
return mMainDeltaSize;
|
||||
}
|
||||
|
||||
double
|
||||
FlexItem::MainMinSize() const
|
||||
FlexItemValues::MainMinSize() const
|
||||
{
|
||||
return mMainMinSize;
|
||||
}
|
||||
|
||||
double
|
||||
FlexItem::MainMaxSize() const
|
||||
FlexItemValues::MainMaxSize() const
|
||||
{
|
||||
return mMainMaxSize;
|
||||
}
|
||||
|
||||
double
|
||||
FlexItem::CrossMinSize() const
|
||||
FlexItemValues::CrossMinSize() const
|
||||
{
|
||||
return mCrossMinSize;
|
||||
}
|
||||
|
||||
double
|
||||
FlexItem::CrossMaxSize() const
|
||||
FlexItemValues::CrossMaxSize() const
|
||||
{
|
||||
return mCrossMaxSize;
|
||||
}
|
|
@ -4,8 +4,8 @@
|
|||
* 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/. */
|
||||
|
||||
#ifndef mozilla_dom_FlexItem_h
|
||||
#define mozilla_dom_FlexItem_h
|
||||
#ifndef mozilla_dom_FlexItemValues_h
|
||||
#define mozilla_dom_FlexItemValues_h
|
||||
|
||||
#include "mozilla/dom/FlexBinding.h"
|
||||
#include "nsISupports.h"
|
||||
|
@ -16,24 +16,24 @@ struct ComputedFlexItemInfo;
|
|||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class FlexLine;
|
||||
class FlexLineValues;
|
||||
|
||||
class FlexItem : public nsISupports
|
||||
, public nsWrapperCache
|
||||
class FlexItemValues : public nsISupports
|
||||
, public nsWrapperCache
|
||||
{
|
||||
public:
|
||||
explicit FlexItem(FlexLine* aParent,
|
||||
const ComputedFlexItemInfo* aItem);
|
||||
explicit FlexItemValues(FlexLineValues* aParent,
|
||||
const ComputedFlexItemInfo* aItem);
|
||||
|
||||
protected:
|
||||
virtual ~FlexItem() = default;
|
||||
virtual ~FlexItemValues() = default;
|
||||
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FlexItem)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FlexItemValues)
|
||||
|
||||
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
||||
FlexLine* GetParentObject()
|
||||
FlexLineValues* GetParentObject()
|
||||
{
|
||||
return mParent;
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ public:
|
|||
double CrossMaxSize() const;
|
||||
|
||||
protected:
|
||||
RefPtr<FlexLine> mParent;
|
||||
RefPtr<FlexLineValues> mParent;
|
||||
RefPtr<nsINode> mNode;
|
||||
|
||||
// These sizes are all CSS pixel units.
|
||||
|
@ -62,4 +62,4 @@ protected:
|
|||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif /* mozilla_dom_FlexItem_h */
|
||||
#endif /* mozilla_dom_FlexItemValues_h */
|
|
@ -4,25 +4,25 @@
|
|||
* 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/. */
|
||||
|
||||
#include "FlexLine.h"
|
||||
#include "FlexLineValues.h"
|
||||
|
||||
#include "FlexItem.h"
|
||||
#include "FlexItemValues.h"
|
||||
#include "mozilla/dom/FlexBinding.h"
|
||||
#include "nsFlexContainerFrame.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(FlexLine, mParent, mItems)
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(FlexLine)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(FlexLine)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(FlexLine)
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(FlexLineValues, mParent, mItems)
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(FlexLineValues)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(FlexLineValues)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(FlexLineValues)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
FlexLine::FlexLine(Flex* aParent,
|
||||
const ComputedFlexLineInfo* aLine)
|
||||
FlexLineValues::FlexLineValues(Flex* aParent,
|
||||
const ComputedFlexLineInfo* aLine)
|
||||
: mParent(aParent)
|
||||
{
|
||||
MOZ_ASSERT(aLine,
|
||||
|
@ -56,50 +56,50 @@ FlexLine::FlexLine(Flex* aParent,
|
|||
mItems.SetLength(aLine->mItems.Length());
|
||||
uint32_t index = 0;
|
||||
for (auto&& i : aLine->mItems) {
|
||||
FlexItem* item = new FlexItem(this, &i);
|
||||
FlexItemValues* item = new FlexItemValues(this, &i);
|
||||
mItems.ElementAt(index) = item;
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
JSObject*
|
||||
FlexLine::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
FlexLineValues::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
{
|
||||
return FlexLine_Binding::Wrap(aCx, this, aGivenProto);
|
||||
return FlexLineValues_Binding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
||||
|
||||
FlexLineGrowthState
|
||||
FlexLine::GrowthState() const
|
||||
FlexLineValues::GrowthState() const
|
||||
{
|
||||
return mGrowthState;
|
||||
}
|
||||
|
||||
double
|
||||
FlexLine::CrossStart() const
|
||||
FlexLineValues::CrossStart() const
|
||||
{
|
||||
return mCrossStart;
|
||||
}
|
||||
|
||||
double
|
||||
FlexLine::CrossSize() const
|
||||
FlexLineValues::CrossSize() const
|
||||
{
|
||||
return mCrossSize;
|
||||
}
|
||||
|
||||
double
|
||||
FlexLine::FirstBaselineOffset() const
|
||||
FlexLineValues::FirstBaselineOffset() const
|
||||
{
|
||||
return mFirstBaselineOffset;
|
||||
}
|
||||
|
||||
double
|
||||
FlexLine::LastBaselineOffset() const
|
||||
FlexLineValues::LastBaselineOffset() const
|
||||
{
|
||||
return mLastBaselineOffset;
|
||||
}
|
||||
|
||||
void
|
||||
FlexLine::GetItems(nsTArray<RefPtr<FlexItem>>& aResult)
|
||||
FlexLineValues::GetItems(nsTArray<RefPtr<FlexItemValues>>& aResult)
|
||||
{
|
||||
aResult.AppendElements(mItems);
|
||||
}
|
|
@ -4,8 +4,8 @@
|
|||
* 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/. */
|
||||
|
||||
#ifndef mozilla_dom_FlexLine_h
|
||||
#define mozilla_dom_FlexLine_h
|
||||
#ifndef mozilla_dom_FlexLineValues_h
|
||||
#define mozilla_dom_FlexLineValues_h
|
||||
|
||||
#include "mozilla/dom/FlexBinding.h"
|
||||
#include "nsISupports.h"
|
||||
|
@ -17,21 +17,21 @@ namespace mozilla {
|
|||
namespace dom {
|
||||
|
||||
class Flex;
|
||||
class FlexItem;
|
||||
class FlexItemValues;
|
||||
|
||||
class FlexLine : public nsISupports
|
||||
, public nsWrapperCache
|
||||
class FlexLineValues : public nsISupports
|
||||
, public nsWrapperCache
|
||||
{
|
||||
public:
|
||||
explicit FlexLine(Flex* aParent,
|
||||
const ComputedFlexLineInfo* aLine);
|
||||
explicit FlexLineValues(Flex* aParent,
|
||||
const ComputedFlexLineInfo* aLine);
|
||||
|
||||
protected:
|
||||
virtual ~FlexLine() = default;
|
||||
virtual ~FlexLineValues() = default;
|
||||
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FlexLine)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FlexLineValues)
|
||||
|
||||
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
||||
Flex* GetParentObject()
|
||||
|
@ -45,7 +45,7 @@ public:
|
|||
double FirstBaselineOffset() const;
|
||||
double LastBaselineOffset() const;
|
||||
|
||||
void GetItems(nsTArray<RefPtr<FlexItem>>& aResult);
|
||||
void GetItems(nsTArray<RefPtr<FlexItemValues>>& aResult);
|
||||
|
||||
protected:
|
||||
RefPtr<Flex> mParent;
|
||||
|
@ -56,10 +56,10 @@ protected:
|
|||
double mFirstBaselineOffset;
|
||||
double mLastBaselineOffset;
|
||||
|
||||
nsTArray<RefPtr<FlexItem>> mItems;
|
||||
nsTArray<RefPtr<FlexItemValues>> mItems;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif /* mozilla_dom_FlexLine_h */
|
||||
#endif /* mozilla_dom_FlexLineValues_h */
|
|
@ -11,14 +11,14 @@ MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini']
|
|||
|
||||
EXPORTS.mozilla.dom += [
|
||||
'Flex.h',
|
||||
'FlexItem.h',
|
||||
'FlexLine.h',
|
||||
'FlexItemValues.h',
|
||||
'FlexLineValues.h',
|
||||
]
|
||||
|
||||
UNIFIED_SOURCES += [
|
||||
'Flex.cpp',
|
||||
'FlexItem.cpp',
|
||||
'FlexLine.cpp',
|
||||
'FlexItemValues.cpp',
|
||||
'FlexLineValues.cpp',
|
||||
]
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
|
|
Загрузка…
Ссылка в новой задаче