WebAudioBus::release() should return nullptr instead of 0 when WEB_AUDIO=0.

This is breaking the Android WebView AOSP builder, which is the only bot
which builds Chromium with Web Audio disabled.

R=haraken@chromium.org
TBR=jochen
BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@167591 bbb929c8-8fbe-4397-9dbb-9b2b20218538
DevTools: Focus visible console on Ctrl+`

Currently, the hidden console is shown on Ctrl+`, but it is not focused if it is visible. This patch handles the focusing part.

R=eustas@chromium.org, eustas, vsevik
BUG=144943

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

git-svn-id: svn://svn.chromium.org/blink/trunk@167592 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Revert r167585 "[DevTools] Do not access WebViewImpl and WebDevToolsAgentClient when closing." Debug bots are unhappy.

TBR=haraken

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

git-svn-id: svn://svn.chromium.org/blink/trunk@167593 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Don't ignore size updates that have a width and height == 0.

It is perfectly legal for the Android WebView to have a zero height,
this is frequenly how a new WebView is first laid out. Rejecting the
initial (width, 0) size update causes the initial layout to be
too narrow.

BUG=344885
TBR=aelias@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@167594 bbb929c8-8fbe-4397-9dbb-9b2b20218538
This is a regression test for crbug.com/343506. It sends one empty
message fragmented into two frames. There are pauses between the
frames to force the browser to process them individually.

Requires https://codereview.chromium.org/170383002/ in be landed in Chromium in
order to pass.

BUG=343506
TEST=this

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

git-svn-id: svn://svn.chromium.org/blink/trunk@167595 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Attempt to fix issue 344300 by guarding against rootStyle being null.

From what I can tell this was introduced in issue 64293008 at Nov 29th 2013. Clusterfuzz also broke at that time with a similar stack trace. 

An alternatively fix could be to assert that rootStyle is never set to null in the constructors of CSSToLengthConversionData. However that seems to be a more involved fix and I will leave that for the owner of the code.

R=ager@chromium.org, erik.corry@gmail.com, haraken@chromium.org, timloh@chromium.org, tkent@chromium.org, vegorov@chromium.org, zerny@chromium.org
BUG=344300

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

git-svn-id: svn://svn.chromium.org/blink/trunk@167596 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Update TestExpectation for svg/custom/getsvgdocument.html

After r167574, svg/custom/getsvgdocument.html stops failing and becomes image-only-failure.

BUG=284734

TBR=kouhei

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

git-svn-id: svn://svn.chromium.org/blink/trunk@167597 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Avoid unnecessary style recalc for subtree of focused element.

*** Relanding https://codereview.chromium.org/135183002/

Updating the styles for an element that changes its focus state only needs to
force a recalc of the subtree if the subtree contains an element that could
match a selector which contains a :focus pseudo class left of child or
descendant combinator. At the same time, that :focus pseudo must match the
element we are updating focus state for. This is indicated by the return value
of Element::childrenAffectedByFocus.

This change does a LocalStyleChange when updating the focus state of an
element which returns false for childrenAffectedByFocus, and
SubtreeStyleChange otherwise.

TBR=eseidel
BUG=315923

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

git-svn-id: svn://svn.chromium.org/blink/trunk@167598 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Remove unused WorkerGlobalScope::Observer interface.

No one implements it.

BUG=none
TEST=none; no behavior changes

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

git-svn-id: svn://svn.chromium.org/blink/trunk@167599 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Prefactorings for filter suggest box.

See https://chromiumcodereview.appspot.com/59843002/

BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@167600 bbb929c8-8fbe-4397-9dbb-9b2b20218538
[DevTools] Add support for 'Embedder Callback' event type in Timeline

This event is to be used for embedder callback events that occur when
Chromium is embedded, e.g. in the case of Android WebView.

BUG=344871
R=caseq@chromium.org, pfeldman@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@167601 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add rotateRadians function to AffineTransform

Currently, rotate function takes an argument in only degrees.
In many cases, rotate function is often required radian value instead of degree value.
If we add new rotateRadians function, we will be able to reduce unnecessary operations.

 Before : rad -> rad2deg -> deg2rad -> calc sinNcos
 After  : rad                       -> calc sinNcos

