Crash in TileController::tileRevalidationTimerFired
https://bugs.webkit.org/show_bug.cgi?id=131656
<rdar://problem/16583166>

Reviewed by Sam Weinig.

It's possible for the TileController revalidation timer to fire after
the GraphicsLayer has been destroyed, so the PlatformCALayer no longer
has an owningGraphicsLayer.

Bail from the timer callback if owningGraphicsLayer() is null.

Also some drive-by 0 -> nullptr changes.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::willBeDestroyed):
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::PlatformCALayer::~PlatformCALayer):
* platform/graphics/ca/mac/TileController.mm:
(WebCore::TileController::tileRevalidationTimerFired):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167290 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r158617): Find on Page can get stuck in a loop when the search string occurs in an <input> in a <fieldset>
https://bugs.webkit.org/show_bug.cgi?id=126322

Reviewed by Ryosuke Niwa.

One additional tweak to the fix for the bug above.
Fixes crash in editing/editability/ignored-content.html test.

* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::canContainRangeEndPoint): Call through to
HTMLElement::canContainRangeEndPoint, bypassing HTMLPlugInElement override
that always returns false. Without this change, this function was always
returning false.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
MallocBench should scavenge explicitly instead of waiting
https://bugs.webkit.org/show_bug.cgi?id=131661

Reviewed by Andreas Kling.


PerformanceTests: 
* MallocBench/MallocBench.xcodeproj/project.pbxproj: Don't build mbmalloc
by default because it will overwrite any other mbmalloc you're working
with in the WebKitBuild directory.

* MallocBench/MallocBench/Benchmark.cpp:
(Benchmark::run): Scavenge explicitly instead of waiting. This is faster,
and it's the only way to get FastMalloc to scavenge. (That's a bug in
FastMalloc, but we don't want it to interfere with broader testing.)

* MallocBench/MallocBench/mbmalloc.cpp:
* MallocBench/MallocBench/mbmalloc.h: Added a scavenge implementation
for system malloc.

Source/bmalloc: 
Added explicit scavenge support to bmalloc. This isn't a memory win,
since bmalloc's per-thread cache is so small. But it makes testing
simpler.

* bmalloc/Allocator.cpp:
(bmalloc::Allocator::~Allocator):
(bmalloc::Allocator::scavenge):
* bmalloc/Allocator.h:
* bmalloc/Cache.cpp:
(bmalloc::Cache::operator new):
(bmalloc::Cache::operator delete):
(bmalloc::Cache::Cache):
(bmalloc::Cache::scavenge):
* bmalloc/Cache.h:
* bmalloc/Deallocator.cpp:
(bmalloc::Deallocator::~Deallocator):
(bmalloc::Deallocator::scavenge):
* bmalloc/Deallocator.h: Factored existing scavenging code into helper
functions, for reuse.

* bmalloc/Heap.cpp:
(bmalloc::sleep):
(bmalloc::Heap::concurrentScavenge):
(bmalloc::Heap::scavenge):
(bmalloc::Heap::scavengeSmallPages):
(bmalloc::Heap::scavengeMediumPages):
(bmalloc::Heap::scavengeLargeRanges):
* bmalloc/Heap.h: Made scavenge sleep duration a parameter. Forced
scavenging -- in response to a benchmark or a low memory warning --
wants to complete as soon as possible, so its sleep duration is 0.

* bmalloc/bmalloc.h:
(bmalloc::api::scavenge):
* bmalloc/mbmalloc.cpp: Exported the scavenge API for MallocBench's use.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167292 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ASSERT when firing low memory warning
https://bugs.webkit.org/show_bug.cgi?id=131659

Reviewed by Mark Hahnenberg.

* heap/Heap.cpp:
(JSC::Heap::deleteAllCompiledCode): Allow deleteAllCompiledCode to be
called when no GC is happening because that is what we do when a low
memory warning fires, and it is harmless.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167293 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update to CodeMirror 4.0.
https://bugs.webkit.org/show_bug.cgi?id=130019

The CodeMirror 4.0 library adds multiple selections and the ability to
undo/redo selections. Selections are made by holding the Command (Cmd) key
and clicking into an editor, or by holding Option (Alt) and making a block
selection followed by entering a character or moving the cursor.

Patch by Jono Wells <jonowells@apple.com> on 2014-04-14
Reviewed by Timothy Hatcher.

* Scripts/update-codemirror-resources.rb:
* Scripts/update-pretty-printer.rb:
Update scripts to reflect updated locations for CodeMirror files.
No longer copies LESS mode file as this has been integrated into CSS mode
in CodeMirror 4.0.

* Tools/PrettyPrinting/codemirror.css:
* Tools/PrettyPrinting/codemirror.js:
* Tools/PrettyPrinting/css.js:
* Tools/PrettyPrinting/javascript.js:
* UserInterface/External/CodeMirror/clojure.js:
* UserInterface/External/CodeMirror/closebrackets.js:
* UserInterface/External/CodeMirror/codemirror.css:
* UserInterface/External/CodeMirror/codemirror.js:
* UserInterface/External/CodeMirror/coffeescript.js:
* UserInterface/External/CodeMirror/comment.js:
* UserInterface/External/CodeMirror/css.js:
* UserInterface/External/CodeMirror/htmlmixed.js:
* UserInterface/External/CodeMirror/javascript.js:
* UserInterface/External/CodeMirror/livescript.js:
* UserInterface/External/CodeMirror/matchbrackets.js:
* UserInterface/External/CodeMirror/overlay.js:
* UserInterface/External/CodeMirror/placeholder.js:
* UserInterface/External/CodeMirror/runmode.js:
* UserInterface/External/CodeMirror/sass.js:
* UserInterface/External/CodeMirror/searchcursor.js:
* UserInterface/External/CodeMirror/sql.js:
* UserInterface/External/CodeMirror/xml.js:
Update to CodeMirror 4.0.

* UserInterface/Main.html: Remove less.js which is now part of css.js.

* UserInterface/Views/CSSStyleDeclarationTextEditor.css:
* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
(WebInspector.CSSStyleDeclarationTextEditor.prototype.):
(WebInspector.CSSStyleDeclarationTextEditor.prototype._createColorSwatches):
(WebInspector.CSSStyleDeclarationTextEditor.prototype._updateJumpToSymbolTrackingMode):
* UserInterface/Views/SyntaxHighlightingDefaultTheme.css:
Update styles to match CodeMirror changes. Update CSSStyleDeclarationTextEditor.js
to match CodeMirror API updates (doc.removeLine() has been removed, so
replaceRange() is used instead). Also the tokenTrackingController is now enabled in the
CSSStyleDeclarationTextEditor and SourceCodeTextEditor when the Option (Alt) key
is pressed instead of the Command (Cmd) key so as not to conflict with multiple
cursor placement in the CodeMirror update.

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