[WinCairo] Compile error in OpenTypeMathData.cpp.
https://bugs.webkit.org/show_bug.cgi?id=135541

Patch by peavo@outlook.com <peavo@outlook.com> on 2014-08-04
Reviewed by Brent Fulgham.

The SharedBuffer class needs to be defined.
Also, the OpenTypeMathData constructor should be implemented when OPENTYPE_MATH is not enabled.

* platform/graphics/opentype/OpenTypeMathData.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171989 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed EFL gardening

* platform/efl/TestExpectations: Add or update test expectations for failing tests.
* platform/efl/fast/text/international/cjk-segmentation-expected.txt: Added.
* platform/efl/js/dom/global-constructors-attributes-expected.txt: Rebaseline after r167632.
* platform/efl/sputnik/Unicode/Unicode_320/S7.6_A2.2_T2-expected.txt: Added.
* platform/efl/sputnik/Unicode/Unicode_320/S7.6_A5.2_T8-expected.txt: Added.
* platform/efl/svg/text/non-bmp-positioning-lists-expected.png: Rebaseline after r168350 and r168543.
* platform/efl/svg/text/non-bmp-positioning-lists-expected.txt: Ditto.
* platform/efl/transforms/2d/hindi-rotated-expected.txt: Fix baseline.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171990 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Install all unstable webkitdom headers
https://bugs.webkit.org/show_bug.cgi?id=135544

Reviewed by Gustavo Noronha Silva.

We were checking whether generated file existed before they had
been generated.

* PlatformGTK.cmake: Add Unstable.h header for all stable classes
to GObjectDOMBindingsUnstable_INSTALLED_HEADERS and split the
install command for stable and unstable headers making unstable
headers optional.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171991 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MSE] Seeking occasionally causes many frames to be displayed in "fast forward" mode
https://bugs.webkit.org/show_bug.cgi?id=135422

Reviewed by Eric Carlson.

When a seek is pending, but samples for the new time is not yet present in the SourceBuffer,
the SourceBufferPrivate may signal that it's ready for new samples through the
sourceBufferPrivateDidBecomeReadyForMoreSamples() method. In this situation, we should not
continue to provideMediaData(), as that will append samples from the prior-to-seeking media
timeline. Since the timeline may have moved forward due to the seek, a decoder may decide to
display those frames as quickly as possible (the "fast forward" behavior) in order to catch
up to the new current time.

If a re-enqueue is pending, don't provide media data in response to being notified that the
SourceBufferPrivate is ready for more samples. Wait until samples for the new current time
are appended.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples):
* dom/Document.cpp:
(WebCore::Document::unregisterCollection):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171992 268f45cc-cd09-0410-ab3c-d52691b4dbfc
QuickLook resources are cache-replaced with their original binary data causing ASSERT(m_data->size() == newBuffer->size()) in CachedResource.cpp
https://bugs.webkit.org/show_bug.cgi?id=135548
<rdar://problem/17891321>

Reviewed by David Kilzer.

When loading QuickLook resources, the SharedBuffer in the CachedResource is actually a
converted representation of the real QuickLook resource. Replacing this with the actual
network resource (which is what tryReplaceEncodedData() tried to do) is wrong and triggered
asserts in the code.

Fix this by having CachedRawResource::mayTryReplaceEncodedData() return false if we are
loading a QuickLook resource.

No new tests because we don't have a way to test QuickLook documents.

* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::ResourceLoader):
(WebCore::ResourceLoader::didCreateQuickLookHandle):
    Set a flag to indicate that we are loading a QuickLook document.
* loader/ResourceLoader.h:
(WebCore::ResourceLoader::isQuickLookResource):
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::CachedRawResource):
(WebCore::CachedRawResource::finishLoading):
    Check if we were loading a QuickLook document and if so disable encoded data
    replacement.
* loader/cache/CachedRawResource.h:
    Add a new bool field returned by mayTryReplaceEncodedData(). Default is true but it is
    set to false in finishLoading() if we were loading QuickLook document.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171993 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: The Dictation command "Replace <phrase> with <phrase>" always capitalizes the replacement string
https://bugs.webkit.org/show_bug.cgi?id=135557

Reviewed by Mario Sanchez Prada.

Source/WebCore:
When replacing text, we should match the capitalization of the word being replaced
(unless the replacement looks like an abbreviation).

Test: platform/mac/accessibility/find-and-replace-match-capitalization.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::selectText):

LayoutTests:
* platform/mac/accessibility/find-and-replace-match-capitalization-expected.txt: Added.
* platform/mac/accessibility/find-and-replace-match-capitalization.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171994 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MSE] Re-enqueing due to overlapping appended samples can cause stuttering playback
https://bugs.webkit.org/show_bug.cgi?id=135424

Reviewed by Eric Carlson.

If it become necessary to re-enqueue samples (due to appending overlapping samples which cause
existing samples to be removed), the previous behavior was to flush and re-enqueue the new
samples dependencies; i.e., everything up to and including the previous sync sample. This causes
the decoder to visibly stall while it decodes those non-displaying samples, which could be
a second or more worth of encoded video samples, depending on the frequency of sync samples.

