Adjust painting disabled mode behavior and fix crash on Windows

The purpose of the painting disabled mode is to make it possible to
measure the performance characteristics of blink's painting logic while
excluding the work done in GraphicsContext and, by extension, Skia. This
means that when painting is disabled, blink should still execute its
painting operations as normally as possible.

For the most part this happens automatically, but one exception is when
blink reaches into the GraphicsContext to use its underlying SkCanvas
directly. When painting is disabled, this canvas doesn't exist and hence
should not be used.

This patch adjusts blink's behavior in painting disabled mode in three
ways:

1. Make it an error to call GraphicsContext::canvas() when painting is
   disabled. This makes it less likely for blink to pass around a null
   canvas and trigger a crash somewhere else in specialized painting
   code.

2. Remove blanket checks for GraphicsContext::paintingDisabled() in
   favor of checking right before using the GraphicsContext's canvas
   directly. This ensures more of the normal painting code is run even
   if painting is disabled.

3. Add checks for GraphicsContext::paintingDisabled() where they were
   missing -- most notably in ScrollbarTheme::paintScrollCorner which
   caused the linked bug.

BUG=360666
TEST=On Windows with at most 800x600 screen resolution:
     $ python tools/perf/run_benchmark rasterize_and_record_micro.top_25 --browser=release

Review URL: https://codereview.chromium.org/235103002

git-svn-id: svn://svn.chromium.org/blink/trunk@171562 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add no-modification assert to HashTableAddResult.

Also, this CL adds specialized version of HashTableAddResult to keep
a weak key alive.

Revert replacement of add-new with get-set in [1].  The add-new idiom
is better because it can check HashMap modification.

[1] https://src.chromium.org/viewvc/blink?view=rev&revision=171265

BUG=

Review URL: https://codereview.chromium.org/226073004

git-svn-id: svn://svn.chromium.org/blink/trunk@171563 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Re-land "Improve support for :read-only and :read-write pseudoclasses".

The fix was reverted because it appeared to cause a security issue.
(It didn't).

Previous review: https://codereview.chromium.org/148223004

BUG=338309,353143
TEST=fast/css/readwrite-contenteditable.html
     fast/css/readwrite-contenteditable-recalc.html

Review URL: https://codereview.chromium.org/236753004

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