Checking for no IDBDatabase backend prior to use.

Speculative fix for a NULL ptr crash (crbug.com/362418) in
WebCore::IDBDatabase::transaction. In this case a IDBDatabase had been stopped
which results in the backend (blink::WebIDBDatabase) being deleted. If after
that the backend (m_backend) was used then a crash would ensue.

BUG=362418

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172438 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Comment out assertion in CSSAnimations.cpp

This is causing Chrome OS test failures in debug browser_tests for
SimpleWebViewDialogTest.Interstitial. The tests pass without this assertion.
Commenting it out while we investigate the underlying issue.

BUG=365507
TEST=browser_tests SimpleWebViewDialogTest.Interstitial

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172439 bbb929c8-8fbe-4397-9dbb-9b2b20218538
LiveNodeListBase code should not need to worry about id/name cache invalidation

LiveNodeListBase code should not need to worry about id/name cache
invalidation. Previously, LiveNodeListBase::invalidateCache(QualifiedName) would
explicitly handle the case where the nodelist has a id/name cache (i.e. it is
an HTMLCollection) and then invalidate it.

The following changes were made to avoid this:
- Add invalidateCacheForAttribute() methods to HTMLCollection and LiveNodeList
  classes and let them handle cache invalidation. HTMLCollection's method is
  the only one that takes care of invalidating the id/name cache if needed.
- The invalidateCacheForAttribute() method in LiveNodeListBase calls the
  corresponding method on the right subclass using the m_collectionType member.
  We could make it virtual but cache invalidation can be hot and this causes
  slight regressions in Dromaeo.
- Remove any traces of id/name caching from LiveNodeListBase.
- Use DEFINE_TYPE_CASTS() macro to define casting functions for HTMLCollection
  and LiveNodeList, so that we no longer need to do manual casting.
- LiveNodeListBase no longer needs to be a friend class of HTMLCollection.

Also, the method was renamed to invalidateCacheForAttribute() for clarity and
to distinguish it better from the invalidateCache(Document*) one.

I see no performance regression on Dromaeo DOM tests:
http://dromaeo.com/?id=220318,220326

R=esprehn@chromium.org, adamk@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172440 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Oilpan: Replace a WeakPtr in MediaKeySession with a WeakMember

- This CL is a preparation for enabling Oilpan in modules/encryptedmedia.

- This CL replaces a WeakPtr for MediaKeySession::m_keys with a WeakMember. This replacement is OK because m_keys does not need to be promptly cleared out (i.e., it's OK to delay the clear to the next GC). m_keys is just used in hasPendingActivity() to check whether the MediaKey is still alive or not. So even if m_keys is not cleared out promptly, it just delays the timing when a V8 wrapper of MediaKeySession is collected by V8 GC. This is no problem.

TEST=media/encrypted-media
BUG=340522

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172441 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Proper unicode-range font loading behavior

Remote fonts defined by @font-face rules should be loaded only if any
characters in its unicode-range descriptor are used [1].

Before this patch, remote fonts are loaded when the first glyph page for
the font is created. It did not 100% prevent unnecessary downloads, as
(1) All remote fonts in the fallback list were loaded, and (2) Use of
codepoint near the unicode-range could trigger load.

This patch adds m_customFontToLoad field to GlyphPage. It contains
CustomFontData for the first unloaded remote font in the fallback list.
GlyphPage::glyphDataForCharacter() triggers the font load.

text-intro-09-b.svg had to be changed to wait loads because SVGHebrew
and 'Ezra SIL SR' are now loaded sequentially, not at once.

[1] http://www.w3.org/TR/css3-fonts/#composite-fonts

BUG=247920
TEST=blink_platform_unittests,fast/css/font-face-unicode-range-overlap-load.html

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172443 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Web Animations: Dont request recalc when animation is detached from player

This was redundant, removing it avoids hitting a case where the last reference
to a Player is held by CompositorPendingAnimations which could cause an
unexpected lifecycle change following the compositing update. Future patches
will ensure that CompositorPendingAnimations does not hold the last reference
to a finished but not cancelled player.

BUG=364250

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172444 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Comment out assertion failing on Chrome OS login page

RenderLayerCompositor::updateIfNeededRecursive() is asserting out on the
Chrome OS debug builders in browser_tests for kiosk mode. The tests pass
with the assertion commented out, so I'm doing that to get the bots green
while the underlying issue is investigated.

BUG=365507
TEST=browser_tests *Kiosk* on linux_chromeos

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172445 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Update LeakExpectations file.

- r255342 fixed |EventSender| context menu leak.
+ acid3 is flaky
+ http/tests/htmlimports/redirect.html flaky
+ fast/dom/remove-svg-font-face-element-crash.xhtml flaky
+ mark more shared worker tests

NOTRY=true
BUG=364390, 364391, 364395, 364408, 366455, 366477

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172446 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Oilpan: Prepare to make GeolocationPosition and GeolocationError garbage-collected.

BUG=340522

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

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