[GTK] Unreviewed GTK gardening.

* platform/gtk/TestExpectations: Update test name for bug 136673 after r173418.
* platform/gtk/css1/box_properties/clear_float-expected.txt: Rebaseline after r174233.
* platform/gtk/css1/box_properties/float_on_text_elements-expected.txt: Rebaseline after r174233.
* platform/gtk/css2.1/t0905-c5525-fltcont-00-d-g-expected.txt: Rebaseline after r174233.
* platform/gtk/css2.1/t0905-c5525-fltwidth-00-c-g-expected.txt: Rebaseline after r174233.
* platform/gtk/css2.1/t1602-c546-txt-align-00-b-expected.txt: Rebaseline after r174233.
* platform/gtk/fast/multicol/float-avoidance-expected.txt: Rebaseline after r174233.
* platform/gtk/fast/multicol/overflow-across-columns-expected.txt: Rebaseline after r174233.
* platform/gtk/fast/multicol/overflow-across-columns-percent-height-expected.txt: Rebaseline after r174233.
* platform/gtk/fast/multicol/overflow-unsplittable-expected.txt: Rebaseline after r174233.
* platform/gtk/fast/multicol/positive-leading-expected.txt: Rebaseline after r174233.
* platform/gtk/fast/multicol/vertical-lr/float-avoidance-expected.txt: Rebaseline after r174233.
* platform/gtk/fast/multicol/vertical-rl/float-avoidance-expected.txt: Rebaseline after r174233.
* platform/gtk/fast/regions/multiple-directionality-changes-in-variable-width-regions-expected.txt: Rebaseline after r174233.
* platform/gtk/fast/regions/repaint/line-flow-with-floats-in-regions-expected.txt: Rebaseline after r174233.
* platform/gtk/fast/repaint/line-flow-with-floats-1-expected.txt: Rebaseline after r174233.
* platform/gtk/fast/repaint/line-flow-with-floats-10-expected.txt: Rebaseline after r174233.
* platform/gtk/fast/repaint/line-flow-with-floats-2-expected.txt: Rebaseline after r174233.
* platform/gtk/fast/repaint/line-flow-with-floats-3-expected.txt: Rebaseline after r174233.
* platform/gtk/fast/repaint/line-flow-with-floats-4-expected.txt: Rebaseline after r174233.
* platform/gtk/fast/repaint/line-flow-with-floats-5-expected.txt: Rebaseline after r174233.
* platform/gtk/fast/repaint/line-flow-with-floats-6-expected.txt: Rebaseline after r174233.
* platform/gtk/fast/repaint/line-flow-with-floats-7-expected.txt: Rebaseline after r174233.
* platform/gtk/fast/repaint/line-flow-with-floats-8-expected.txt: Rebaseline after r174233.
* platform/gtk/fast/repaint/line-flow-with-floats-9-expected.txt: Rebaseline after r174233.
* platform/gtk/fast/text/justified-selection-at-edge-expected.txt: Rebaseline after r174233.
* platform/gtk/fast/text/justify-ideograph-leading-expansion-expected.txt: Rebaseline after r174233.
* platform/gtk/fast/text/justify-nbsp-expected.txt: Added. Rebaseline after r174233.
* platform/gtk/fast/text/trailing-white-space-2-expected.txt: Rebaseline after r174233.
* platform/gtk/tables/mozilla/marvin/x_tbody_align_justify-expected.txt: Rebaseline after r174233.
* platform/gtk/tables/mozilla/marvin/x_td_align_justify-expected.txt: Rebaseline after r174233.
* platform/gtk/tables/mozilla/marvin/x_tfoot_align_justify-expected.txt: Rebaseline after r174233.
* platform/gtk/tables/mozilla/marvin/x_th_align_justify-expected.txt: Rebaseline after r174233.
* platform/gtk/tables/mozilla/marvin/x_thead_align_justify-expected.txt: Rebaseline after r174233.
* platform/gtk/tables/mozilla/marvin/x_tr_align_justify-expected.txt: Rebaseline after r174233.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove RefPtrHashMap
https://bugs.webkit.org/show_bug.cgi?id=137200