As a result, we can reduce two multiplication and two division.

Similar case: https://bugs.webkit.org/show_bug.cgi?id=87317
Applications: https://codereview.chromium.org/173593002/

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

git-svn-id: svn://svn.chromium.org/blink/trunk@167603 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Mark fast/repaint/selection-gap-overflow-scroll-2.html as flaky.

BUG=345767
TBR=acolwell@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@167605 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Move FrameView::serviceScriptedAnimations to a Page-level object

FrameView::serviceScriptedAnimations is only ever called on the top-level
FrameView. It walks the whole frame heirachy and services all the animations
for every document.

This CL moves that function to a Page-level object, which means its associated
state, m_servicingAnimations, will exist only once per frame heirarchy (instead
of existing incorrectly at every level of the heirarchy).

R=ojan@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@167607 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Finish moving StyleRuleBase and its descendants to garbage collected heap.

StyleRuleBase is now RefCountedWillBeGarbageCollectedFinalized.

BUG=341815

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

git-svn-id: svn://svn.chromium.org/blink/trunk@167608 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Optimize WebCore::propertyNameMatchesAttributeName() function

The Intel VTune Amplifier profiler detects
WebCore::propertyNameMatchesAttributeName()
to be the biggest hotspot when running the
'Bindings/named-property-enumerator.html'
performance test. One of the reasons is a lot
of 'WTF::StringImpl::operator[]' invocations
(each invocation checks 'is8Bit()' property).

This patch changes the function's logic so that
'is8Bit()' is checked only once per each argument.

After the patch is applied the profiler is
showing 0.6s of CPU time gain.

Comparison of the test own results looks even more
promising :)

Before:
avg 59.55333689995765 runs/s
median 59.804160976424754 runs/s
stdev 0.5253717029964368 runs/s
min 58.08955085158755 runs/s
max 60.050394290734246 runs/s

After:
avg 90.88615782092175 runs/s
median 91.84269953299489 runs/s
stdev 3.5291535486947656 runs/s
min 82.45819663901538 runs/s
max 95.0907046462235 runs/s

Performance gain for the average value is more than 50%
(Linux desktop 64x, GCC 4.6.3).

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

git-svn-id: svn://svn.chromium.org/blink/trunk@167609 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Partial XSS auditor bypass when server collapses path components.

We can't trust the number of slashes when looking for a match, so remove
them when we canonicalize the string.

Unfortunately, we absolutely need to have the slashes when looking for
terminating conditions.  So split out the canonicalization from the decoding,
so that we can decode first, then look for termination, then canonicalize.

BUG=344146
R=abarth@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@167610 bbb929c8-8fbe-4397-9dbb-9b2b20218538
[webcrypto] Make all of the crypto.subtle method failures asynchronous.

This matches the spec update https://dvcs.w3.org/hg/webcrypto-api/rev/4bd9e8dbe699

Background: The crypto.subtle methods all return a Promise. Rather than throwing exceptions for certain types of invalid/unsupported input but not others, the Promise is now consistently rejected. Web IDL errors are not affected and will still throw exceptions like before.

Specifically this changelist makes it so:
 * No longer throws NotSupportedError [1]
 * No longer throws when given an unrecognized/unsupported KeyFormat or KeyUsage

[1] It used to do this when the algorithm name was unrecognized, or the algorithm didn't support the requested operation.

BUG=245025

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

git-svn-id: svn://svn.chromium.org/blink/trunk@167611 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Remove unused WebPrivatePtr::operator=(std::nullptr_t).

With std::nullptr_t constructors in place for the various Ptr types,
this method is no longer needed.

Also revert some reset() uses that were introduced while waiting for
the same nullptr change to land.

R=abarth@chromium.org
BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@167612 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Remove unnecessary memcpy() in XMLDocumentParser.cpp.

This also removes SharedBuffer::moveTo() given that XMLDocumentParser.cpp is
the only client.

SharedBuffer::moveTo() was initially introduced to save a memcpy() in
ResourceFetcher. Unfortunately the code has been moved around and also changed
quite significantly leading to the addition of an unnecessary copy constructor
call defeating the purpose of the optimization in the first place.

BUG=290193

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

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