Canvas direction should reflect change in dir attribute and also across save/restore operations
https://bugs.webkit.org/show_bug.cgi?id=136098

Reviewed by Darin Adler.

Source/WebCore:

Changed State.m_direction type from TextDirection to Direction enum to accomodate 'inherit'
as a separate value. Modified the getter to compute the 'live' value for the direction attribute.
Removed explicit passing of direction to CanvasRenderingContext2D::State constructor.

Updated existing canvas-direction.html with additional cases to reflect this change.

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D):
(WebCore::CanvasRenderingContext2D::reset):
(WebCore::CanvasRenderingContext2D::State::State):
(WebCore::CanvasRenderingContext2D::toTextDirection):
(WebCore::CanvasRenderingContext2D::direction):
(WebCore::CanvasRenderingContext2D::setDirection):
(WebCore::CanvasRenderingContext2D::drawTextInternal):
(WebCore::inheritedDirection): Deleted.
* html/canvas/CanvasRenderingContext2D.h:

LayoutTests:

* fast/canvas/canvas-direction-expected.txt:
* fast/canvas/canvas-direction.html:


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