Instead, when we are asked to re-enqueue, we will look for the next occurring sync sample.
If found, we can switch over to the replacement samples at that point in the decode queue.
This limits the overhead of a stream switch, and should allow for a visually seamless switch,
at the cost of having to wait for the next sync sample to occur to affect the switch.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::seekToTime): Clear the decode queue when seeking.
(WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): Call reenqueueMediaForCurrentTime.
(WebCore::SourceBuffer::reenqueueMediaForCurrentTime): Switch over to the new stream only
    at the next sync sample.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171995 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: AXSelectTextWithCriteriaParameterizedAttribute incorrectly selects the beginning letters of a word
https://bugs.webkit.org/show_bug.cgi?id=135547

Reviewed by Mario Sanchez Prada.

Source/WebCore:
Allow text search to specify that it wants to match end of words as well as start of words.
This allows select text criteria to match on whole words only.

Test: platform/mac/accessibility/select-text-should-match-whole-words.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection):
* editing/FindOptions.h:
* editing/TextIterator.cpp:
(WebCore::SearchBuffer::isWordEndMatch):
(WebCore::SearchBuffer::search):

LayoutTests:
* platform/mac/accessibility/select-text-should-match-whole-words-expected.txt: Added.
* platform/mac/accessibility/select-text-should-match-whole-words.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: SelectText functionality always selects text after current selection even if closer selection is behind it
https://bugs.webkit.org/show_bug.cgi?id=135546

Reviewed by Mario Sanchez Prada.

Source/WebCore:
Logic was incorrect for comparing ranges found before the current selection.
ASSERT was incorrect for allowed ranges. We need to allow ranges that are right at the boundaries of our found ranges.

Extended existing test: platform/mac/accessibility/select-text.html

* accessibility/AccessibilityObject.cpp:
(WebCore::rangeClosestToRange):

LayoutTests:
* platform/mac/accessibility/select-text-expected.txt:
* platform/mac/accessibility/select-text.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171997 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: All-caps CSS properties are not shown in Computed pane
https://bugs.webkit.org/show_bug.cgi?id=133700

Patch by Matt Baker <mattbaker@apple.com> on 2014-08-04
Reviewed by Timothy Hatcher.

* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::styleWithProperties):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171999 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MSE] Further fixes for "fast forward" playback after seeking in YouTube behavior.
https://bugs.webkit.org/show_bug.cgi?id=135572

Reviewed by Eric Carlson.

Two related fixes:

In reenqueueMediaForTime(), update TrackBuffer.lastEnqueuedPresentationTime when we flush samples, so that
the next time samples are re-enqueued, the starting point for re-enqueueing is correct.

In sourceBufferPrivateDidReceiveSample(), do not add samples to the decode queue if they are before the
current media time.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
(WebCore::SourceBuffer::reenqueueMediaForTime):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172000 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: Secure text fields need to support Search parameterized attributes
https://bugs.webkit.org/show_bug.cgi?id=135568

Reviewed by Mario Sanchez Prada.

Source/WebCore: 
 
Secure text fields still need to support the fast searching that WebKit exposes, even though they don't support
other parameterized attributes.
  
Test: platform/mac/accessibility/secure-text-field-supports-fast-search.html

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityParameterizedAttributeNames]):

LayoutTests: 

* platform/mac/accessibility/secure-text-field-supports-fast-search-expected.txt: Added.
* platform/mac/accessibility/secure-text-field-supports-fast-search.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172002 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: isWordEndMatch should allow for multiple word selections
https://bugs.webkit.org/show_bug.cgi?id=135573

Reviewed by Mario Sanchez Prada.


Source/WebCore: 
isWordEndMatch was searching from the beginning of the selected range, which meant
that if the result was multiple words, we'd reject the result. 
Instead, we should search from the end of the range, so that we encompass all words.

Modified existing test: platform/mac/accessibility/select-text-should-match-whole-words.html

* editing/TextIterator.cpp:
(WebCore::SearchBuffer::isWordEndMatch):

LayoutTests: 
* platform/mac/accessibility/select-text-should-match-whole-words-expected.txt:
* platform/mac/accessibility/select-text-should-match-whole-words.html:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Always clear ConsoleClient when Page/WindowShell is destroyed
https://bugs.webkit.org/show_bug.cgi?id=135569

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-08-04
Reviewed by Mark Lam.

* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::~ScriptController):
Whenever a window shell goes away, clear the console client.
We did this in clearWindowShell but not before destroying.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172006 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r171992, r171995, & r172000.

The cumulative effect of those revisions was to cause decoding errors when switching resolutions on YouTube.

Reverted changesets:

https://bugs.webkit.org/show_bug.cgi?id=135422 / http://trac.webkit.org/changeset/171992
https://bugs.webkit.org/show_bug.cgi?id=135424 / http://trac.webkit.org/changeset/171995
https://bugs.webkit.org/show_bug.cgi?id=135572 / http://trac.webkit.org/changeset/172000

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172007 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Subpixel rendering: InlineTextBox mistakenly rounds offset value before painting.
https://bugs.webkit.org/show_bug.cgi?id=135470

