зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1166147 - Part3: Override GetWritingMode() and make it more robustly defer to root element, to avoid truncating printed vertical-WM docs. r=dholbert
MozReview-Commit-ID: IYM3gzf1CpS --HG-- extra : rebase_source : fa8afc85a6f3139c3c8f296ed3a469a87020a746
This commit is contained in:
Родитель
abfaf40d01
Коммит
2d0231a9be
|
@ -44,16 +44,9 @@ public:
|
|||
|
||||
virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
|
||||
|
||||
virtual mozilla::WritingMode GetWritingMode() const override
|
||||
mozilla::WritingMode GetWritingMode() const override
|
||||
{
|
||||
nsIContent* rootElem = GetContent();
|
||||
if (rootElem) {
|
||||
nsIFrame* rootElemFrame = rootElem->GetPrimaryFrame();
|
||||
if (rootElemFrame) {
|
||||
return rootElemFrame->GetWritingMode();
|
||||
}
|
||||
}
|
||||
return nsIFrame::GetWritingMode();
|
||||
return nsFrame::GetWritingModeDeferringToRootElem();
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
|
@ -3020,6 +3020,19 @@ nsFrame::FireDOMEvent(const nsAString& aDOMEventName, nsIContent *aContent)
|
|||
}
|
||||
}
|
||||
|
||||
WritingMode
|
||||
nsFrame::GetWritingModeDeferringToRootElem() const
|
||||
{
|
||||
Element* rootElem = PresContext()->Document()->GetRootElement();
|
||||
if (rootElem) {
|
||||
nsIFrame* primaryFrame = rootElem->GetPrimaryFrame();
|
||||
if (primaryFrame) {
|
||||
return primaryFrame->GetWritingMode();
|
||||
}
|
||||
}
|
||||
return nsIFrame::GetWritingMode();
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsFrame::HandleEvent(nsPresContext* aPresContext,
|
||||
WidgetGUIEvent* aEvent,
|
||||
|
|
|
@ -688,6 +688,8 @@ protected:
|
|||
// Fire DOM event. If no aContent argument use frame's mContent.
|
||||
void FireDOMEvent(const nsAString& aDOMEventName, nsIContent *aContent = nullptr);
|
||||
|
||||
mozilla::WritingMode GetWritingModeDeferringToRootElem() const;
|
||||
|
||||
private:
|
||||
void BoxReflow(nsBoxLayoutState& aState,
|
||||
nsPresContext* aPresContext,
|
||||
|
|
|
@ -44,6 +44,11 @@ public:
|
|||
*/
|
||||
virtual nsIAtom* GetType() const override;
|
||||
|
||||
mozilla::WritingMode GetWritingMode() const override
|
||||
{
|
||||
return nsFrame::GetWritingModeDeferringToRootElem();
|
||||
}
|
||||
|
||||
#ifdef DEBUG_FRAME_DUMP
|
||||
// Debugging
|
||||
virtual nsresult GetFrameName(nsAString& aResult) const override;
|
||||
|
|
|
@ -32,6 +32,11 @@ public:
|
|||
const nsRect& aDirtyRect,
|
||||
const nsDisplayListSet& aLists) override;
|
||||
|
||||
mozilla::WritingMode GetWritingMode() const override
|
||||
{
|
||||
return nsFrame::GetWritingModeDeferringToRootElem();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the "type" of the frame
|
||||
*
|
||||
|
|
|
@ -60,6 +60,11 @@ public:
|
|||
NS_DECL_QUERYFRAME
|
||||
NS_DECL_FRAMEARENA_HELPERS
|
||||
|
||||
mozilla::WritingMode GetWritingMode() const override
|
||||
{
|
||||
return nsFrame::GetWritingModeDeferringToRootElem();
|
||||
}
|
||||
|
||||
// nsIFrame
|
||||
void Reflow(nsPresContext* aPresContext,
|
||||
ReflowOutput& aDesiredSize,
|
||||
|
|
Загрузка…
Ссылка в новой задаче