Reviewed by Darin Adler.

Source/WTF:

HashMap now has all the features of the RefPtr specialization of HashMap
(which lived in RefPtrHashMap.h) and is in fact more efficient when moving
items into it. For instance:

For HashMap<RefPtr<Foo>, Bar> map:

RefPtr<Foo> foo = ...;
map.add(WTF::move(foo), Bar());

will now not cause a ref() / deref(), but will successfully move the item in
without churn. The same is true if foo.release() was used.

* WTF.vcxproj/WTF.vcxproj:
* WTF.vcxproj/WTF.vcxproj.filters:
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
Remove references to RefPtrHashMap.h.

* wtf/RefPtrHashMap.h: Removed.

* wtf/HashMap.h:
Remove #include of RefPtrHashMap.h and add inlineGet to match the interface
exposed by the RefPtrHashMap specialization.

Tools:

* TestWebKitAPI/Tests/WTF/HashMap.cpp:
(TestWebKitAPI::TEST):
Add tests for using a HashMap with RefPtr keys, focusing on ensuring that
a minimum of refcount churn occurs.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174268 268f45cc-cd09-0410-ab3c-d52691b4dbfc
TextRun::length() should return an unsigned
https://bugs.webkit.org/show_bug.cgi?id=137354

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2014-10-03
Reviewed by Antti Koivisto.

Currently, the m_len instance variable that backs the TextRun::length() function is
an unsigned, but the length() function implicitly casts that to an int when
returning it. This patch makes the function return an unsigned, and makes the
do any casting if necessary.

No new tests because there is no behavior change.

* platform/graphics/Font.cpp:
(WebCore::Font::drawText): Cast result to int.
(WebCore::Font::drawEmphasisMarks): Ditto.
(WebCore::Font::adjustSelectionRectForText): Ditto.
(WebCore::computeUnderlineType): Update internal type to be unsigned.
* platform/graphics/GlyphBuffer.h:
(WebCore::GlyphBuffer::add): Update sentinel value to be unsigned.
(WebCore::GlyphBuffer::saveOffsetsInString): Ditto.
* platform/graphics/GraphicsContext.cpp: Update internal type to be unsigned.
* platform/graphics/TextRun.h:
(WebCore::TextRun::length): Update return type.
(WebCore::TextRun::charactersLength): Ditto.
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::advanceInternal): Cast result to int.
* rendering/svg/SVGTextMetricsBuilder.cpp:
(WebCore::SVGTextMetricsBuilder::currentCharacterStartsSurrogatePair): Remove
unnecessary casts.
(WebCore::SVGTextMetricsBuilder::advance): Ditto.
* svg/SVGFontData.cpp:
(WebCore::SVGFontData::applySVGGlyphSelection): Cast result to int.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174269 268f45cc-cd09-0410-ab3c-d52691b4dbfc
EventSender dispatches should be per-Document
https://bugs.webkit.org/show_bug.cgi?id=136051

Reviewed by Andreas Kling.

EventSender uses a Timer to asynchronously dispatch the same event to multiple
elements of the same type on a future run loop. However, we previously dispatched events
to elements from any Document rather than the one that requested the event send.

This patch changes EventSender to be associated with a single Document. EventSenders
for each Document are lazily allocated. Further per-Document or global optimizations
are possible.

This change also lays the groundwork for making EventSender-related DOM events
deterministic during web replay, tracked at <https://webkit.org/b/137090>.

No new tests, covered by fast/text/svg-font-trigger-load-event.html.

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMAllInOne.cpp:
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::implicitClose):
Dispatch pending events for this document only. Rename local variable f to frame.

