Web Inspector: Breakpoints in sourceURL named scripts do not work
https://bugs.webkit.org/show_bug.cgi?id=123231

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2013-10-24
Reviewed by Timothy Hatcher.

Source/WebCore:

Remember a Script's sourceURL and sourceMappingURL. When setting a
breakpoint by URL, check it against the sourceURL or original URL.
If a script had a sourceURL that would have been the only URL sent
to the frontend, so that receives priority.

Test: inspector-protocol/debugger/setBreakpointByUrl-sourceURL.html

* inspector/InspectorDebuggerAgent.cpp:
(WebCore::InspectorDebuggerAgent::setBreakpointByUrl):
(WebCore::InspectorDebuggerAgent::didParseSource):
* inspector/InspectorDebuggerAgent.h:
* inspector/ScriptDebugListener.h:

LayoutTests:

* inspector-protocol/debugger/setBreakpointByUrl-sourceURL-expected.txt: Added.
* inspector-protocol/debugger/setBreakpointByUrl-sourceURL.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157939 268f45cc-cd09-0410-ab3c-d52691b4dbfc
SVG: RenderElement-ize intersectRepaintRectWithResources().
<https://webkit.org/b/123278>

SVGRenderSupport::intersectRepaintRectWithResources() is only ever
called with non-text renderers so make it take RenderElement&.

Had to tweak RenderSVGResource::resourceBoundingBox() to take the
renderer by reference.

Reviewed by Antti Koivisto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157940 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Layout Test compositing/regions/propagate-region-box-shadow-border-padding-for-video.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=123282

* platform/mac/TestExpectations: Marking as such.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157941 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Inspector doesn't show webkitTransitionEnd events in the timeline
https://bugs.webkit.org/show_bug.cgi?id=123263

Reviewed by Timothy Hatcher.

A legacy event type is only set on an event in EventTarget::fireEventListeners(Event*)
which is called after we used to call InspectorInstrumentation::willDispatchEvent(), the method
that would ultimately yield the creation of a TimelineRecord for the event in the Web Inspector
frontend, and as a result we would try to dispatch an event with an unprefixed event type to
the frontend, which wouldn't even happen because most likely it wouldn't have listeners for this
unprefixed type.

We now move the call to InspectorInstrumentation::willDispatchEvent() in
EventTarget::fireEventListeners(Event*, EventTargetData*, EventListenerVector&) such that the
correct event type and list of listeners is used to determine what event to dispatch to the frontend.

* dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::dispatchEvent):
Remove calls to InspectorInstrumentation::willDispatchEvent() and InspectorInstrumentation::didDispatchEvent().

* dom/EventTarget.cpp:
(WebCore::EventTarget::fireEventListeners):
Add call to InspectorInstrumentation::willDispatchEvent() before we go through each listener and
call InspectorInstrumentation::willHandleEvent(). Additionally, we refactor some code since we're
getting references to the ScriptExecutionContext and Document upfront now.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157942 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r157931.
http://trac.webkit.org/changeset/157931
https://bugs.webkit.org/show_bug.cgi?id=123284

Seems to have caused a lot of assertions on debug bots
(Requested by ap on #webkit).

* wtf/text/StringStatics.cpp:
(WTF::StringImpl::empty):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157943 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[contenteditable] Content after non-editable element disappears when merging lines using backspace
https://bugs.webkit.org/show_bug.cgi?id=122748

Patch by Santosh Mahto <santosh.ma@samsung.com> on 2013-10-24
Reviewed by Ryosuke Niwa.

Source/WebCore:

In case of paragraph merging after deletion if second paragraph
contains non-editable element, then content after the non-editable
element(including non-editable element) will be removed while the
content before the element will be merged with the first paragraph.
This happens becasue endOfParagraphToMove calculation in merging function
stop at editing boundary so endOfParagraphToMove becomes position just
before non-editable content.
With this patch now endOfParagraphToMove is calculated by skipping
over the non-editable element.

Test: editing/deleting/merge-paragraph-contatining-noneditable.html

* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::mergeParagraphs): use CanSkipOverEditingBoundary
condition while calculating endOfParagraphToMove.

LayoutTests:

Adding test to verify that on merging the paragraph containing
non-editable element does not cause loss of non-editable content after
merging.

* editing/deleting/merge-paragraph-contatining-noneditable-expected.txt: Added.
* editing/deleting/merge-paragraph-contatining-noneditable.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157944 268f45cc-cd09-0410-ab3c-d52691b4dbfc
SVGRenderingContext should wrap a RenderElement.
<https://webkit.org/b/123283>

The SVG rendering context class is never used with text renderers
so we can have it wrap a RenderElement for tighter code.

Also renamed SVGRenderingContext::m_object to m_renderer.

Reviewed by Antti Koivisto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157945 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix unnecessary alerted value leaking into another test.

Rubber-stamped by Alexey Proskuryakov.

* inspector-protocol/debugger/setBreakpointByUrl-sourceURL.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157946 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Adjust the precision of byte strings in Web Inspector.

https://bugs.webkit.org/show_bug.cgi?id=123281

Reviewed by Joseph Pecoraro.

* UserInterface/Utilities.js:
(Number.bytesToString): More precision for MB and less precision for 10..1023 KB.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157947 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Gaps between underlines in adjacent underlined text runs
https://bugs.webkit.org/show_bug.cgi?id=123236

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2013-10-24
Reviewed by Simon Fraser and Darin Adler.

Source/WebCore:

There are two pieces to this change. The first piece is in
InlineTextBox::paint(). We were putting floating-point
extents into a LayoutSize, which simply uses ints (for now),
and then immediately converting this back to a FloatSize.
Instead, we should be using floats throughout all of
this code.

In addition, inside GraphicsContext::drawLineForText(), we are
rounding the underline to pixel boundaries so that it appears
very crisp on the screen. However, we should round once after
performing computations, rather than rounding twice and then
performing computations on the rounded numbers.

Test: fast/css3-text/css3-text-decoration/no-gap-between-two-rounded-textboxes.html

* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawLineForText): Change rounding mode
    to perform computations before rounding
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint): Don't convert to a LayoutSize
    just to convert to a FloatSize

LayoutTests:

Added a test that checks that we have accurate precision in our
floating-point computations. We should perform calculations before
rounding, instead of rouding twice and performing calculations on
the rounded values.

* fast/css3-text/css3-text-decoration/no-gap-between-two-rounded-textboxes.html: Added.
* platform/mac/fast/css3-text/css3-text-decoration/no-gap-between-two-rounded-textboxes-expected.png: Added.
* platform/mac/fast/css3-text/css3-text-decoration/no-gap-between-two-rounded-textboxes-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157948 268f45cc-cd09-0410-ab3c-d52691b4dbfc
dumpAsText() is unnecessarily called in spellchecking tests
https://bugs.webkit.org/show_bug.cgi?id=123266

Reviewed by Darin Adler.

dumpAsText is already called either by notifyDone (js-test-post.js) or
by finishJSTest() when asynchrononous spell checking is used.

* editing/spelling/spellcheck-async-mutation.html:
* editing/spelling/spellcheck-async.html:
* editing/spelling/spellcheck-attribute-expected.txt:
* editing/spelling/spellcheck-attribute.html:
* editing/spelling/spelling-insert-html.html:
* editing/spelling/spelling-unified-emulation.html:


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