Bug 1896516 Part 5 - Fix build errors after including ScrollContainerFrame.h under dom/animation/. r=layout-reviewers,boris

This is a preparation to remove `#include "nsIScrollableFrame.h"` for
ScrollTimeline.cpp and ViewTimeline.cpp.

Move the implementation of `nsListControlFrame::GetMultiple()` to cpp. Keeping
it inline requires adding `#include "mozilla/dom/Element.h"` in the header, and
I don't feel the method is hot enough to be inlined.

Differential Revision: https://phabricator.services.mozilla.com/D211492
This commit is contained in:
Ting-Yu Lin
2024-05-28 04:46:18 +00:00
parent 509e5ab505
commit 2ac683bd57
7 changed files with 10 additions and 4 deletions

View File

@@ -12,6 +12,7 @@
#include "mozilla/DisplayPortUtils.h" #include "mozilla/DisplayPortUtils.h"
#include "mozilla/ElementAnimationData.h" #include "mozilla/ElementAnimationData.h"
#include "mozilla/PresShell.h" #include "mozilla/PresShell.h"
#include "mozilla/ScrollContainerFrame.h"
#include "nsIFrame.h" #include "nsIFrame.h"
#include "nsIScrollableFrame.h" #include "nsIScrollableFrame.h"
#include "nsLayoutUtils.h" #include "nsLayoutUtils.h"

View File

@@ -8,6 +8,7 @@
#include "mozilla/dom/Animation.h" #include "mozilla/dom/Animation.h"
#include "mozilla/dom/ElementInlines.h" #include "mozilla/dom/ElementInlines.h"
#include "mozilla/ScrollContainerFrame.h"
#include "nsIScrollableFrame.h" #include "nsIScrollableFrame.h"
#include "nsLayoutUtils.h" #include "nsLayoutUtils.h"

View File

@@ -668,6 +668,10 @@ void nsListControlFrame::SetInitialChildList(ChildListID aListID,
ScrollContainerFrame::SetInitialChildList(aListID, std::move(aChildList)); ScrollContainerFrame::SetInitialChildList(aListID, std::move(aChildList));
} }
bool nsListControlFrame::GetMultiple() const {
return mContent->AsElement()->HasAttr(nsGkAtoms::multiple);
}
HTMLSelectElement& nsListControlFrame::Select() const { HTMLSelectElement& nsListControlFrame::Select() const {
return *static_cast<HTMLSelectElement*>(GetContent()); return *static_cast<HTMLSelectElement*>(GetContent());
} }

View File

@@ -225,9 +225,7 @@ class nsListControlFrame final : public mozilla::ScrollContainerFrame,
/** /**
* Returns whether mContent supports multiple selection. * Returns whether mContent supports multiple selection.
*/ */
bool GetMultiple() const { bool GetMultiple() const;
return mContent->AsElement()->HasAttr(nsGkAtoms::multiple);
}
mozilla::dom::HTMLSelectElement& Select() const; mozilla::dom::HTMLSelectElement& Select() const;

View File

@@ -96,6 +96,7 @@
#include "mozilla/layers/ScrollLinkedEffectDetector.h" #include "mozilla/layers/ScrollLinkedEffectDetector.h"
#include "mozilla/Unused.h" #include "mozilla/Unused.h"
#include "MobileViewportManager.h" #include "MobileViewportManager.h"
#include "TextOverflow.h"
#include "VisualViewport.h" #include "VisualViewport.h"
#include "WindowRenderer.h" #include "WindowRenderer.h"
#include <algorithm> #include <algorithm>

View File

@@ -19,7 +19,6 @@
#include "nsIReflowCallback.h" #include "nsIReflowCallback.h"
#include "nsQueryFrame.h" #include "nsQueryFrame.h"
#include "nsExpirationTracker.h" #include "nsExpirationTracker.h"
#include "TextOverflow.h"
#include "ScrollVelocityQueue.h" #include "ScrollVelocityQueue.h"
#include "mozilla/ScrollTypes.h" #include "mozilla/ScrollTypes.h"
#include "mozilla/PresState.h" #include "mozilla/PresState.h"
@@ -33,6 +32,7 @@ class nsIScrollPositionListener;
class AutoContainsBlendModeCapturer; class AutoContainsBlendModeCapturer;
namespace mozilla { namespace mozilla {
struct nsDisplayListCollection;
class PresShell; class PresShell;
enum class StyleScrollbarWidth : uint8_t; enum class StyleScrollbarWidth : uint8_t;
class ScrollContainerFrame; class ScrollContainerFrame;

View File

@@ -129,6 +129,7 @@ EXPORTS += [
"ScrollAnimationPhysics.h", "ScrollAnimationPhysics.h",
"ScrollbarActivity.h", "ScrollbarActivity.h",
"ScrollSnap.h", "ScrollSnap.h",
"ScrollVelocityQueue.h",
"TextDrawTarget.h", "TextDrawTarget.h",
"Visibility.h", "Visibility.h",
] ]