Commit ec04274d authored by Abhijeet Kandalkar's avatar Abhijeet Kandalkar Committed by Commit Bot

Use new downcast helper for blink::HTMLSourceElement

This primary goal of this CL is to use DynamicTo<HTMLSlotElement> as
new downcast helper

Bug: 891908
Change-Id: Iad3033d44acf245e16c50f0a18cd196cf5791566
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1874415
Commit-Queue: Abhijeet Kandalkar <abhijeet@igalia.com>
Reviewed-by: default avatarChristian Biesinger <cbiesinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708970}
parent 68d2f1a3
......@@ -327,10 +327,10 @@ ImageCandidate HTMLImageElement::FindBestFitImageFromPictureParent() {
if (child == this)
return ImageCandidate();
if (!IsHTMLSourceElement(*child))
auto* source = DynamicTo<HTMLSourceElement>(child);
if (!source)
continue;
HTMLSourceElement* source = ToHTMLSourceElement(child);
if (!source->FastGetAttribute(html_names::kSrcAttr).IsNull()) {
Deprecation::CountDeprecation(GetDocument(),
WebFeature::kPictureSourceSrc);
......
......@@ -3084,12 +3084,9 @@ KURL HTMLMediaElement::SelectNextSourceChild(
continue;
looking_for_start_node = false;
if (!IsHTMLSourceElement(*node))
source = DynamicTo<HTMLSourceElement>(node);
if (!source || node->parentNode() != this)
continue;
if (node->parentNode() != this)
continue;
source = ToHTMLSourceElement(node);
// 2. If candidate does not have a src attribute, or if its src
// attribute's value is the empty string ... jump down to the failed
......
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