* dom/Document.h:
(WebCore::Document::sharedEventSenders):
* dom/EventSender.h:
(WebCore::EventSender::EventSender):
(WebCore::EventSender::hasPendingEvents):
(WebCore::EventSender<T>::dispatchEventSoon):
(WebCore::EventSender<T>::cancelEvent):
(WebCore::EventSender<T>::dispatchPendingEvents):
(WebCore::EventSender<T>::EventSender): Deleted. The type argument was not necessary.
* dom/SharedEventSenders.cpp: Added. Lazily creates event senders as they are requested.
(WebCore::SharedEventSenders::linkLoadEventSender):
(WebCore::SharedEventSenders::styleLoadEventSender):
(WebCore::SharedEventSenders::imageBeforeloadEventSender):
(WebCore::SharedEventSenders::imageLoadEventSender):
(WebCore::SharedEventSenders::imageErrorEventSender):
* dom/SharedEventSenders.h: Added.
(WebCore::SharedEventSenders::SharedEventSenders):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::~HTMLLinkElement):
(WebCore::HTMLLinkElement::dispatchPendingEvent):
(WebCore::HTMLLinkElement::notifyLoadedSheetAndAllCriticalSubresources):
(WebCore::linkLoadEventSender): Deleted.
(WebCore::HTMLLinkElement::dispatchPendingLoadEvents): Deleted.
* html/HTMLLinkElement.h:
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::~HTMLStyleElement):
(WebCore::HTMLStyleElement::dispatchPendingEvent):
(WebCore::HTMLStyleElement::notifyLoadedSheetAndAllCriticalSubresources):
(WebCore::styleLoadEventSender): Deleted.
(WebCore::HTMLStyleElement::dispatchPendingLoadEvents): Deleted.
* html/HTMLStyleElement.h:
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::beforeLoadEventSender):
(WebCore::ImageLoader::loadEventSender):
(WebCore::ImageLoader::errorEventSender):
(WebCore::ImageLoader::dispatchPendingEvent):
(WebCore::beforeLoadEventSender): Deleted.
(WebCore::loadEventSender): Deleted.
(WebCore::errorEventSender): Deleted.
(WebCore::ImageLoader::dispatchPendingBeforeLoadEvents): Deleted.
(WebCore::ImageLoader::dispatchPendingLoadEvents): Deleted.
(WebCore::ImageLoader::dispatchPendingErrorEvents): Deleted.
* loader/ImageLoader.h:
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::append): Remove an early call to the EventSender for image
beforeload events. This was a performance optimization, but is no longer safe since the
document (and thus the event sender) may not be available in a synchronous document write.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174270 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Support modern for loops over StringViews
https://bugs.webkit.org/show_bug.cgi?id=137165

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2014-10-03
Reviewed by Darin Adler.

This patch adds two functions, codePoints() and codeUnits(), on StringView.
These two functions return small objects which have begin() and end() functions,
which means it can be used by the modern for loop style. This small class also
has an inner iterator class which can be incremented, dereferenced, and
compared.

Using these new objects looks like this:
for (UChar codeunit : stringView.codeUnits()) { } and
for (UChar32 codepoint : stringView.codePoints()) { }.

* wtf/text/StringView.h:
(WTF::StringView::codepoints):
(WTF::StringView::codeunits):
(WTF::StringViewCodePointIterator::StringViewCodePointIterator):
(WTF::StringViewCodePointIterator::Iterator::Iterator):
(WTF::StringViewCodePointIterator::Iterator::operator*):
(WTF::StringViewCodePointIterator::Iterator::operator!=):
(WTF::StringViewCodeUnitIterator::StringViewCodeUnitIterator):
(WTF::StringViewCodeUnitIterator::Iterator::Iterator):
(WTF::StringViewCodeUnitIterator::Iterator::operator*):
(WTF::StringViewCodeUnitIterator::Iterator::operator!=):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174271 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix.

Fixing the Windows build after r174269.

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2014-10-03

* platform/graphics/win/UniscribeController.cpp:
(WebCore::UniscribeController::shapeAndPlaceItem):

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