Refactor "needs layout" check in LayoutImage

Move the conditions used to check if layout is needed when the intrinsic
size changes out into a new function, and call that from
LayoutImage::InvalidatePaintAndMarkForLayoutIfNeeded.
Replace open-coded HasRelativeLogicalWidth() with a call to that method.

Bug: 870599
Change-Id: Iae480326083eb493d58233378d95af8c1dd62f0a
Reviewed-on: https://chromium-review.googlesource.com/c/1373839
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616624}
2 files changed