Commit 75391e2f authored by Abhijeet Kandalkar's avatar Abhijeet Kandalkar Committed by Commit Bot

Use new downcast helper for blink::HTMLFrameElement

This CL has two goals,
1. Use To<HTMLFrameElement> and DynamicTo<HTMLFrameElement> as new
   downcast helper.
2. Use IsA<HTMLFrameElement>(element) in place of
   IsHTMLFrameElement(element)

Bug: 891908
Change-Id: Id895e0cf6c250307fca10a2bf4b40228b98ba889
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1741444
Commit-Queue: Abhijeet Kandalkar <abhijeet@igalia.com>
Reviewed-by: default avatarChristian Biesinger <cbiesinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#685128}
parent 08b5ec3f
...@@ -229,7 +229,7 @@ static void AdjustStyleForHTMLElement(ComputedStyle& style, ...@@ -229,7 +229,7 @@ static void AdjustStyleForHTMLElement(ComputedStyle& style,
return; return;
} }
if (IsHTMLFrameElement(element) || IsHTMLFrameSetElement(element)) { if (IsA<HTMLFrameElement>(element) || IsHTMLFrameSetElement(element)) {
// Frames and framesets never honor position:relative or position:absolute. // Frames and framesets never honor position:relative or position:absolute.
// This is necessary to fix a crash where a site tries to position these // This is necessary to fix a crash where a site tries to position these
// objects. They also never honor display nor floating. // objects. They also never honor display nor floating.
......
...@@ -88,7 +88,7 @@ class CORE_EXPORT HTMLFrameElementBase : public HTMLFrameOwnerElement { ...@@ -88,7 +88,7 @@ class CORE_EXPORT HTMLFrameElementBase : public HTMLFrameOwnerElement {
}; };
inline bool IsHTMLFrameElementBase(const HTMLElement& element) { inline bool IsHTMLFrameElementBase(const HTMLElement& element) {
return IsHTMLFrameElement(element) || IsHTMLIFrameElement(element); return IsA<HTMLFrameElement>(element) || IsHTMLIFrameElement(element);
} }
DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLFrameElementBase); DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLFrameElementBase);
......
...@@ -37,7 +37,7 @@ LayoutFrame::LayoutFrame(HTMLFrameElement* frame) ...@@ -37,7 +37,7 @@ LayoutFrame::LayoutFrame(HTMLFrameElement* frame)
} }
FrameEdgeInfo LayoutFrame::EdgeInfo() const { FrameEdgeInfo LayoutFrame::EdgeInfo() const {
HTMLFrameElement* element = ToHTMLFrameElement(GetNode()); auto* element = To<HTMLFrameElement>(GetNode());
return FrameEdgeInfo(element->NoResize(), element->HasFrameBorder()); return FrameEdgeInfo(element->NoResize(), element->HasFrameBorder());
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment