зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1875199 - Move documentation of two methods in nsHTMLScrollFrame to nsIScrollableFrame. r=layout-reviewers,emilio DONTBUILD
The documentation for GetScrolledRect() and GetLogicalScrollPosition() in nsHTMLScrollFrame are clearer and up-to-date [1], but they implements the nsIScrollableFrame's interface. We should move the documentation to nsIScrollableFrame. [1] For example, nsXULScrollFrame has been removed in bug 1600542. Differential Revision: https://phabricator.services.mozilla.com/D198909
This commit is contained in:
Родитель
d5083c74fc
Коммит
ac1fd45c39
|
@ -208,31 +208,11 @@ class nsHTMLScrollFrame : public nsContainerFrame,
|
||||||
}
|
}
|
||||||
return mScrollPort.Size();
|
return mScrollPort.Size();
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* GetScrolledRect is designed to encapsulate deciding which
|
|
||||||
* directions of overflow should be reachable by scrolling and which
|
|
||||||
* should not. Callers should NOT depend on it having any particular
|
|
||||||
* behavior.
|
|
||||||
*
|
|
||||||
* This should only be called when the scrolled frame has been
|
|
||||||
* reflowed with the scroll port size given in mScrollPort.
|
|
||||||
*
|
|
||||||
* Currently it allows scrolling down and to the right for
|
|
||||||
* nsHTMLScrollFrames with LTR directionality, and allows scrolling down and
|
|
||||||
* to the left for nsHTMLScrollFrames with RTL directionality.
|
|
||||||
*/
|
|
||||||
nsRect GetScrolledRect() const final;
|
nsRect GetScrolledRect() const final;
|
||||||
nsRect GetScrollPortRect() const final { return mScrollPort; }
|
nsRect GetScrollPortRect() const final { return mScrollPort; }
|
||||||
nsPoint GetScrollPosition() const final {
|
nsPoint GetScrollPosition() const final {
|
||||||
return mScrollPort.TopLeft() - mScrolledFrame->GetPosition();
|
return mScrollPort.TopLeft() - mScrolledFrame->GetPosition();
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* For LTR frames, the logical scroll position is the offset of the top left
|
|
||||||
* corner of the frame from the top left corner of the scroll port (same as
|
|
||||||
* GetScrollPosition).
|
|
||||||
* For RTL frames, it is the offset of the top right corner of the frame from
|
|
||||||
* the top right corner of the scroll port
|
|
||||||
*/
|
|
||||||
nsPoint GetLogicalScrollPosition() const final {
|
nsPoint GetLogicalScrollPosition() const final {
|
||||||
nsPoint pt;
|
nsPoint pt;
|
||||||
pt.x = IsPhysicalLTR()
|
pt.x = IsPhysicalLTR()
|
||||||
|
|
|
@ -146,15 +146,14 @@ class nsIScrollableFrame : public nsIScrollbarMediator {
|
||||||
* GetScrolledRect is designed to encapsulate deciding which
|
* GetScrolledRect is designed to encapsulate deciding which
|
||||||
* directions of overflow should be reachable by scrolling and which
|
* directions of overflow should be reachable by scrolling and which
|
||||||
* should not. Callers should NOT depend on it having any particular
|
* should not. Callers should NOT depend on it having any particular
|
||||||
* behavior (although nsXULScrollFrame currently does).
|
* behavior.
|
||||||
*
|
*
|
||||||
* This should only be called when the scrolled frame has been
|
* This should only be called when the scrolled frame has been
|
||||||
* reflowed with the scroll port size given in mScrollPort.
|
* reflowed with the scroll port size given in mScrollPort.
|
||||||
*
|
*
|
||||||
* Currently it allows scrolling down and to the right for
|
* Currently it allows scrolling down and to the right for
|
||||||
* nsHTMLScrollFrames with LTR directionality and for all
|
* nsHTMLScrollFrames with LTR directionality, and allows scrolling down and
|
||||||
* nsXULScrollFrames, and allows scrolling down and to the left for
|
* to the left for nsHTMLScrollFrames with RTL directionality.
|
||||||
* nsHTMLScrollFrames with RTL directionality.
|
|
||||||
*/
|
*/
|
||||||
virtual nsRect GetScrolledRect() const = 0;
|
virtual nsRect GetScrolledRect() const = 0;
|
||||||
/**
|
/**
|
||||||
|
@ -170,7 +169,11 @@ class nsIScrollableFrame : public nsIScrollbarMediator {
|
||||||
*/
|
*/
|
||||||
virtual nsPoint GetScrollPosition() const = 0;
|
virtual nsPoint GetScrollPosition() const = 0;
|
||||||
/**
|
/**
|
||||||
* As GetScrollPosition(), but uses the top-right as origin for RTL frames.
|
* For LTR frames, the logical scroll position is the offset of the top left
|
||||||
|
* corner of the frame from the top left corner of the scroll port (same as
|
||||||
|
* GetScrollPosition).
|
||||||
|
* For RTL frames, it is the offset of the top right corner of the frame from
|
||||||
|
* the top right corner of the scroll port.
|
||||||
*/
|
*/
|
||||||
virtual nsPoint GetLogicalScrollPosition() const = 0;
|
virtual nsPoint GetLogicalScrollPosition() const = 0;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче