Use toProcessingInstruction() as much as possible.

Add const version of it.

BUG=none
TEST=none; no behavior changes.

Review URL: https://chromiumcodereview.appspot.com/23597023

git-svn-id: svn://svn.chromium.org/blink/trunk@157507 bbb929c8-8fbe-4397-9dbb-9b2b20218538
setAttributeNode() does not set the new value to an existing attribute if specified attribute is in a different case.

setAttributeNode() now performs a case-insensitive search for an existing attribute
and if found, retrieves the index of such an attribute. For setting the value we
call upon setAttributeInternal() to which we pass both the index as well as the name.
The name passed to this method is the same as the one passed to the setAttributeNode() API from the webpage and thus can be in any case.

However, setAttributeInternal() uses this name to get the corresponding existing node.
Since this retrieval is not case-insensitive, the existing node is not found and thus
the new value is not set on the existing node.
We should instead use the passed index and use that to retrieve the existing node.

Note that obtaining the attribute's value using getAttributeNode() would still
return the correct value, i.e. the new one.

Also, this now makes our behavior similar to that of FF and IE.

BUG= 279193, 282922
R= esprehn@chromium.org,eseidel@chromium.org,ojan@chromium.org

Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=157015

Review URL: https://chromiumcodereview.appspot.com/22842013

git-svn-id: svn://svn.chromium.org/blink/trunk@157508 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Don't make new sub-path in Path::addArc().

Path::addArc() creates new sub-path because it uses SkPath::addOval() that calls
moveTo() and close() internally. We can't use SkPath::addOval() because we can't
know whether this path object can close now.

Currently, only arc() and ellipse() in CanvasPathMethods use Path::addArc(), so
we can trust that endAngle - startAngle < 4Pi and anticlockwise is consistent
with the sweep angle. To trust CanvasPathMethods, this CL makes
CanvasPathMethods adjust startAngle and endAngle before Path::addArc() is
called.

BUG=248167

TEST=canvas-arc-circumference-fill.html

Review URL: https://chromiumcodereview.appspot.com/23495009

git-svn-id: svn://svn.chromium.org/blink/trunk@157509 bbb929c8-8fbe-4397-9dbb-9b2b20218538