Skip to content

Commit 3731858

Browse files
committedApr 30, 2017
Bug 1360241: Devirtualize nsIFrame::GetType. r=heycam
MozReview-Commit-ID: 5Nzhyta5Hle
1 parent dd2cb65 commit 3731858

File tree

243 files changed

+1742
-2624
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

243 files changed

+1742
-2624
lines changed
 

‎accessible/base/nsAccessibilityService.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -1142,9 +1142,8 @@ nsAccessibilityService::CreateAccessible(nsINode* aNode,
11421142
// accessible for it.
11431143
if (!newAcc && aContext->IsXULTabpanels() &&
11441144
content->GetParent() == aContext->GetContent()) {
1145-
nsIAtom* frameType = frame->GetType();
1146-
if (frameType == nsGkAtoms::boxFrame ||
1147-
frameType == nsGkAtoms::scrollFrame) {
1145+
FrameType frameType = frame->Type();
1146+
if (frameType == FrameType::Box || frameType == FrameType::Scroll) {
11481147
newAcc = new XULTabpanelAccessible(content, document);
11491148
}
11501149
}
@@ -1615,12 +1614,12 @@ nsAccessibilityService::CreateAccessibleByFrameType(nsIFrame* aFrame,
16151614
if (table) {
16161615
nsIContent* parentContent = aContent->GetParent();
16171616
nsIFrame* parentFrame = parentContent->GetPrimaryFrame();
1618-
if (parentFrame->GetType() != nsGkAtoms::tableWrapperFrame) {
1617+
if (!parentFrame->IsTableWrapperFrame()) {
16191618
parentContent = parentContent->GetParent();
16201619
parentFrame = parentContent->GetPrimaryFrame();
16211620
}
16221621

1623-
if (parentFrame->GetType() == nsGkAtoms::tableWrapperFrame &&
1622+
if (parentFrame->IsTableWrapperFrame() &&
16241623
table->GetContent() == parentContent) {
16251624
newAcc = new HTMLTableRowAccessible(aContent, document);
16261625
}

‎accessible/generic/Accessible.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ Accessible::VisibilityState()
385385
// marked invisible.
386386
// XXX Can we just remove this check? Why do we need to mark empty
387387
// text invisible?
388-
if (frame->GetType() == nsGkAtoms::textFrame &&
388+
if (frame->IsTextFrame() &&
389389
!(frame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) &&
390390
frame->GetRect().IsEmpty()) {
391391
nsIFrame::RenderedText text = frame->GetRenderedText(0,
@@ -636,7 +636,8 @@ Accessible::RelativeBounds(nsIFrame** aBoundingFrame) const
636636
// Find a canvas frame the found hit region is relative to.
637637
nsIFrame* canvasFrame = frame->GetParent();
638638
if (canvasFrame) {
639-
canvasFrame = nsLayoutUtils::GetClosestFrameOfType(canvasFrame, nsGkAtoms::HTMLCanvasFrame);
639+
canvasFrame = nsLayoutUtils::GetClosestFrameOfType(
640+
canvasFrame, FrameType::HTMLCanvas);
640641
}
641642

642643
// make the canvas the bounding frame
@@ -1888,7 +1889,7 @@ Accessible::AppendTextTo(nsAString& aText, uint32_t aStartOffset,
18881889
NS_ASSERTION(mParent,
18891890
"Called on accessible unbound from tree. Result can be wrong.");
18901891

1891-
if (frame->GetType() == nsGkAtoms::brFrame) {
1892+
if (frame->IsBrFrame()) {
18921893
aText += kForcedNewLineChar;
18931894
} else if (mParent && nsAccUtils::MustPrune(mParent)) {
18941895
// Expose the embedded object accessible as imaginary embedded object

0 commit comments

Comments
 (0)
Failed to load comments.