RenderImage should not use shadowAncestorNode
https://bugs.webkit.org/show_bug.cgi?id=97871

Reviewed by Dimitri Glazkov.

Since shadowAncestorNode() does not return 0, this if-condition will never hold.
shadowHost() should be used instead.

No change in logic, refactoring.

* rendering/RenderImage.cpp:
(WebCore::RenderImage::hostImageElement):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138922 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Shadow DOM]: crash in WebCore::ElementShadow::setValidityUndetermined
https://bugs.webkit.org/show_bug.cgi?id=106203

Reviewed by Hajime Morita.

InsertionPoint should check whether ElementShadow is available or not
before invoking its methods.

No new tests. Webcomponents_fuzzer reported this bug. Would like to
use the fuzzer to check this issue.

* html/shadow/InsertionPoint.cpp:
(WebCore::InsertionPoint::getDistributedNodes):
(WebCore::InsertionPoint::childrenChanged):
(WebCore::InsertionPoint::insertedInto):
Added ifs to check whether ElementShadow is available or not before
invoking ElementShadow's methods, i.e. setValidityUndetermined,
invalidateDistribution, and ensureDistributionDocument.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138923 268f45cc-cd09-0410-ab3c-d52691b4dbfc