Extended Color Cleanup: Assert !isExtended() in Color::asSimpleColor()...finally
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 May 2020 19:25:51 +0000 (19:25 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 May 2020 19:25:51 +0000 (19:25 +0000)
commita3c3b975e3e43510b0814ba33151736b27386c2a
tree77d034038b6ff880f2067bb55e0ea593f6906e5c
parente4b63ff0e822b91b61f3171f0eff5f505690ec6d
Extended Color Cleanup: Assert !isExtended() in Color::asSimpleColor()...finally
https://bugs.webkit.org/show_bug.cgi?id=212357

Reviewed by Simon Fraser.

Reap the reward of the cleanup, and add the ASSERT(!isExtended()) to Color::asSimpleColor()
as was the original goal of this effort. Only tree non-checked places remained and were
trivial to add isExtended() checks for.

* platform/graphics/Color.cpp:
(WebCore::Color::nameForRenderTreeAsText const):
Use ExtenedColor::cssText() for the RenderTree representation. It is stable
and as good as any, no need to re-invent the wheel here.

(WebCore::Color::light const):
(WebCore::Color::dark const):
Add isExtended() checks before doing white/black checks,

* platform/graphics/Color.h:
(WebCore::Color::asSimpleColor const):
Add ASSERT.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262129 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/Color.cpp
Source/WebCore/platform/graphics/Color.h