Skip to content

Commit

Permalink
Use new downcast helper for blink::HTMLSourceElement
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Christian Biesinger <[email protected]>
Cr-Commit-Position: refs/heads/master@{#708970}
  • Loading branch information
abhijeetk authored and Commit Bot committed Oct 24, 2019
1 parent 68d2f1a commit ec04274
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions third_party/blink/renderer/core/html/html_image_element.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ec04274

Please sign in to comment.