Reviewed by Simon Fraser.

This patch removes the premature paint offset adjustment for inlines. Premature snapping
could alter the final painting coordinates and push content to wrong positions.

This patch also enforces WebCore's pixel snapping strategy (round) on text painting.
It ensures that text positioning is in sync with other painting related operations including
clipping, box decorations etc. Underlying graphics libraries can take different directions on
text snapping, for example CG ceils text coordinates vertically (in horizontal context,
with the current settings). It can lead to undesired side effects.

Source/WebCore:
Test: fast/inline/hidpi-inline-selection-leaves-gap.html

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects): wrong direction used at r171896.
* rendering/SimpleLineLayoutFunctions.cpp: we don't paint vertical content here.
(WebCore::SimpleLineLayout::paintFlow):

LayoutTests:
* fast/inline/hidpi-inline-selection-leaves-gap-expected.html: Added.
* fast/inline/hidpi-inline-selection-leaves-gap.html: Added.
* fast/multicol/newmulticol/multicol-clip-rounded-corners-expected.html:
* fast/multicol/newmulticol/multicol-clip-rounded-corners.html: pixels are distributed properly.
No need to have the special 122px shortened width for col2.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172008 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Create a more generic way for VMEntryScope to notify those interested that it will be destroyed
https://bugs.webkit.org/show_bug.cgi?id=135358

Patch by Saam Barati <sbarati@apple.com> on 2014-08-04
Reviewed by Geoffrey Garen.

When VMEntryScope is destroyed, and it has a flag set indicating that the
Debugger needs to recompile all functions, it calls Debugger::recompileAllJSFunctions.
This flag is only used by Debugger to have VMEntryScope notify it when the
Debugger is safe to recompile all functions. This patch will substitute this
Debugger-specific recompilation flag with a list of callbacks that are notified
when the outermost VMEntryScope dies. This creates a general purpose interface
for being notified when the VM stops executing code via the event of the outermost
VMEntryScope dying.

* debugger/Debugger.cpp:
(JSC::Debugger::recompileAllJSFunctions):
* runtime/VMEntryScope.cpp:
(JSC::VMEntryScope::VMEntryScope):
(JSC::VMEntryScope::addEntryScopeDidPopListener):
(JSC::VMEntryScope::~VMEntryScope):
* runtime/VMEntryScope.h:
(JSC::VMEntryScope::setRecompilationNeeded): Deleted.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172009 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes] shape-margin not respected when it extends beyond an explicitly set margin
https://bugs.webkit.org/show_bug.cgi?id=135308

Reviewed by Dean Jackson.

Source/WebCore:
When a zero height line is supplied and the image shape extends into
the margin box (only possible when a shape-margin is supplied), then
only an empty interval was being returned. This patch makes it
properly return the interval for the line in question.

Test: fast/shapes/shape-outside-floats/shape-outside-image-shape-margin.html

* rendering/shapes/RasterShape.cpp:
(WebCore::RasterShape::getExcludedIntervals): Handle the zero height
line case.

LayoutTests:
Test case based on the one supplied by Rebecca Hauck in the bug
report.

* fast/shapes/resources/square.png: Added.
* fast/shapes/shape-outside-floats/shape-outside-image-shape-margin-expected.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-image-shape-margin.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172010 268f45cc-cd09-0410-ab3c-d52691b4dbfc
lldb_webkit.py throws exception when generating summary of null StringImpl
https://bugs.webkit.org/show_bug.cgi?id=129448

Patch by Matt Baker <mattbaker@apple.com> on 2014-08-04
Reviewed by Jer Noble.

Added checks for null StringImpl and 0 byte ReadMemory calls.

* lldb/lldb_webkit.py:
(WTFStringImpl_SummaryProvider):
(ustring_to_string):
(lstring_to_string):
(WTFStringImplProvider.to_string):
(WTFStringImplProvider.is_initialized):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172012 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Selection services menu dropdown is in the wrong place when selecting some text on Yelp
https://bugs.webkit.org/show_bug.cgi?id=135582
<rdar://problem/17837636>

Reviewed by Simon Fraser.

* editing/SelectionRectGatherer.cpp:
(WebCore::SelectionRectGatherer::addRect):
(WebCore::SelectionRectGatherer::addGapRects):
(WebCore::SelectionRectGatherer::addRects): Deleted.
Rename addRects to addGapRects for clarity.
Map rects and gapRects to absolute RenderView coordinates so that
they are in a form WebKit2 can use. Previously they were sometimes
relative to a different repaint container, but that information was
lost when moving through SelectionRectGatherer.

Ideally we would keep selection rects as full quads instead of rects
for more of their life, but that problem is much deeper than just SelectionRectGatherer.

* editing/SelectionRectGatherer.h:
Add a comment clarifying the coordinate space of the stored selection rects.

* rendering/RenderView.cpp:
(WebCore::RenderView::applySubtreeSelection):
Rename addRects to addGapRects for clarity.


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