Avoid synchronous layout in window.scrollTo(0,0) when already at (0,0)
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-06-17  Andreas Kling  <akling@apple.com>
2
3         Avoid synchronous layout in window.scrollTo(0,0) when already at (0,0)
4         <https://webkit.org/b/133893>
5
6         Going from 0,0 to 0,0 is a no-op since there is no way a layout will
7         affect the current scroll position.
8
9         We don't send scroll events when moving to the previous position,
10         so this change is not observable.
11
12         Reviewed by Anders Carlsson.
13
14         * page/DOMWindow.cpp:
15         (WebCore::DOMWindow::scrollTo):
16
17 2014-06-17  Alex Christensen  <achristensen@webkit.org>
18
19         Fix css jit register usage on armv7.
20         https://bugs.webkit.org/show_bug.cgi?id=133952
21
22         Reviewed by Benjamin Poulain.
23
24         * cssjit/RegisterAllocator.h:
25         List r7 as a callee saved register, which it is.
26         * cssjit/SelectorCompiler.cpp:
27         (WebCore::SelectorCompiler::SelectorCodeGenerator::generatePrologue):
28         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateEpilogue):
29         Save r6, which is used as a temporary register and must be preserved.
30
31 2014-06-17  Miyoung Shin  <myid.shin@samsung.com>
32
33         Use references instead of pointers to RenderBlock in enclosingBoxModelObject()
34         https://bugs.webkit.org/show_bug.cgi?id=133978
35
36         Reviewed by Andreas Kling.
37
38         Just a straightforward conversion from pointers to references.
39
40         No new tests, no behavior change.
41
42         * rendering/InlineFlowBox.cpp:
43         (WebCore::InlineFlowBox::paint):
44         * rendering/RenderBlock.cpp:
45         (WebCore::RenderBlock::paintObject):
46         * rendering/RenderObject.cpp:
47         (WebCore::RenderObject::enclosingBoxModelObject):
48         * rendering/RenderObject.h:
49
50 2014-06-17  Zan Dobersek  <zdobersek@igalia.com>
51
52         Cache the gst_query_get_n_buffering_ranges() return value for the for-loop conditional
53         https://bugs.webkit.org/show_bug.cgi?id=133953
54
55         Reviewed by Philippe Normand.
56
57         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
58         (WebCore::MediaPlayerPrivateGStreamer::buffered): Avoid the extra call in the for-loop
59         conditional expression by caching the return value of gst_query_get_n_buffering_ranges().
60
61 2014-06-17  Zan Dobersek  <zdobersek@igalia.com>
62
63         Avoid Vector<char> copies in the OffsetBuffer constructor
64         https://bugs.webkit.org/show_bug.cgi?id=133956
65
66         Reviewed by Andreas Kling.
67
68         * xml/parser/XMLDocumentParserLibxml2.cpp:
69         (WebCore::OffsetBuffer::OffsetBuffer): Take the Vector parameter by value and
70         move it into the member variable.
71         (WebCore::openFunc): Move the Vector object into the OffsetBuffer constructor.
72
73 2014-06-17  Jer Noble  <jer.noble@apple.com>
74
75         [MSE] Overwritten samples are removed from buffered ranges using decode times; added samples using presentation times
76         https://bugs.webkit.org/show_bug.cgi?id=133959
77
78         Reviewed by Eric Carlson.
79
80         Test: media/media-source/media-source-overlapping-append-buffered.html
81
82         Explicitly call presentationTime() on removed samples, rather than implicitly asking for the iterator's "first"
83         member. When iterating over samples, "first" can either be presentation time, or decode time, depending on which
84         iteration method is called. In the case of removing samples, this was using the decode time incorrectly.
85
86         * Modules/mediasource/SourceBuffer.cpp:
87         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
88
89 2014-06-16  Mihnea Ovidenie  <mihnea@adobe.com>
90
91         [CSSRegions] Region with border radius and overflow:hidden does not clip content
92         https://bugs.webkit.org/show_bug.cgi?id=133476
93
94         Reviewed by Andrei Bucur.
95
96         When setting the clip before painting the named flow content,
97         use the region's foreground rect to take the region's border radius
98         into account if needed.
99
100         Test: fast/regions/region-border-radius-overflow-clip.html
101
102         * rendering/RenderLayer.cpp:
103         (WebCore::RenderLayer::paintFlowThreadIfRegionForFragments):
104
105 2014-06-16  Sam Weinig  <sam@webkit.org>
106
107         Extract prototype declaration generation into a helper function
108         https://bugs.webkit.org/show_bug.cgi?id=133969
109
110         Reviewed by Dan Bernstein.
111
112         * bindings/scripts/CodeGeneratorJS.pm:
113         (GenerateHeader):
114         (GeneratePrototypeDeclaration):
115
116 2014-06-16  Sam Weinig  <sam@webkit.org>
117
118         Move forward declaration of bindings static functions into their implementation files
119         https://bugs.webkit.org/show_bug.cgi?id=133943
120
121         Reviewed by Geoffrey Garen.
122
123         - Moves the forward declaration of static functions for generated files to the implementation.
124         - Adds a new extended attribute, ForwardDeclareInHeader, for functions that still need a 
125           forward declaration in the header.
126
127         * bindings/js/JSDOMBinding.h:
128         (WebCore::nonCachingStaticFunctionGetter):
129         Move this helper here from JSDOMWindowCustom.cpp.
130
131         * bindings/js/JSDOMWindowCustom.cpp:
132         (WebCore::JSDOMWindow::getOwnPropertySlot):
133         Switch to comparing the property name directly rather than looking up in the static table and
134         comparing function pointers.
135
136         * bindings/js/JSHistoryCustom.cpp:
137         (WebCore::JSHistory::getOwnPropertySlotDelegate):
138         Switch to comparing the property name directly rather than looking up in the static table and
139         comparing function pointers and start using the nonCachingStaticFunctionGetter<> helper.
140
141         * bindings/js/JSLocationCustom.cpp:
142         (WebCore::JSLocation::getOwnPropertySlotDelegate):
143         (WebCore::JSLocation::putDelegate):
144         Switch to comparing the property name directly rather than looking up in the static table and
145         comparing function pointers and start using the nonCachingStaticFunctionGetter<> helper.
146
147         * bindings/scripts/CodeGeneratorJS.pm:
148         (GenerateHeader):
149         (GenerateImplementation):
150         Move forward declaration creation to the implementation file where possible.
151
152         * bindings/scripts/IDLAttributes.txt:
153         Add ForwardDeclareInHeader.
154
155         * page/DOMWindow.idl:
156         * page/History.idl:
157         * page/Location.idl:
158         Add ForwardDeclareInHeader where necessary.
159
160 2014-06-16  Jaehun Lim  <ljaehun.lim@samsung.com>
161
162         Unreviewed build fix after r170029
163
164         Use String() instead of AtomicString().
165
166         * platform/network/HTTPParsers.cpp:
167         (WebCore::parseHTTPHeader):
168         * platform/network/soup/ResourceRequestSoup.cpp:
169         (WebCore::ResourceRequest::updateSoupMessageHeaders):
170         * platform/network/soup/ResourceResponseSoup.cpp:
171         (WebCore::ResourceResponse::toSoupMessage):
172
173 2014-06-16  Brent Fulgham  <bfulgham@apple.com>
174
175         [Win] Use TileController on Windows
176         https://bugs.webkit.org/show_bug.cgi?id=133895
177
178         Reviewed by Tim Horton.
179
180         * WebCore.vcxproj/WebCore.vcxproj: Add Tiled Drawing files.
181         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
182         * platform/graphics/TiledBacking.h: No longer Cocoa-only.
183         * platform/graphics/ca/GraphicsLayerCA.cpp:
184         (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer): Windows
185         now uses the same layer type as Mac.
186         * platform/graphics/ca/LayerPool.cpp:
187         (WebCore::LayerPool::takeLayerWithSize): Use nullptr
188         rather than nil for C++ code.
189         * platform/graphics/ca/PlatformCALayer.cpp:
190         * platform/graphics/ca/PlatformCALayer.h: Expose necessary
191         drawing functions for Windows port.
192         * platform/graphics/ca/TileController.cpp: Remove unneeded
193         header include for WebLayer.
194         * platform/graphics/ca/TileCoverageMap.cpp: Correct #includes.
195         * platform/graphics/ca/TileGrid.h: Not just for Cococa.
196         * platform/graphics/ca/mac/PlatformCALayerMac.mm: Remove
197         extra whitespace.
198         * platform/graphics/ca/mac/PlatformCALayerMac.h: Remove
199         unneeded overload.
200         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
201         (PlatformCALayer::collectRectsToPaint): Added stub.
202         (PlatformCALayer::drawLayerContents): Added.
203         (PlatformCALayer::frameForLayer): Added.
204         (PlatformCALayerWin::PlatformCALayerWin): Remove unneeded
205         assert now that we support these types. Add TileController
206         support.
207         (PlatformCALayerWin::setEdgeAntialiasingMask): Added.
208         (printLayer): Add newly-supported tile types.
209         (PlatformCALayerWin::tiledBacking): Added.
210         * platform/graphics/ca/win/PlatformCALayerWin.h: Update to
211         support Tiled Drawing.
212         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
213         (PlatformCALayerWinInternal::PlatformCALayerWinInternal): Update to
214         recognize newly-supported layer types.
215         (PlatformCALayerWinInternal::setNeedsDisplay): Ditto.
216         (PlatformCALayerWinInternal::setSublayers): Ditto.
217         (PlatformCALayerWinInternal::getSublayers): Ditto.
218         (PlatformCALayerWinInternal::removeAllSublayers): Ditto.
219         (PlatformCALayerWinInternal::insertSublayer): Ditto.
220         (PlatformCALayerWinInternal::sublayerCount): Ditto.
221         (PlatformCALayerWinInternal::indexOfSublayer): Ditto.
222         (PlatformCALayerWinInternal::sublayerAtIndex): Ditto.
223         (PlatformCALayerWinInternal::setBounds): Ditto.
224         (PlatformCALayerWinInternal::setFrame): Ditto.
225         (PlatformCALayerWinInternal::drawTile): Ditto.
226         (PlatformCALayerWinInternal::createTileController): Ditto.
227         (PlatformCALayerWinInternal::tiledBacking): Ditto.
228         * platform/graphics/ca/win/PlatformCALayerWinInternal.h: Update to use
229         TileController.
230
231 2014-06-16  Andreas Kling  <akling@apple.com>
232
233         Remove unnecessary style invalidation in RenderTextControl::styleDidChange().
234         <https://webkit.org/b/133949>
235
236         This explicit invalidation of the text control's inner text element
237         was hacked in to fix an editing test back in 2011, long before lazy
238         render tree construction.
239
240         It should be safe to remove, since doing so doesn't affect any tests.
241
242         Reviewed by Antti Koivisto.
243
244         * rendering/RenderTextControl.cpp:
245         (WebCore::RenderTextControl::styleDidChange):
246
247 2014-06-16  Anders Carlsson  <andersca@apple.com>
248
249         Fix iOS build.
250
251         * platform/network/cf/ResourceRequestCFNet.cpp:
252         (WebCore::setHeaderFields):
253
254 2014-06-16  Anders Carlsson  <andersca@apple.com>
255
256         Accept-Ranges is not specific to GStreamer.
257
258         * platform/network/HTTPHeaderNames.in:
259
260 2014-06-16  Anders Carlsson  <andersca@apple.com>
261
262         Don't use AtomicString in HTTPHeaderMap
263         https://bugs.webkit.org/show_bug.cgi?id=133957
264         <rdar://problem/15256572>
265
266         Reviewed by Andreas Kling.
267
268         Use the string data that comes from the generated HTTPHeaderNames.cpp file
269         for sharing header name data instead. In the future we can do something more fancy where
270         we'll hash the HTTPHeaderName enum directly, but this is good enough for now.
271
272         * Modules/websockets/WebSocketHandshake.cpp:
273         (WebCore::WebSocketHandshake::readHTTPHeaders):
274         * WebCore.exp.in:
275         * inspector/InspectorResourceAgent.cpp:
276         (WebCore::buildObjectForHeaders):
277         * loader/CrossOriginPreflightResultCache.cpp:
278         (WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginHeaders):
279         * loader/appcache/ApplicationCacheStorage.cpp:
280         (WebCore::parseHeader):
281         * loader/cache/CachedResource.cpp:
282         (WebCore::shouldUpdateHeaderAfterRevalidation):
283         * platform/network/HTTPHeaderMap.cpp:
284         (WebCore::HTTPHeaderMap::copyData):
285         (WebCore::internHTTPHeaderNameString):
286         (WebCore::HTTPHeaderMap::get):
287         (WebCore::HTTPHeaderMap::set):
288         (WebCore::HTTPHeaderMap::add):
289         (WebCore::CaseFoldingCStringTranslator::hash): Deleted.
290         (WebCore::CaseFoldingCStringTranslator::equal): Deleted.
291         (WebCore::CaseFoldingCStringTranslator::translate): Deleted.
292         * platform/network/HTTPHeaderMap.h:
293         * platform/network/HTTPHeaderNames.in:
294         * platform/network/HTTPParsers.cpp:
295         (WebCore::parseHTTPHeader):
296         * platform/network/HTTPParsers.h:
297         * platform/network/ResourceRequestBase.cpp:
298         (WebCore::ResourceRequestBase::httpHeaderField):
299         (WebCore::ResourceRequestBase::setHTTPHeaderField):
300         (WebCore::ResourceRequestBase::addHTTPHeaderField):
301         * platform/network/ResourceRequestBase.h:
302         * platform/network/ResourceResponseBase.cpp:
303         (WebCore::ResourceResponseBase::httpHeaderField):
304         (WebCore::ResourceResponseBase::setHTTPHeaderField):
305         (WebCore::ResourceResponseBase::addHTTPHeaderField):
306         * platform/network/ResourceResponseBase.h:
307         * platform/network/mac/ResourceRequestMac.mm:
308         (WebCore::ResourceRequest::doUpdateResourceRequest):
309         * platform/network/mac/ResourceResponseMac.mm:
310         (WebCore::ResourceResponse::platformLazyInit):
311         * xml/XMLHttpRequest.cpp:
312         (WebCore::XMLHttpRequest::setRequestHeader):
313         (WebCore::XMLHttpRequest::setRequestHeaderInternal):
314         (WebCore::XMLHttpRequest::getRequestHeader):
315         (WebCore::XMLHttpRequest::getResponseHeader):
316         * xml/XMLHttpRequest.h:
317
318 2014-06-16  Chris Fleizach  <cfleizach@apple.com>
319
320         AX: Safari crashed once in WebCore::AccessibilityObject::ariaIsHidden
321         https://bugs.webkit.org/show_bug.cgi?id=133825
322
323         Reviewed by Enrica Casucci.
324
325         Sometimes asking accessibilityIsIgnored() will cause a newObject to be detached immediately after its created. 
326         The creation function holds a reference with RefPtr as long as it lives, but when that method returns, the object goes away.
327
328         With that out of the way, I saw the same backtrace lead to updateLayoutIgnorePendingStylesheets being called while still inLayout.
329
330         I tried my best but could not create a reproducible layout test.
331
332         * accessibility/AXObjectCache.cpp:
333         (WebCore::AXObjectCache::getOrCreate):
334         * accessibility/AccessibilityObject.cpp:
335         (WebCore::AccessibilityObject::updateBackingStore):
336
337 2014-06-16  Zan Dobersek  <zdobersek@igalia.com>
338
339         Unreviewed. Add more GStreamer-specific header names that are required
340         after changes in r170021, fixing the build for ports using GStreamer.
341
342         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
343         (StreamingClient::handleResponseReceived):
344         * platform/network/HTTPHeaderNames.in:
345
346 2014-06-16  Chris Fleizach  <cfleizach@apple.com>
347
348         AX: Crash at WebCore::AXObjectCache::textChanged
349         https://bugs.webkit.org/show_bug.cgi?id=133873
350
351         Reviewed by Enrica Casucci.
352
353         This looks like a very similar problem to 
354         https://bugs.webkit.org/show_bug.cgi?id=133825
355
356         The object is being created and deallocated almost right away because calling accessibilityIsIgnored triggers
357         a deferred layout that invalidates the associated render element.
358
359         Despite my best efforts, I could not come up with a way to reproduce this in a layout test.
360
361         * accessibility/AXObjectCache.cpp:
362         (WebCore::AXObjectCache::getOrCreate):
363
364 2014-06-15  Anders Carlsson  <andersca@apple.com>
365
366         Change ResourceRequestBase::addHTTPHeaderFields to setHTTPHeaderFields instead
367         https://bugs.webkit.org/show_bug.cgi?id=133925
368
369         Reviewed by Sam Weinig.
370
371         * WebCore.exp.in:
372         * platform/network/ResourceRequestBase.cpp:
373         (WebCore::ResourceRequestBase::setHTTPHeaderFields):
374         (WebCore::ResourceRequestBase::addHTTPHeaderFields): Deleted.
375         * platform/network/ResourceRequestBase.h:
376         * plugins/PluginView.cpp:
377         (WebCore::PluginView::handlePost):
378         * xml/XMLHttpRequest.cpp:
379         (WebCore::XMLHttpRequest::createRequest):
380
381 2014-06-16  Jeongeun Kim  <je_julie.kim@samsung.com>
382
383         Use references instead of pointers to RenderBlock in RenderObject::enclosingBox().
384         https://bugs.webkit.org/show_bug.cgi?id=133902
385
386         Reviewed by Andreas Kling.
387
388         Just a straightforward conversion from pointers to references.
389
390         No new tests, no behavior change.
391
392         * bindings/objc/DOMUIKitExtensions.mm:
393         (-[DOMHTMLElement structuralComplexityContribution]):
394         * html/HTMLMediaElement.cpp:
395         (WebCore::HTMLMediaElement::parseAttribute):
396         * inspector/InspectorOverlay.cpp:
397         (WebCore::buildObjectForRendererFragments):
398         * page/EventHandler.cpp:
399         (WebCore::scrollNode):
400         (WebCore::EventHandler::scrollOverflow):
401         (WebCore::EventHandler::logicalScrollOverflow):
402         * page/FrameView.cpp:
403         (WebCore::FrameView::layout):
404         * rendering/RenderBox.cpp:
405         (WebCore::computeInlineStaticDistance):
406         * rendering/RenderFlowThread.cpp:
407         (WebCore::RenderFlowThread::computedRegionRangeForBox):
408         (WebCore::RenderFlowThread::objectShouldFragmentInFlowRegion):
409         (WebCore::RenderFlowThread::objectInFlowRegion):
410         * rendering/RenderLayer.cpp:
411         (WebCore::RenderLayer::calculateClipRects):
412         * rendering/RenderObject.cpp:
413         (WebCore::RenderObject::enclosingBox): Removed FIXME comment
414         * rendering/RenderObject.h:
415         * rendering/RenderScrollbar.cpp:
416         (WebCore::RenderScrollbar::owningRenderer):
417
418 2014-06-16  Anders Carlsson  <andersca@apple.com>
419
420         Use HTTPHeaderName in more places
421         https://bugs.webkit.org/show_bug.cgi?id=133948
422
423         Reviewed by Andreas Kling.
424
425         * loader/cache/CachedRawResource.cpp:
426         (WebCore::shouldIgnoreHeaderForCacheReuse):
427         * platform/network/HTTPHeaderNames.in:
428         * xml/XMLHttpRequest.cpp:
429         (WebCore::isSetCookieHeader):
430         (WebCore::isForbiddenRequestHeader):
431         (WebCore::XMLHttpRequest::isAllowedHTTPHeader):
432         (WebCore::XMLHttpRequestStaticData::XMLHttpRequestStaticData): Deleted.
433         (WebCore::staticData): Deleted.
434
435 2014-06-16  Anders Carlsson  <andersca@apple.com>
436
437         Add HTTPHeaderName overloads on ResourceResponseBase
438         https://bugs.webkit.org/show_bug.cgi?id=133946
439
440         Reviewed by Andreas Kling.
441
442         * WebCore.exp.in:
443         * dom/Document.cpp:
444         (WebCore::Document::lastModified):
445         * loader/CrossOriginAccessControl.cpp:
446         (WebCore::passesAccessControlCheck):
447         * loader/CrossOriginPreflightResultCache.cpp:
448         (WebCore::CrossOriginPreflightResultCacheItem::parse):
449         * loader/FrameLoader.cpp:
450         (WebCore::FrameLoader::receivedFirstData):
451         (WebCore::FrameLoader::didBeginDocument):
452         * loader/appcache/ApplicationCacheGroup.cpp:
453         (WebCore::ApplicationCacheGroup::createResourceHandle):
454         * loader/cache/CachedCSSStyleSheet.cpp:
455         (WebCore::CachedCSSStyleSheet::canUseSheet):
456         * loader/cache/CachedResource.cpp:
457         (WebCore::CachedResource::load):
458         * loader/cache/CachedScript.cpp:
459         (WebCore::CachedScript::mimeType):
460         * platform/network/HTTPHeaderNames.in:
461         * platform/network/ResourceResponseBase.cpp:
462         (WebCore::ResourceResponseBase::httpHeaderField):
463         (WebCore::ResourceResponseBase::setHTTPHeaderField):
464         * platform/network/ResourceResponseBase.h:
465         * xml/XMLHttpRequest.cpp:
466         (WebCore::XMLHttpRequest::getAllResponseHeaders):
467         (WebCore::XMLHttpRequest::getResponseHeader):
468         (WebCore::XMLHttpRequest::responseMIMEType):
469         (WebCore::XMLHttpRequest::didReceiveResponse):
470
471 2014-04-05  Antonio Gomes  <a1.gomes@sisa.samsung.com>
472
473         [Bindings] "nullable" sequence support is incomplete (i.e. sequence<NativeType>?)
474         https://bugs.webkit.org/show_bug.cgi?id=131240
475
476         Reviewed by Darin Adler.
477
478         Nullable sequences are not fully supported in WebKit's
479         code generator machinery. Although the generated code
480         does add "is nullable" check to the evaluation condition
481         (i.e. if (arg.isNull() || ...)), when the JSValue
482         that holds a "null" JSObject is actually to be "converted"
483         to a native Vector<T>, it fails.
484
485         The reason for the failure is in JSDOMBindings::toNativeArray.
486         This method verifies that JSValue does not hold a "non-null"
487         object, and it bails out.
488         Analogly, the "ref ptr" variant of this method (toRefPtrNativeArray)
489         does support nullables.
490
491         Patch fixes it be checking for a "null" JSValue check before hand.
492
493         Tests: Binding tests updated.
494
495         * bindings/js/JSDOMBinding.h:
496         (WebCore::toNativeArray):
497         * bindings/scripts/CodeGeneratorJS.pm:
498         (JSValueToNative):
499         * Modules/websocket/WebSocket.idl:
500         Removed one overload ctor now that
501         we can use nullable sequences.
502
503 2014-06-16  Jer Noble  <jer.noble@apple.com>
504
505         [MSE][Mac] Occasional image corruption after seeking
506         https://bugs.webkit.org/show_bug.cgi?id=133879
507
508         Reviewed by Eric Carlson.
509
510         Change the order of operations for seeks: change the current time of the AVSampleBufferRenderSynchronizer
511         before flushing and appending non-displaying samples.
512
513         Rather than having a single function which retrieves the fast seek time and then seeks, split this out
514         into two functions: one which gets the fast seek time, and one which seeks. (The later of course already
515         exists: seekToTime()).
516
517         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
518         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
519         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
520         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
521         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
522         (WebCore::MediaSourcePrivateAVFObjC::fastSeekTimeForMediaTime): Renamed from seekToTime()
523         (WebCore::MediaSourcePrivateAVFObjC::seekToTime): Deleted.
524
525 2014-06-16  Zan Dobersek  <zdobersek@igalia.com>
526
527         Have ScriptExecutionContext::Task functions take in a ScriptExecutionContext reference
528         https://bugs.webkit.org/show_bug.cgi?id=133795
529
530         Reviewed by Andreas Kling.
531
532         The pointer to the ScriptExecutionContext object that is passed to the C++11 lambdas or
533         helper functions wrapped in ScriptExecutionContext::Task is never null, so that parameter
534         should be a reference instead.
535
536         * Modules/webdatabase/Database.cpp:
537         (WebCore::Database::~Database):
538         (WebCore::Database::runTransaction):
539         (WebCore::Database::scheduleTransactionCallback):
540         * Modules/webdatabase/DatabaseManager.cpp:
541         (WebCore::DatabaseManager::openDatabase):
542         * Modules/webdatabase/SQLCallbackWrapper.h:
543         (WebCore::SQLCallbackWrapper::clear):
544         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
545         (WebCore::ThreadableWebSocketChannelClientWrapper::processPendingTasksCallback):
546         (WebCore::ThreadableWebSocketChannelClientWrapper::processPendingTasks): Dereference the
547         member variable that holds a never-null pointer to the ScriptExecutionContext. This should
548         similarly be a reference.
549         (WebCore::ThreadableWebSocketChannelClientWrapper::didConnectCallback):
550         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessageCallback):
551         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveBinaryDataCallback):
552         (WebCore::ThreadableWebSocketChannelClientWrapper::didUpdateBufferedAmountCallback):
553         (WebCore::ThreadableWebSocketChannelClientWrapper::didStartClosingHandshakeCallback):
554         (WebCore::ThreadableWebSocketChannelClientWrapper::didCloseCallback):
555         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessageErrorCallback):
556         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
557         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
558         (WebCore::workerGlobalScopeDidSend):
559         (WebCore::workerGlobalScopeDidGetBufferedAmount):
560         (WebCore::workerGlobalScopeDidConnect):
561         (WebCore::workerGlobalScopeDidReceiveMessage):
562         (WebCore::workerGlobalScopeDidReceiveBinaryData):
563         (WebCore::workerGlobalScopeDidUpdateBufferedAmount):
564         (WebCore::workerGlobalScopeDidStartClosingHandshake):
565         (WebCore::workerGlobalScopeDidClose):
566         (WebCore::workerGlobalScopeDidReceiveMessageError):
567         (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadInitialize):
568         (WebCore::WorkerThreadableWebSocketChannel::mainThreadConnect):
569         (WebCore::WorkerThreadableWebSocketChannel::mainThreadSend):
570         (WebCore::WorkerThreadableWebSocketChannel::mainThreadSendArrayBuffer):
571         (WebCore::WorkerThreadableWebSocketChannel::mainThreadSendBlob):
572         (WebCore::WorkerThreadableWebSocketChannel::mainThreadBufferedAmount):
573         (WebCore::WorkerThreadableWebSocketChannel::mainThreadClose):
574         (WebCore::WorkerThreadableWebSocketChannel::mainThreadFail):
575         (WebCore::WorkerThreadableWebSocketChannel::mainThreadDestroy):
576         (WebCore::WorkerThreadableWebSocketChannel::mainThreadSuspend):
577         (WebCore::WorkerThreadableWebSocketChannel::mainThreadResume):
578         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
579         * bindings/js/JSCallbackData.h:
580         (WebCore::DeleteCallbackDataTask::DeleteCallbackDataTask):
581         * bindings/js/JSDOMGlobalObjectTask.cpp:
582         (WebCore::JSGlobalObjectTask::JSGlobalObjectTask):
583         * dom/Document.cpp:
584         (WebCore::Document::postTask):
585         (WebCore::Document::pendingTasksTimerFired):
586         * dom/ScriptExecutionContext.cpp:
587         (WebCore::ScriptExecutionContext::processMessagePortMessagesSoon):
588         * dom/ScriptExecutionContext.h:
589         (WebCore::ScriptExecutionContext::Task::performTask):
590         (WebCore::ScriptExecutionContext::AddConsoleMessageTask::AddConsoleMessageTask):
591         * dom/StringCallback.cpp:
592         (WebCore::StringCallback::scheduleCallback):
593         * fileapi/FileReader.cpp:
594         (WebCore::delayedAbort):
595         (WebCore::FileReader::abort):
596         (WebCore::FileReader::doAbort): Deleted.
597         * loader/WorkerThreadableLoader.cpp:
598         (WebCore::WorkerThreadableLoader::MainThreadBridge::mainThreadCreateLoader):
599         (WebCore::WorkerThreadableLoader::MainThreadBridge::mainThreadDestroy):
600         (WebCore::WorkerThreadableLoader::MainThreadBridge::mainThreadCancel):
601         (WebCore::workerGlobalScopeDidSendData):
602         (WebCore::workerGlobalScopeDidReceiveResponse):
603         (WebCore::workerGlobalScopeDidReceiveData):
604         (WebCore::workerGlobalScopeDidFinishLoading):
605         (WebCore::workerGlobalScopeDidFail):
606         (WebCore::workerGlobalScopeDidFailAccessControlCheck):
607         (WebCore::workerGlobalScopeDidFailRedirectCheck):
608         * loader/WorkerThreadableLoader.h:
609         * loader/appcache/ApplicationCacheGroup.cpp:
610         (WebCore::ApplicationCacheGroup::postListenerTask):
611         * loader/cache/MemoryCache.cpp:
612         (WebCore::MemoryCache::crossThreadRemoveRequestFromCache):
613         (WebCore::MemoryCache::crossThreadRemoveRequestFromSessionCaches):
614         * loader/cache/MemoryCache.h:
615         * workers/DefaultSharedWorkerRepository.cpp:
616         (WebCore::SharedWorkerProxy::postExceptionToWorkerObject):
617         (WebCore::SharedWorkerProxy::postConsoleMessageToWorkerObject):
618         (WebCore::SharedWorkerConnectTask::SharedWorkerConnectTask):
619         * workers/WorkerEventQueue.cpp:
620         (WebCore::WorkerEventQueue::enqueueEvent):
621         * workers/WorkerGlobalScope.cpp:
622         (WebCore::WorkerGlobalScope::close):
623         * workers/WorkerMessagingProxy.cpp:
624         (WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
625         (WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
626         (WebCore::WorkerMessagingProxy::postExceptionToWorkerObject):
627         (WebCore::WorkerMessagingProxy::postConsoleMessageToWorkerObject):
628         (WebCore::WorkerMessagingProxy::workerObjectDestroyed):
629         (WebCore::WorkerMessagingProxy::notifyNetworkStateChange):
630         (WebCore::WorkerMessagingProxy::connectToInspector):
631         (WebCore::WorkerMessagingProxy::disconnectFromInspector):
632         (WebCore::WorkerMessagingProxy::sendMessageToInspector):
633         (WebCore::WorkerMessagingProxy::workerGlobalScopeDestroyed):
634         (WebCore::WorkerMessagingProxy::workerGlobalScopeClosed):
635         (WebCore::WorkerMessagingProxy::postMessageToPageInspector):
636         (WebCore::WorkerMessagingProxy::confirmMessageFromWorkerObject):
637         (WebCore::WorkerMessagingProxy::reportPendingActivity):
638         * workers/WorkerRunLoop.cpp:
639         (WebCore::WorkerRunLoop::Task::performTask):
640         * workers/WorkerScriptLoader.cpp:
641         * workers/WorkerThread.cpp:
642         (WebCore::WorkerThread::stop):
643         (WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads):
644
645 2014-06-16  Zan Dobersek  <zdobersek@igalia.com>
646
647         Page::findStringMatchingRanges() should take Vector<RefPtr<Range>> by reference instead of pointer
648         https://bugs.webkit.org/show_bug.cgi?id=133677
649
650         Reviewed by Anders Carlsson.
651
652         * WebCore.exp.in: Update the changed symbol.
653         * page/Page.cpp:
654         (WebCore::Page::findStringMatchingRanges): The method expects the matchRanges parameter to be non-null,
655         so it should take in that parameter by reference instead of pointer.
656         * page/Page.h:
657
658 2014-06-16  Radu Stavila  <stavila@adobe.com>
659
660         REGRESSION (r168046): Incorrect layout for multicol spanners when moving from one thread to another
661         https://bugs.webkit.org/show_bug.cgi?id=133589
662
663         Reviewed by Antti Koivisto.
664
665         When a spanner is moved from a multicol thread to another, its placeholder
666         must be properly repositioned.
667
668         Test: fast/multicol/newmulticol/spanner-crash.html
669
670         * rendering/RenderMultiColumnFlowThread.cpp:
671         (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted):
672
673 2014-06-16  Mario Sanchez Prada  <mario.prada@samsung.com>
674
675         [ATK] Missing 'selection-changed' signal when navigating a combo box with keyboard
676         https://bugs.webkit.org/show_bug.cgi?id=133512
677
678         Reviewed by Chris Fleizach.
679
680         Make sure that AccessibilityMenuList objects update their active
681         option when it changes, which will send a platform-dependent
682         accessibility-related notification when needed.
683
684         Test: accessibility/combo-box-collapsed-selection-changed.html
685
686         * rendering/RenderMenuList.cpp:
687         (RenderMenuList::didUpdateActiveOption): Keep the out-of-bounds
688         check for the index passed but don't avoid updating the option for
689         the associated AccessibilityMenuList object if the selected list
690         item does not have a renderer, because that could be the case for
691         cases where the popup (and its elements) would be rendered in the
692         UI Process (e.g. GTK+ port uses GtkMenu and GtkMenuItem for that).
693
694         * accessibility/AccessibilityMenuList.cpp:
695         (WebCore::AccessibilityMenuList::didUpdateActiveOption): Ensure
696         that the AccessibilityMenuListPopup object for a given menu list
697         has accessibility children before updating its active option.
698
699 2014-06-16  Commit Queue  <commit-queue@webkit.org>
700
701         Unreviewed, rolling out r170003.
702         https://bugs.webkit.org/show_bug.cgi?id=133938
703
704         This patch broke GTK build (Requested by kczech on #webkit).
705
706         Reverted changeset:
707
708         "[EFL] Platform support for WebSpeech feature."
709         https://bugs.webkit.org/show_bug.cgi?id=116438
710         http://trac.webkit.org/changeset/170003
711
712 2014-06-16  Frédéric Wang  <fred.wang@free.fr>
713
714         Draw radicals with glyphs for better rendering.
715         https://bugs.webkit.org/show_bug.cgi?id=119038
716
717         Unreviewed ASSERT fix.
718
719         * rendering/mathml/RenderMathMLRoot.h:
720
721 2014-06-16  Frédéric Wang  <fred.wang@free.fr>
722
723         Draw radicals with glyphs for better rendering
724         https://bugs.webkit.org/show_bug.cgi?id=119038
725
726         Reviewed by Chris Fleizach.
727
728         We rewrite RenderMathMLRoot in order to fix bugs with SVG transforms and dynamic modification of children and allow drawing with an OpenType MATH table.
729         The drawing of the radical sign (without the top bar) is now moved to a RenderMathMLRadicalOperator class inheriting from RenderMathMLOperator.
730         This class fallbacks to the original drawing with graphic primitives if an OpenType MATH table is not available.
731
732         Tests: mathml/opentype/roots-LatinModern.html
733                mathml/presentation/mroot-transform.html
734
735         * CMakeLists.txt: add files to build system.
736         * WebCore.vcxproj/WebCore.vcxproj: ditto.
737         * WebCore.vcxproj/WebCore.vcxproj.filters: ditto.
738         * WebCore.xcodeproj/project.pbxproj: ditto
739         * css/mathml.css: remove rules for msqrt/mroot. The "script level" in mroot is not incremented by 2 as specified in the spec.
740         (math, mrow, mfenced, merror, mphantom, mstyle, menclose):
741         (mroot > *:last-child):
742         (math, mrow, mfenced, msqrt, mroot, merror, mphantom, mstyle, menclose): Deleted.
743         (msqrt > *): Deleted.
744         (mroot): Deleted. This rule was causing bug 126516.
745         (mroot > * + *): Deleted.
746         * rendering/RenderObject.h: Add two new isRenderMathML* functions for dynamic casting.
747         (WebCore::RenderObject::isRenderMathMLRadicalOperator):
748         (WebCore::RenderObject::isRenderMathMLRootWrapper):
749         * rendering/mathml/RenderMathMLOperator.cpp: Accept a set of operator dictionary flags, all disabled by default. This is to allow anonymous radicas, which don't have any flag.
750         isFencedOperator() is now replaced with the more general isAnonymous() since we allow anonymous radical operator fors msqrt/mroot.
751         (WebCore::RenderMathMLOperator::RenderMathMLOperator):
752         (WebCore::RenderMathMLOperator::setOperatorFlagFromAttribute):
753         (WebCore::RenderMathMLOperator::setOperatorPropertiesFromOpDictEntry):
754         (WebCore::RenderMathMLOperator::SetOperatorProperties):
755         (WebCore::RenderMathMLOperator::updateTokenContent):
756         * rendering/mathml/RenderMathMLOperator.h: Allow class to be overriden, redefine the anonymous constructor, remove isFencedOperator().
757         * rendering/mathml/RenderMathMLRadicalOperator.cpp: Added.
758         (WebCore::RenderMathMLRadicalOperator::RenderMathMLRadicalOperator):
759         (WebCore::RenderMathMLRadicalOperator::stretchTo):
760         (WebCore::RenderMathMLRadicalOperator::SetOperatorProperties):
761         (WebCore::RenderMathMLRadicalOperator::computePreferredLogicalWidths):
762         (WebCore::RenderMathMLRadicalOperator::computeLogicalHeight):
763         (WebCore::RenderMathMLRadicalOperator::paint):
764         (WebCore::RenderMathMLRadicalOperator::trailingSpaceError):
765         * rendering/mathml/RenderMathMLRadicalOperator.h: Added.
766         * rendering/mathml/RenderMathMLRoot.cpp: Rewritten. Some parts to use graphic primitives are moved to RenderMathMLRadicalOperator.cpp.
767         (WebCore::RenderMathMLRoot::RenderMathMLRoot):
768         (WebCore::RenderMathMLRoot::baseWrapper):
769         (WebCore::RenderMathMLRoot::radicalWrapper):
770         (WebCore::RenderMathMLRoot::indexWrapper):
771         (WebCore::RenderMathMLRoot::radicalOperator):
772         (WebCore::RenderMathMLRoot::restructureWrappers):
773         (WebCore::RenderMathMLRoot::addChild):
774         (WebCore::RenderMathMLRoot::styleDidChange):
775         (WebCore::RenderMathMLRoot::updateFromElement):
776         (WebCore::RenderMathMLRoot::updateStyle):
777         (WebCore::RenderMathMLRoot::firstLineBaseline):
778         (WebCore::RenderMathMLRoot::layout):
779         (WebCore::RenderMathMLRoot::paint):
780         (WebCore::RenderMathMLRootWrapper::createAnonymousWrapper):
781         (WebCore::RenderMathMLRootWrapper::removeChildWithoutRestructuring):
782         (WebCore::RenderMathMLRootWrapper::removeChild):
783         (WebCore::RenderMathMLRoot::paddingTop): Deleted.
784         (WebCore::RenderMathMLRoot::paddingBottom): Deleted.
785         (WebCore::RenderMathMLRoot::paddingLeft): Deleted.
786         (WebCore::RenderMathMLRoot::paddingRight): Deleted.
787         (WebCore::RenderMathMLRoot::paddingBefore): Deleted.
788         (WebCore::RenderMathMLRoot::paddingAfter): Deleted.
789         (WebCore::RenderMathMLRoot::paddingStart): Deleted.
790         (WebCore::RenderMathMLRoot::paddingEnd): Deleted.
791         (WebCore::RenderMathMLRoot::index): Deleted.
792         * rendering/mathml/RenderMathMLRoot.h: Rewritten.
793         (WebCore::RenderMathMLRootWrapper::RenderMathMLRootWrapper):
794
795 2014-06-16  Krzysztof Czech  <k.czech@samsung.com>
796
797         [EFL] Platform support for WebSpeech feature.
798         https://bugs.webkit.org/show_bug.cgi?id=116438
799
800         Reviewed by Gyuyoung Kim.
801
802         It's a first step of adding support for Speech Synthesis in EFL port.
803         Just stub out required API and support for compilation.
804
805         * CMakeLists.txt:
806         * PlatformEfl.cmake:
807         * platform/PlatformSpeechSynthesizer.h:
808         * platform/efl/PlatformSpeechSynthesisProviderEfl.cpp: Added.
809         (WebCore::PlatformSpeechSynthesisProviderEfl::PlatformSpeechSynthesisProviderEfl):
810         (WebCore::PlatformSpeechSynthesisProviderEfl::~PlatformSpeechSynthesisProviderEfl):
811         (WebCore::PlatformSpeechSynthesisProviderEfl::initializeVoiceList):
812         (WebCore::PlatformSpeechSynthesisProviderEfl::pause):
813         (WebCore::PlatformSpeechSynthesisProviderEfl::resume):
814         (WebCore::PlatformSpeechSynthesisProviderEfl::speak):
815         (WebCore::PlatformSpeechSynthesisProviderEfl::cancel):
816         * platform/efl/PlatformSpeechSynthesisProviderEfl.h: Added.
817         * platform/efl/PlatformSpeechSynthesizerEfl.cpp: Added.
818         (WebCore::PlatformSpeechSynthesizer::PlatformSpeechSynthesizer):
819         (WebCore::PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer):
820         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
821         (WebCore::PlatformSpeechSynthesizer::pause):
822         (WebCore::PlatformSpeechSynthesizer::resume):
823         (WebCore::PlatformSpeechSynthesizer::speak):
824         (WebCore::PlatformSpeechSynthesizer::cancel):
825
826 2014-06-15  Benjamin Poulain  <benjamin@webkit.org>
827
828         CSS JIT: add support for the :lang() pseudo class
829         https://bugs.webkit.org/show_bug.cgi?id=133913
830
831         Reviewed by Andreas Kling.
832
833         The selector is already very expensive to begin with, just implement it with
834         a function call.
835
836         It is also done after every other filter since it is so inefficient.
837
838         Tests: fast/selectors/lang-conflict.html
839                fast/selectors/lang-empty.html
840                fast/selectors/lang-specificity-xml.xhtml
841                fast/selectors/lang-specificity.html
842
843         * css/SelectorChecker.cpp:
844         (WebCore::SelectorChecker::checkOne):
845         * css/SelectorCheckerTestFunctions.h:
846         (WebCore::matchesLangPseudoClass):
847         * cssjit/SelectorCompiler.cpp:
848         (WebCore::SelectorCompiler::SelectorFragment::SelectorFragment):
849         (WebCore::SelectorCompiler::addPseudoClassType):
850         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
851         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsInLanguage):
852         * dom/Element.cpp:
853         (WebCore::Element::computeInheritedLanguage):
854         * dom/ElementData.cpp:
855         (WebCore::ElementData::findLanguageAttribute):
856         * dom/ElementData.h:
857
858 2014-06-15  Anders Carlsson  <andersca@apple.com>
859
860         Add an autorelease() member function to RetainPtr
861         https://bugs.webkit.org/show_bug.cgi?id=133929
862
863         Reviewed by Dan Bernstein.
864
865         * bindings/objc/DOM.mm:
866         (-[DOMNode renderedImage]):
867         (-[DOMRange renderedImageForcingBlackText:renderedImageForcingBlackText:]):
868         * bindings/objc/DOMUIKitExtensions.mm:
869         (-[DOMHTMLImageElement dataRepresentation:]):
870         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
871         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
872         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
873
874 2014-06-14  Anders Carlsson  <andersca@apple.com>
875
876         Adopt HTTPHeaderName in ResourceResponseBase
877         https://bugs.webkit.org/show_bug.cgi?id=133919
878
879         Reviewed by Sam Weinig.
880
881         * platform/network/HTTPHeaderNames.in:
882         * platform/network/ResourceResponseBase.cpp:
883         (WebCore::ResourceResponseBase::updateHeaderParsedState):
884         (WebCore::ResourceResponseBase::setHTTPHeaderField):
885         (WebCore::ResourceResponseBase::addHTTPHeaderField):
886         (WebCore::ResourceResponseBase::parseCacheControlDirectives):
887         (WebCore::ResourceResponseBase::hasCacheValidatorFields):
888         (WebCore::parseDateValueInHeader):
889         (WebCore::ResourceResponseBase::date):
890         (WebCore::ResourceResponseBase::age):
891         (WebCore::ResourceResponseBase::expires):
892         (WebCore::ResourceResponseBase::lastModified):
893         (WebCore::ResourceResponseBase::isAttachment):
894         * platform/network/ResourceResponseBase.h:
895
896 2014-06-14  Anders Carlsson  <andersca@apple.com>
897
898         Simplify ResourceRequest constructors
899         https://bugs.webkit.org/show_bug.cgi?id=133911
900
901         Reviewed by Sam Weinig.
902
903         * platform/network/cf/ResourceRequest.h:
904         (WebCore::ResourceRequest::ResourceRequest):
905
906 2014-06-14  Benjamin Poulain  <benjamin@webkit.org>
907
908         Fix the ARM64 build
909
910         * cssjit/SelectorCompiler.cpp:
911         (WebCore::SelectorCompiler::SelectorCodeGenerator::addFlagsToElementStyleFromContext):
912
913 2014-06-13  Sam Weinig  <sam@webkit.org>
914
915         Store DOM constants directly in the JS object rather than jumping through a custom accessor
916         https://bugs.webkit.org/show_bug.cgi?id=133898
917
918         Reviewed by Oliver Hunt.
919
920         Instead of implementing constants as custom accessors that just happen to return a value,
921         we now store the constant directly in the HashTableValue array (where the GetValueFunc used
922         to be). 
923         
924         - For the case where the constant is accessed via the static table (still in use for instances 
925           and some prototypes), the static lookup function will set the value on the property slot,
926           instead of passing a function pointer.
927         - For the case where the constant is eagerly reified (most prototypes and all constructors) the
928           constant is put directly in the object.
929
930         In micro benchmarks this looks to be around a 4x speedup on the use of DOM constants.
931
932         This also removes support for constant strings in IDL, which we had no uses of.
933
934         * bindings/scripts/CodeGeneratorJS.pm:
935         (GenerateHeader):
936         Remove code to generate forward declaration of constant accessor functions.
937
938         (GenerateImplementation):
939         Remove code to generate implementation of constant accessor functions.
940
941         (GenerateHashTableValueArray):
942         Plant the constant directly in the value array.
943
944         * bindings/scripts/IDLParser.pm:
945         (parseConstValue):
946         Remove support for constant strings.
947
948         * bindings/scripts/test/JS/JSTestInterface.cpp:
949         * bindings/scripts/test/JS/JSTestInterface.h:
950         * bindings/scripts/test/JS/JSTestObj.cpp:
951         * bindings/scripts/test/JS/JSTestObj.h:
952         * bindings/scripts/test/ObjC/DOMTestObj.h:
953         * bindings/scripts/test/TestObj.idl:
954         Update test results.
955
956 2014-06-14  Anders Carlsson  <andersca@apple.com>
957
958         Simplify Document::processHttpEquiv
959         https://bugs.webkit.org/show_bug.cgi?id=133910
960
961         Reviewed by Andreas Kling.
962
963         * dom/Document.cpp:
964         (WebCore::Document::processHttpEquiv):
965         * platform/network/HTTPHeaderNames.in:
966
967 2014-06-14  Andreas Kling  <akling@apple.com>
968
969         GCController should return FastMalloc memory to the system.
970         <https://webkit.org/b/133884>
971
972         Reviewed by Anders Carlsson.
973
974         Speculative test fix; I'm kinda suspecting that some tests are reporting
975         more memory used because we did a GC but didn't get around to returning
976         free pages to the system yet.
977
978         * bindings/js/GCController.cpp:
979         (WebCore::GCController::garbageCollectNow):
980
981 2014-06-14  Zan Dobersek  <zdobersek@igalia.com>
982
983         Generate HTTP header names that are required by WebKitWebSrc
984         https://bugs.webkit.org/show_bug.cgi?id=133906
985
986         Reviewed by Anders Carlsson.
987
988         WebKitWebSrc implementation sets icy-metadata and transferMode.dlna HTTP headers
989         on ResourceRequest objects. The two headers are added to HTTPHeaderNames.in, and
990         a small tweak is added to the generator script to avoid the dot in the second
991         header's name (which would otherwise generate invalid C++).
992
993         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
994         (webKitWebSrcStart):
995         * platform/network/HTTPHeaderNames.in:
996         * platform/network/create-http-header-name-table:
997
998 2014-06-14  Anders Carlsson  <andersca@apple.com>
999
1000         Replace some uses of ResourceRequestBase::addHTTPHeaderField with setHTTPHeaderField
1001         https://bugs.webkit.org/show_bug.cgi?id=133907
1002
1003         Reviewed by Andreas Kling.
1004
1005         * Modules/websockets/WebSocketHandshake.cpp:
1006         (WebCore::WebSocketHandshake::clientHandshakeRequest):
1007         * platform/network/HTTPHeaderNames.in:
1008         * platform/network/cf/ResourceHandleCFNet.cpp:
1009         (WebCore::applyBasicAuthorizationHeader):
1010         * platform/network/mac/ResourceHandleMac.mm:
1011         (WebCore::applyBasicAuthorizationHeader):
1012
1013 2014-06-13  Anders Carlsson  <andersca@apple.com>
1014
1015         Add a ResourceRequestBase::setHTTPHeaderField overload that takes a HTTPHeaderName
1016         https://bugs.webkit.org/show_bug.cgi?id=133881
1017
1018         Reviewed by Sam Weinig.
1019
1020         * WebCore.exp.in:
1021         * fileapi/FileReaderLoader.cpp:
1022         (WebCore::FileReaderLoader::start):
1023         * inspector/InspectorResourceAgent.cpp:
1024         (WebCore::InspectorResourceAgent::willSendRequest):
1025         * loader/CrossOriginAccessControl.cpp:
1026         (WebCore::createAccessControlPreflightRequest):
1027         * loader/FrameLoader.cpp:
1028         (WebCore::FrameLoader::addExtraFieldsToRequest):
1029         * loader/PingLoader.cpp:
1030         (WebCore::PingLoader::loadImage):
1031         (WebCore::PingLoader::sendPing):
1032         * loader/appcache/ApplicationCacheGroup.cpp:
1033         (WebCore::ApplicationCacheGroup::createResourceHandle):
1034         * loader/cache/CachedResource.cpp:
1035         (WebCore::CachedResource::load):
1036         * page/EventSource.cpp:
1037         (WebCore::EventSource::connect):
1038         * platform/network/BlobResourceHandle.cpp:
1039         (WebCore::BlobResourceHandle::doStart):
1040         * platform/network/HTTPHeaderNames.in:
1041         * platform/network/ResourceRequestBase.cpp:
1042         (WebCore::ResourceRequestBase::httpHeaderField):
1043         (WebCore::ResourceRequestBase::setHTTPHeaderField):
1044         (WebCore::ResourceRequestBase::httpContentType):
1045         (WebCore::ResourceRequestBase::setHTTPContentType):
1046         (WebCore::ResourceRequestBase::httpReferrer):
1047         (WebCore::ResourceRequestBase::setHTTPReferrer):
1048         (WebCore::ResourceRequestBase::httpOrigin):
1049         (WebCore::ResourceRequestBase::setHTTPOrigin):
1050         (WebCore::ResourceRequestBase::httpUserAgent):
1051         (WebCore::ResourceRequestBase::setHTTPUserAgent):
1052         (WebCore::ResourceRequestBase::httpAccept):
1053         (WebCore::ResourceRequestBase::setHTTPAccept):
1054         * platform/network/ResourceRequestBase.h:
1055         * platform/network/mac/ResourceHandleMac.mm:
1056         (WebCore::ResourceHandle::willSendRequest):
1057
1058 2014-06-14  Simon Fraser  <simon.fraser@apple.com>
1059
1060         Masks disappear when layers become tiled
1061         https://bugs.webkit.org/show_bug.cgi?id=133892
1062         <rdar://problem/17309793>
1063
1064         Reviewed by Tim Horton.
1065         
1066         There were several problems with tiled mask layers.
1067         
1068         First, when a layer became tiled it failed to re-apply the platform layer
1069         for its mask; fixed by adding MaskLayerChanged to the set of flags in
1070         swapFromOrToTiledLayer().
1071         
1072         Secondly, in CA, a mask layer's superlayer is the layer which is it masking,
1073         so the if (oldLayer->superlayer())... code in swapFromOrToTiledLayer() would
1074         erroneously try to swap out a sublayer on the superlayer with the mask.
1075         
1076         Thirdly, the mask layer is updated after its host layer, but when the mask layer
1077         become tiled, there was no code that updated the mask platform layer on its
1078         host layer. Fix by:
1079             1. setting a bit on a layer to note that it's being used as a mask.
1080             2. setting the parent of such a layer to its host layer (mimicking CA)
1081             3. when the mask becomes tiled, dirtying the MaskLayerChanged bit on
1082                its parent and adding a clause to commitLayerChangesAfterSublayers()
1083                to update the mask layer.
1084         
1085         Finally, ASSERTION FAILED: owningGraphicsLayer()->isCommittingChanges() would
1086         fire because we failed to set the m_isCommittingChanges flag while committing
1087         the mask layer. Fix by moving the TemporaryChange<bool> that sets this flag
1088         into commitLayerChangesBeforeSublayers() and commitLayerChangesAfterSublayers().
1089         
1090         Also used safe casts in more places in GraphicsLayerCA.
1091
1092         Tests: compositing/masks/become-tiled-mask.html
1093                compositing/masks/cease-tiled-mask.html
1094                compositing/masks/tiled-mask.html
1095
1096         * platform/graphics/GraphicsLayer.cpp:
1097         (WebCore::GraphicsLayer::GraphicsLayer):
1098         (WebCore::GraphicsLayer::removeFromParent):
1099         (WebCore::GraphicsLayer::setMaskLayer):
1100         * platform/graphics/GraphicsLayer.h:
1101         (WebCore::GraphicsLayer::setIsMaskLayer):
1102         (WebCore::GraphicsLayer::isMaskLayer):
1103         (WebCore::GraphicsLayer::setMaskLayer): Deleted.
1104         * platform/graphics/ca/GraphicsLayerCA.cpp:
1105         (WebCore::GraphicsLayerCA::removeFromParent):
1106         (WebCore::GraphicsLayerCA::setMaskLayer):
1107         (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush):
1108         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
1109         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
1110         (WebCore::GraphicsLayerCA::commitLayerChangesAfterSublayers):
1111         (WebCore::GraphicsLayerCA::updateSublayerList):
1112         (WebCore::GraphicsLayerCA::ensureStructuralLayer):
1113         (WebCore::GraphicsLayerCA::updateMaskLayer):
1114         (WebCore::GraphicsLayerCA::replicatedLayerRoot):
1115         (WebCore::GraphicsLayerCA::createFilterAnimationsFromKeyframes):
1116         (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
1117         (WebCore::GraphicsLayerCA::propagateLayerChangeToReplicas):
1118         (WebCore::GraphicsLayerCA::fetchCloneLayers):
1119
1120 2014-06-14  peavo@outlook.com  <peavo@outlook.com>
1121
1122         [Curl] Compile errors related to http headers.
1123         https://bugs.webkit.org/show_bug.cgi?id=133901
1124
1125         Reviewed by Brent Fulgham.
1126
1127         Http headers should now be specified with an enum, not a string.
1128
1129         * platform/network/curl/CurlCacheEntry.cpp:
1130         (WebCore::CurlCacheEntry::parseResponseHeaders):
1131         * platform/network/curl/MultipartHandle.cpp:
1132         (WebCore::MultipartHandle::didReceiveResponse):
1133
1134 2014-06-14  Brent Fulgham  <bfulgham@apple.com>
1135
1136         Unreviewed build fix after r169960.
1137
1138         * platform/graphics/ca/PlatformCALayer.cpp: Add missing include
1139         for snprintf on Windows.
1140
1141 2014-06-14  Csaba Osztrogonác  <ossy@webkit.org>
1142
1143         URTBF after r169943 and r169946.
1144
1145         * platform/network/HTTPHeaderMap.h: Removed maybe accidental deletion of the only one add function.
1146         * platform/network/HTTPHeaderNames.in: Added Sec-WebSocket-Key.
1147
1148 2014-06-14  Commit Queue  <commit-queue@webkit.org>
1149
1150         Unreviewed, rolling out r169963.
1151         https://bugs.webkit.org/show_bug.cgi?id=133899
1152
1153         Assertion in mathml/roots-removeChild.html (Requested by fredw
1154         on #webkit).
1155
1156         Reverted changeset:
1157
1158         "Draw radicals with glyphs for better rendering"
1159         https://bugs.webkit.org/show_bug.cgi?id=119038
1160         http://trac.webkit.org/changeset/169963
1161
1162 2014-06-14  Frédéric Wang  <fred.wang@free.fr>
1163
1164         Draw radicals with glyphs for better rendering
1165         https://bugs.webkit.org/show_bug.cgi?id=119038
1166
1167         Reviewed by Chris Fleizach.
1168
1169         We rewrite RenderMathMLRoot in order to fix bugs with SVG transforms and dynamic modification of children and allow drawing with an OpenType MATH table.
1170         The drawing of the radical sign (without the top bar) is now moved to a RenderMathMLRadicalOperator class inheriting from RenderMathMLOperator.
1171         This class fallbacks to the original drawing with graphic primitives if an OpenType MATH table is not available.
1172
1173         Tests: mathml/opentype/roots-LatinModern.html
1174                mathml/presentation/mroot-transform.html
1175
1176         * CMakeLists.txt: add files to build system.
1177         * WebCore.vcxproj/WebCore.vcxproj: ditto.
1178         * WebCore.vcxproj/WebCore.vcxproj.filters: ditto.
1179         * WebCore.xcodeproj/project.pbxproj: ditto
1180         * css/mathml.css: remove rules for msqrt/mroot. The "script level" in mroot is not incremented by 2 as specified in the spec.
1181         (math, mrow, mfenced, merror, mphantom, mstyle, menclose):
1182         (mroot > *:last-child):
1183         (math, mrow, mfenced, msqrt, mroot, merror, mphantom, mstyle, menclose): Deleted.
1184         (msqrt > *): Deleted.
1185         (mroot): Deleted. This rule was causing bug 126516.
1186         (mroot > * + *): Deleted.
1187         * rendering/RenderObject.h: Add two new isRenderMathML* functions for dynamic casting.
1188         (WebCore::RenderObject::isRenderMathMLRadicalOperator):
1189         (WebCore::RenderObject::isRenderMathMLRootWrapper):
1190         * rendering/mathml/RenderMathMLOperator.cpp: Accept a set of operator dictionary flags, all disabled by default. This is to allow anonymous radicas, which don't have any flag.
1191         isFencedOperator() is now replaced with the more general isAnonymous() since we allow anonymous radical operator fors msqrt/mroot.
1192         (WebCore::RenderMathMLOperator::RenderMathMLOperator):
1193         (WebCore::RenderMathMLOperator::setOperatorFlagFromAttribute):
1194         (WebCore::RenderMathMLOperator::setOperatorPropertiesFromOpDictEntry):
1195         (WebCore::RenderMathMLOperator::SetOperatorProperties):
1196         (WebCore::RenderMathMLOperator::updateTokenContent):
1197         * rendering/mathml/RenderMathMLOperator.h: Allow class to be overriden, redefine the anonymous constructor, remove isFencedOperator().
1198         * rendering/mathml/RenderMathMLRadicalOperator.cpp: Added.
1199         (WebCore::RenderMathMLRadicalOperator::RenderMathMLRadicalOperator):
1200         (WebCore::RenderMathMLRadicalOperator::stretchTo):
1201         (WebCore::RenderMathMLRadicalOperator::SetOperatorProperties):
1202         (WebCore::RenderMathMLRadicalOperator::computePreferredLogicalWidths):
1203         (WebCore::RenderMathMLRadicalOperator::computeLogicalHeight):
1204         (WebCore::RenderMathMLRadicalOperator::paint):
1205         (WebCore::RenderMathMLRadicalOperator::trailingSpaceError):
1206         * rendering/mathml/RenderMathMLRadicalOperator.h: Added.
1207         * rendering/mathml/RenderMathMLRoot.cpp: Rewritten. Some parts to use graphic primitives are moved to RenderMathMLRadicalOperator.cpp.
1208         (WebCore::RenderMathMLRoot::RenderMathMLRoot):
1209         (WebCore::RenderMathMLRoot::baseWrapper):
1210         (WebCore::RenderMathMLRoot::radicalWrapper):
1211         (WebCore::RenderMathMLRoot::indexWrapper):
1212         (WebCore::RenderMathMLRoot::radicalOperator):
1213         (WebCore::RenderMathMLRoot::restructureWrappers):
1214         (WebCore::RenderMathMLRoot::addChild):
1215         (WebCore::RenderMathMLRoot::styleDidChange):
1216         (WebCore::RenderMathMLRoot::updateFromElement):
1217         (WebCore::RenderMathMLRoot::updateStyle):
1218         (WebCore::RenderMathMLRoot::firstLineBaseline):
1219         (WebCore::RenderMathMLRoot::layout):
1220         (WebCore::RenderMathMLRoot::paint):
1221         (WebCore::RenderMathMLRootWrapper::createAnonymousWrapper):
1222         (WebCore::RenderMathMLRootWrapper::removeChildWithoutRestructuring):
1223         (WebCore::RenderMathMLRootWrapper::removeChild):
1224         (WebCore::RenderMathMLRoot::paddingTop): Deleted.
1225         (WebCore::RenderMathMLRoot::paddingBottom): Deleted.
1226         (WebCore::RenderMathMLRoot::paddingLeft): Deleted.
1227         (WebCore::RenderMathMLRoot::paddingRight): Deleted.
1228         (WebCore::RenderMathMLRoot::paddingBefore): Deleted.
1229         (WebCore::RenderMathMLRoot::paddingAfter): Deleted.
1230         (WebCore::RenderMathMLRoot::paddingStart): Deleted.
1231         (WebCore::RenderMathMLRoot::paddingEnd): Deleted.
1232         (WebCore::RenderMathMLRoot::index): Deleted.
1233         * rendering/mathml/RenderMathMLRoot.h: Rewritten.
1234         (WebCore::RenderMathMLRootWrapper::RenderMathMLRootWrapper):
1235
1236 2014-06-13  Brent Fulgham  <bfulgham@apple.com>
1237
1238         Move utility functions from WebLayer to PlatformCALayer
1239         https://bugs.webkit.org/show_bug.cgi?id=133887
1240         <rdar://problem/17309622>
1241
1242         Reviewed by Simon Fraser.
1243
1244         Move some utility functions from WebLayer.h/.mm to PlatformCALayer.
1245         Provide ObjC implementation in PlatformCALayerMac. A future patch will
1246         provide corresponding Windows versions.
1247
1248         * WebCore.exp.in:
1249         * platform/graphics/ca/PlatformCALayer.cpp:
1250         (WebCore::PlatformCALayer::drawRepaintIndicator):
1251         * platform/graphics/ca/PlatformCALayer.h:
1252         * platform/graphics/ca/TileController.cpp:
1253         (WebCore::TileController::blankPixelCountForTiles):
1254         * platform/graphics/ca/TileGrid.cpp:
1255         (WebCore::TileGrid::platformCALayerPaintContents):
1256         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
1257         (PlatformCALayer::collectRectsToPaint):
1258         (PlatformCALayer::drawLayerContents):
1259         (PlatformCALayer::frameForLayer):
1260         * platform/graphics/mac/WebLayer.h:
1261         * platform/graphics/mac/WebLayer.mm:
1262         (-[WebLayer drawInContext:]):
1263         (WebCore::collectRectsToPaint): Deleted.
1264         (WebCore::drawLayerContents): Deleted.
1265         (WebCore::drawRepaintIndicator): Deleted.
1266         (WebCore::frameForLayer): Deleted.
1267
1268 2014-06-13  Alex Christensen  <achristensen@webkit.org>
1269
1270         Unreviewed disabling css jit on armv7.  It's not quite ready yet.
1271
1272         * cssjit/SelectorCompiler.cpp:
1273         (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):
1274         Removed extra comma.
1275
1276 2014-06-13  Alex Christensen  <achristensen@webkit.org>
1277
1278         Make css jit compile on armv7.
1279         https://bugs.webkit.org/show_bug.cgi?id=133889
1280
1281         Reviewed by Benjamin Poulain.
1282
1283         * cssjit/SelectorCompiler.cpp:
1284         (WebCore::SelectorCompiler::moduloHelper):
1285         (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):
1286         Implement modulo using a function call for now.
1287
1288 2014-06-13  Anders Carlsson  <andersca@apple.com>
1289
1290         Use the callOnMainThread version that takes an std::function in BlobResourceHandle::start()
1291         https://bugs.webkit.org/show_bug.cgi?id=133886
1292
1293         Reviewed by Andreas Kling.
1294
1295         Also replace a couple of NSAutoreleasePools with @autoreleasepool and an OwnPtr with an std::unique_ptr.
1296
1297         * page/scrolling/mac/ScrollingThreadMac.mm:
1298         (WebCore::ScrollingThread::threadRunLoopSourceCallback):
1299         * platform/mac/SharedTimerMac.mm:
1300         (WebCore::PowerObserver::PowerObserver):
1301         (WebCore::timerFired):
1302         (WebCore::setSharedTimerFireInterval):
1303         (WebCore::PowerObserver::create): Deleted.
1304         (WebCore::PowerObserver::didReceiveSystemPowerNotification): Deleted.
1305         * platform/network/BlobResourceHandle.cpp:
1306         (WebCore::BlobResourceHandle::start):
1307         (WebCore::delayedStartBlobResourceHandle): Deleted.
1308         * platform/network/BlobResourceHandle.h:
1309
1310 2014-06-12  Sam Weinig  <sam@webkit.org>
1311
1312         Constructors should eagerly reify their properties too
1313         https://bugs.webkit.org/show_bug.cgi?id=133822
1314
1315         Reviewed by Andreas Kling.
1316
1317         * bindings/scripts/CodeGeneratorJS.pm:
1318         (GenerateConstructorDeclaration):
1319         Constructors should never need to use the lazy property HashTable, so we can just
1320         remove its getOwnPropertySlot completely.
1321
1322         (ConstructorHasProperties):
1323         Add helper to determine if we need to reify any properties.
1324
1325         (GenerateConstructorHelperMethods):
1326         Reify if needed, and remove the implementation of getOwnPropertySlot.
1327
1328         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1329         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1330         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1331         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
1332         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1333         * bindings/scripts/test/JS/JSTestEventConstructor.h:
1334         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1335         * bindings/scripts/test/JS/JSTestEventTarget.h:
1336         * bindings/scripts/test/JS/JSTestException.cpp:
1337         * bindings/scripts/test/JS/JSTestException.h:
1338         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1339         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
1340         * bindings/scripts/test/JS/JSTestInterface.cpp:
1341         * bindings/scripts/test/JS/JSTestInterface.h:
1342         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1343         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
1344         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1345         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
1346         * bindings/scripts/test/JS/JSTestNode.cpp:
1347         * bindings/scripts/test/JS/JSTestNode.h:
1348         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1349         * bindings/scripts/test/JS/JSTestNondeterministic.h:
1350         * bindings/scripts/test/JS/JSTestObj.cpp:
1351         * bindings/scripts/test/JS/JSTestObj.h:
1352         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1353         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
1354         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1355         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
1356         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1357         * bindings/scripts/test/JS/JSTestTypedefs.h:
1358         * bindings/scripts/test/JS/JSattribute.cpp:
1359         * bindings/scripts/test/JS/JSattribute.h:
1360         * bindings/scripts/test/JS/JSreadonly.cpp:
1361         * bindings/scripts/test/JS/JSreadonly.h:
1362         Update tests.
1363
1364 2014-06-13  Alex Christensen  <achristensen@webkit.org>
1365
1366         Make css jit allocator smarter.
1367         https://bugs.webkit.org/show_bug.cgi?id=133834
1368
1369         Reviewed by Benjamin Poulain.
1370
1371         * cssjit/RegisterAllocator.h:
1372         (WebCore::RegisterAllocator::allocateRegister):
1373         (WebCore::RegisterAllocator::deallocateRegister):
1374         (WebCore::RegisterAllocator::reserveCalleeSavedRegisters):
1375         (WebCore::LocalRegister::LocalRegister):
1376         (WebCore::RegisterAllocator::RegisterAllocator):
1377         Use a Deque for the registers.  Allocate from the front and deallocate to the back to cycle the register usage.
1378         (WebCore::RegisterAllocator::allocateRegisterWithPreference):
1379         (WebCore::LocalRegisterWithPreference::LocalRegisterWithPreference):
1380         Added the ability to specify that we prefer a certain register if it is available while allocating.
1381         These functions always return a register.  It is just a different register than preferred if the preferred register is not available.
1382         * cssjit/SelectorCompiler.cpp:
1383         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
1384         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching):
1385         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsActive):
1386         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsHovered):
1387         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
1388         Whenever we are allocating a register for the second argument, we should specify that we 
1389         prefer to have argumentGPR1 to reduce register swapping when preparing for a function call.
1390         This cannot be done for argumentGPR0 because elementAddressRegister is argumentGPR0 and it is always allocated.
1391
1392 2014-06-13  Jeremy Jones  <jeremyj@apple.com>
1393
1394         set setUsesExternalPlaybackWhileExternalScreenIsActive based on fullscreen mode
1395         https://bugs.webkit.org/show_bug.cgi?id=133829
1396
1397         Reviewed by Eric Carlson.
1398
1399         When playing inline and external screen is active, don't use external playback.
1400
1401         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1402         declare updateDisableExternalPlayback()
1403         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1404         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
1405         call updateDisableExternalPlayback when player is created
1406         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
1407         call updateDisableExternalPlayback when fullscreen mode changes
1408         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
1409         update setUsesExternalPlaybackWhileExternalScreenIsActive based on fullscreen mode
1410
1411 2014-06-13  Brent Fulgham  <bfulgham@apple.com>
1412
1413         Convert LayerPool and TileCoverageMap from ObjC to C++
1414         https://bugs.webkit.org/show_bug.cgi?id=133862
1415         <rdar://problem/17302883>
1416
1417         Reviewed by Simon Fraser.
1418
1419         This just moves two ObjC files from the mac subdirectory to the parent and
1420         revises the project to build them as C++.
1421
1422         * WebCore.xcodeproj/project.pbxproj:
1423         * platform/graphics/ca/LayerPool.cpp: Copied from platform/graphics/ca/mac/LayerPool.mm.
1424         * platform/graphics/ca/LayerPool.h: Copied from platform/graphics/ca/mac/LayerPool.h.
1425         * platform/graphics/ca/TileCoverageMap.cpp: Copied from platform/graphics/ca/mac/TileCoverageMap.mm.
1426         * platform/graphics/ca/TileCoverageMap.h: Copied from platform/graphics/ca/mac/TileCoverageMap.h.
1427         * platform/graphics/ca/mac/LayerPool.h: Removed.
1428         * platform/graphics/ca/mac/LayerPool.mm: Removed.
1429         * platform/graphics/ca/mac/TileCoverageMap.h: Removed.
1430         * platform/graphics/ca/mac/TileCoverageMap.mm: Removed.
1431
1432 2014-06-13  Alex Christensen  <achristensen@webkit.org>
1433
1434         Make css jit compile for armv7.
1435         https://bugs.webkit.org/show_bug.cgi?id=133596
1436
1437         Reviewed by Benjamin Poulain.
1438
1439         * cssjit/FunctionCall.h:
1440         (WebCore::FunctionCall::swapArguments):
1441         Implemented for ARM_THUMB2 and removed allocator hack.
1442         * cssjit/RegisterAllocator.h:
1443         Added list of ARM_THUMB2 general purpose registers.
1444         (WebCore::RegisterAllocator::isValidRegister):
1445         Added ARM register range and corrected ARM64 register range now that r15 is tempRegister.
1446         * cssjit/SelectorCompiler.cpp:
1447         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
1448         Return CannotCompile if compiling fails because of lack of registers.
1449         (WebCore::SelectorCompiler::SelectorCodeGenerator::generatePrologue):
1450         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateEpilogue):
1451         Implemented for ARM_THUMB2.
1452         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
1453         Return false if the selector cannot be compiled because of lack of registers.
1454         (WebCore::SelectorCompiler::SelectorCodeGenerator::addFlagsToElementStyleFromContext):
1455         Added code using 32-bit operations and used macro assembler for 64-bit operations.
1456         (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):
1457         Implemented for APPLE_ARMV7S, where sdiv is not a template in the assembler.
1458         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributesMatching):
1459         Use addPtr instead of add64.
1460
1461 2014-06-13  Anders Carlsson  <andersca@apple.com>
1462
1463         Add a HTTPHeaderMap::get overload that takes an HTTPHeaderName
1464         https://bugs.webkit.org/show_bug.cgi?id=133877
1465
1466         Reviewed by Andreas Kling.
1467
1468         * Modules/websockets/WebSocketHandshake.cpp:
1469         (WebCore::WebSocketHandshake::serverWebSocketProtocol):
1470         (WebCore::WebSocketHandshake::serverSetCookie):
1471         (WebCore::WebSocketHandshake::serverSetCookie2):
1472         (WebCore::WebSocketHandshake::serverUpgrade):
1473         (WebCore::WebSocketHandshake::serverConnection):
1474         (WebCore::WebSocketHandshake::serverWebSocketAccept):
1475         * WebCore.exp.in:
1476         * platform/network/HTTPHeaderMap.cpp:
1477         (WebCore::HTTPHeaderMap::get):
1478         * platform/network/HTTPHeaderMap.h:
1479         * platform/network/HTTPHeaderNames.in:
1480         * plugins/PluginView.cpp:
1481         (WebCore::PluginView::handlePost):
1482
1483 2014-06-13  Commit Queue  <commit-queue@webkit.org>
1484
1485         Unreviewed, rolling out r169939.
1486         https://bugs.webkit.org/show_bug.cgi?id=133878
1487
1488         This patch raises assertions on mac (Requested by fredw on
1489         #webkit).
1490
1491         Reverted changeset:
1492
1493         "Draw radicals with glyphs for better rendering"
1494         https://bugs.webkit.org/show_bug.cgi?id=119038
1495         http://trac.webkit.org/changeset/169939
1496
1497 2014-06-13  Anders Carlsson  <andersca@apple.com>
1498
1499         Add a HTTPHeaderMap::set overload that takes a HTTPHeaderName
1500         https://bugs.webkit.org/show_bug.cgi?id=133874
1501
1502         Reviewed by Tim Horton.
1503
1504         * platform/network/HTTPHeaderMap.cpp:
1505         (WebCore::HTTPHeaderMap::set):
1506         * platform/network/HTTPHeaderMap.h:
1507         * platform/network/cf/ResourceRequestCFNet.cpp:
1508         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
1509         * platform/network/mac/ResourceRequestMac.mm:
1510         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
1511         * xml/XMLHttpRequest.cpp:
1512         (WebCore::XMLHttpRequest::send):
1513
1514 2014-06-13  Anders Carlsson  <andersca@apple.com>
1515
1516         Add a HTTPHeaderMap::find overload that takes a HTTPHeaderName
1517         https://bugs.webkit.org/show_bug.cgi?id=133872
1518
1519         Reviewed by Andreas Kling.
1520
1521         * loader/DocumentLoader.cpp:
1522         (WebCore::DocumentLoader::responseReceived):
1523         * platform/network/HTTPHeaderMap.cpp:
1524         (WebCore::HTTPHeaderMap::get):
1525         (WebCore::HTTPHeaderMap::find):
1526         * platform/network/HTTPHeaderMap.h:
1527         * platform/network/HTTPHeaderNames.in:
1528
1529 2014-06-13  Frédéric Wang  <fred.wang@free.fr>
1530
1531         Draw radicals with glyphs for better rendering
1532         https://bugs.webkit.org/show_bug.cgi?id=119038
1533
1534         Reviewed by Chris Fleizach.
1535
1536         We rewrite RenderMathMLRoot in order to fix bugs with SVG transforms and dynamic modification of children and allow drawing with an OpenType MATH table.
1537         The drawing of the radical sign (without the top bar) is now moved to a RenderMathMLRadicalOperator class inheriting from RenderMathMLOperator.
1538         This class fallbacks to the original drawing with graphic primitives if an OpenType MATH table is not available.
1539
1540         Tests: mathml/opentype/roots-LatinModern.html
1541                mathml/presentation/mroot-transform.html
1542
1543         * CMakeLists.txt: add files to build system.
1544         * WebCore.vcxproj/WebCore.vcxproj: ditto.
1545         * WebCore.vcxproj/WebCore.vcxproj.filters: ditto.
1546         * WebCore.xcodeproj/project.pbxproj: ditto
1547         * css/mathml.css: remove rules for msqrt/mroot. The "script level" in mroot is not incremented by 2 as specified in the spec.
1548         (math, mrow, mfenced, merror, mphantom, mstyle, menclose):
1549         (mroot > *:last-child):
1550         (math, mrow, mfenced, msqrt, mroot, merror, mphantom, mstyle, menclose): Deleted.
1551         (msqrt > *): Deleted.
1552         (mroot): Deleted. This rule was causing bug 126516.
1553         (mroot > * + *): Deleted.
1554         * rendering/RenderObject.h: Add two new isRenderMathML* functions for dynamic casting.
1555         (WebCore::RenderObject::isRenderMathMLRadicalOperator):
1556         (WebCore::RenderObject::isRenderMathMLRootWrapper):
1557         * rendering/mathml/RenderMathMLOperator.cpp: Accept a set of operator dictionary flags, all disabled by default. This is to allow anonymous radicas, which don't have any flag.
1558         isFencedOperator() is now replaced with the more general isAnonymous() since we allow anonymous radical operator fors msqrt/mroot.
1559         (WebCore::RenderMathMLOperator::RenderMathMLOperator):
1560         (WebCore::RenderMathMLOperator::setOperatorFlagFromAttribute):
1561         (WebCore::RenderMathMLOperator::setOperatorPropertiesFromOpDictEntry):
1562         (WebCore::RenderMathMLOperator::SetOperatorProperties):
1563         (WebCore::RenderMathMLOperator::updateTokenContent):
1564         * rendering/mathml/RenderMathMLOperator.h: Allow class to be overriden, redefine the anonymous constructor, remove isFencedOperator().
1565         * rendering/mathml/RenderMathMLRadicalOperator.cpp: Added.
1566         (WebCore::RenderMathMLRadicalOperator::RenderMathMLRadicalOperator):
1567         (WebCore::RenderMathMLRadicalOperator::stretchTo):
1568         (WebCore::RenderMathMLRadicalOperator::SetOperatorProperties):
1569         (WebCore::RenderMathMLRadicalOperator::computePreferredLogicalWidths):
1570         (WebCore::RenderMathMLRadicalOperator::computeLogicalHeight):
1571         (WebCore::RenderMathMLRadicalOperator::paint):
1572         (WebCore::RenderMathMLRadicalOperator::trailingSpaceError):
1573         * rendering/mathml/RenderMathMLRadicalOperator.h: Added.
1574         * rendering/mathml/RenderMathMLRoot.cpp: Rewritten. Some parts to use graphic primitives are moved to RenderMathMLRadicalOperator.cpp.
1575         (WebCore::RenderMathMLRoot::RenderMathMLRoot):
1576         (WebCore::RenderMathMLRoot::baseWrapper):
1577         (WebCore::RenderMathMLRoot::radicalWrapper):
1578         (WebCore::RenderMathMLRoot::indexWrapper):
1579         (WebCore::RenderMathMLRoot::radicalOperator):
1580         (WebCore::RenderMathMLRoot::restructureWrappers):
1581         (WebCore::RenderMathMLRoot::addChild):
1582         (WebCore::RenderMathMLRoot::styleDidChange):
1583         (WebCore::RenderMathMLRoot::updateFromElement):
1584         (WebCore::RenderMathMLRoot::updateStyle):
1585         (WebCore::RenderMathMLRoot::firstLineBaseline):
1586         (WebCore::RenderMathMLRoot::layout):
1587         (WebCore::RenderMathMLRoot::paint):
1588         (WebCore::RenderMathMLRootWrapper::createAnonymousWrapper):
1589         (WebCore::RenderMathMLRootWrapper::removeChildWithoutRestructuring):
1590         (WebCore::RenderMathMLRootWrapper::removeChild):
1591         (WebCore::RenderMathMLRoot::paddingTop): Deleted.
1592         (WebCore::RenderMathMLRoot::paddingBottom): Deleted.
1593         (WebCore::RenderMathMLRoot::paddingLeft): Deleted.
1594         (WebCore::RenderMathMLRoot::paddingRight): Deleted.
1595         (WebCore::RenderMathMLRoot::paddingBefore): Deleted.
1596         (WebCore::RenderMathMLRoot::paddingAfter): Deleted.
1597         (WebCore::RenderMathMLRoot::paddingStart): Deleted.
1598         (WebCore::RenderMathMLRoot::paddingEnd): Deleted.
1599         (WebCore::RenderMathMLRoot::index): Deleted.
1600         * rendering/mathml/RenderMathMLRoot.h: Rewritten.
1601         (WebCore::RenderMathMLRootWrapper::RenderMathMLRootWrapper):
1602
1603 2014-06-12  Anders Carlsson  <andersca@apple.com>
1604
1605         Add overloads of HTTPHeaderMap::find and remove that take enums
1606         https://bugs.webkit.org/show_bug.cgi?id=133823
1607
1608         Reviewed by Sam Weinig.
1609
1610         * WebCore.exp.in:
1611         Update symbols.
1612
1613         * WebCore.xcodeproj/project.pbxproj:
1614         Make HTTPHeaderNames.h private.
1615
1616         * platform/network/HTTPHeaderMap.cpp:
1617         (WebCore::HTTPHeaderMap::contains):
1618         Convert the enum value to a string and call the contains overload that takes a string.
1619
1620         (WebCore::HTTPHeaderMap::remove):
1621         Convert the enum value to a string and call the remove overload that takes a string.
1622
1623         * platform/network/HTTPHeaderMap.h:
1624         Add new overloads taking HTTPHeaderName and mark the versions taking string literals as deleted.
1625
1626         * platform/network/HTTPHeaderNames.in:
1627         Add new header names.
1628
1629         * platform/network/ResourceRequestBase.cpp:
1630         (WebCore::ResourceRequestBase::clearHTTPAuthorization):
1631         (WebCore::ResourceRequestBase::clearHTTPContentType):
1632         (WebCore::ResourceRequestBase::clearHTTPReferrer):
1633         (WebCore::ResourceRequestBase::clearHTTPOrigin):
1634         (WebCore::ResourceRequestBase::clearHTTPUserAgent):
1635         (WebCore::ResourceRequestBase::clearHTTPAccept):
1636         Update functions to use HTTPHeaderName enums.
1637
1638         (WebCore::ResourceRequestBase::isConditional):
1639         (WebCore::ResourceRequestBase::makeUnconditional):
1640         Simplify these.
1641
1642 2014-06-13  Jarek Czekalski  <jarekczek@poczta.onet.pl>
1643
1644         [ATK] Fix text inside "span" block in "a" block was not accessible.
1645         https://bugs.webkit.org/show_bug.cgi?id=132349
1646
1647         Reviewed by Mario Sanchez Prada.
1648
1649         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: Add link role
1650           to the list of roles whose objects always expose atk_text interface.
1651
1652 2014-06-13  Alberto Garcia  <berto@igalia.com>
1653
1654         [GTK] GLContextEGL.cpp: conflicting declaration 'typedef ptrdiff_t GLintptr'
1655         https://bugs.webkit.org/show_bug.cgi?id=133550
1656
1657         Reviewed by Gustavo Noronha Silva.
1658
1659         Cairo includes some definitions from GLX that conflict with the
1660         ones provided by our GLES2 headers (GLintptr, GLsizeiptr).
1661
1662         Since GLContextEGL doesn't use any GLX functions we can safely
1663         disable the inclusion of those functions in that source file.
1664
1665         * platform/graphics/egl/GLContextEGL.cpp:
1666
1667 2014-06-13  Manuel Rego Casasnovas  <rego@igalia.com>
1668
1669         [CSS Grid Layout] Introduce an explicit type for resolved grid positions
1670         https://bugs.webkit.org/show_bug.cgi?id=131732
1671
1672         Reviewed by Sergio Villar Senin.
1673
1674         We were using simple size_t integers to represent resolved grid
1675         positions in our internal data structures. This change allows us to
1676         clarify the code, avoid potential off by one mistakes, and move the
1677         resolving code to a central place.
1678
1679         A new class GridResolvedPosition has been created and the related
1680         methods have been moved there from RenderGrid.
1681         GridSpan is now defined by two GridResolvedPosition, so all the code
1682         using it has been modified to adapt it to GridResolvedPosition.
1683
1684         No new tests as it is already covered by current tests
1685         (fast/css-grid-layout/).
1686
1687         * CMakeLists.txt:
1688         * WebCore.vcxproj/WebCore.vcxproj:
1689         * WebCore.vcxproj/WebCore.vcxproj.filters:
1690         * WebCore.xcodeproj/project.pbxproj:
1691         * css/CSSGridTemplateAreasValue.cpp:
1692         (WebCore::stringForPosition):
1693         * css/CSSParser.cpp:
1694         (WebCore::CSSParser::parseGridTemplateAreasRow):
1695         * css/StyleResolver.cpp:
1696         (WebCore::createImplicitNamedGridLinesFromGridArea):
1697         * rendering/RenderGrid.cpp:
1698         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
1699         (WebCore::RenderGrid::computeNormalizedFractionBreadth):
1700         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
1701         (WebCore::RenderGrid::insertItemIntoGrid):
1702         (WebCore::RenderGrid::placeItemsOnGrid):
1703         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
1704         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
1705         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
1706         (WebCore::RenderGrid::autoPlacementMajorAxisDirection):
1707         (WebCore::RenderGrid::autoPlacementMinorAxisDirection):
1708         (WebCore::RenderGrid::gridAreaBreadthForChild):
1709         (WebCore::RenderGrid::findChildLogicalPosition):
1710         (WebCore::RenderGrid::explicitGridColumnCount): Deleted.
1711         (WebCore::RenderGrid::explicitGridRowCount): Deleted.
1712         (WebCore::isColumnSide): Deleted.
1713         (WebCore::isStartSide): Deleted.
1714         (WebCore::RenderGrid::explicitGridSizeForSide): Deleted.
1715         (WebCore::RenderGrid::resolveGridPositionsFromAutoPlacementPosition): Deleted.
1716         (WebCore::gridLinesForSide): Deleted.
1717         (WebCore::implicitNamedGridLineForSide): Deleted.
1718         (WebCore::isNonExistentNamedLineOrArea): Deleted.
1719         (WebCore::RenderGrid::adjustGridPositionsFromStyle): Deleted.
1720         (WebCore::RenderGrid::resolveGridPositionsFromStyle): Deleted.
1721         (WebCore::RenderGrid::resolveNamedGridLinePositionFromStyle): Deleted.
1722         (WebCore::RenderGrid::resolveGridPositionFromStyle): Deleted.
1723         (WebCore::RenderGrid::resolveGridPositionAgainstOppositePosition): Deleted.
1724         (WebCore::RenderGrid::resolveNamedGridLinePositionAgainstOppositePosition): Deleted.
1725         (WebCore::firstNamedGridLineBeforePosition): Deleted.
1726         (WebCore::RenderGrid::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition): Deleted.
1727         (WebCore::RenderGrid::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition): Deleted.
1728         * rendering/RenderGrid.h:
1729         * rendering/style/GridCoordinate.h:
1730         (WebCore::GridSpan::GridSpan):
1731         (WebCore::GridSpan::operator==):
1732         * rendering/style/GridPosition.h:
1733         (WebCore::GridPosition::adjustGridPositionForRowEndColumnEndSide): Deleted.
1734         (WebCore::GridPosition::adjustGridPositionForSide): Deleted.
1735         * rendering/style/GridResolvedPosition.cpp: Added.
1736         (WebCore::isColumnSide):
1737         (WebCore::isStartSide):
1738         (WebCore::explicitGridSizeForSide):
1739         (WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
1740         (WebCore::gridLinesForSide):
1741         (WebCore::implicitNamedGridLineForSide):
1742         (WebCore::isNonExistentNamedLineOrArea):
1743         (WebCore::GridResolvedPosition::adjustGridPositionsFromStyle):
1744         (WebCore::GridResolvedPosition::resolveGridPositionsFromStyle):
1745         (WebCore::GridResolvedPosition::resolveNamedGridLinePositionFromStyle):
1746         (WebCore::GridResolvedPosition::resolveGridPositionFromStyle):
1747         (WebCore::GridResolvedPosition::resolveGridPositionAgainstOppositePosition):
1748         (WebCore::GridResolvedPosition::resolveNamedGridLinePositionAgainstOppositePosition):
1749         (WebCore::firstNamedGridLineBeforePosition):
1750         (WebCore::GridResolvedPosition::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition):
1751         (WebCore::GridResolvedPosition::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition):
1752         * rendering/style/GridResolvedPosition.h: Added.
1753         (WebCore::GridResolvedPosition::adjustGridPositionForRowEndColumnEndSide):
1754         (WebCore::GridResolvedPosition::adjustGridPositionForSide):
1755         (WebCore::GridResolvedPosition::GridResolvedPosition):
1756         (WebCore::GridResolvedPosition::operator++):
1757         (WebCore::GridResolvedPosition::operator==):
1758         (WebCore::GridResolvedPosition::operator<):
1759         (WebCore::GridResolvedPosition::operator>):
1760         (WebCore::GridResolvedPosition::operator<=):
1761         (WebCore::GridResolvedPosition::operator>=):
1762         (WebCore::GridResolvedPosition::toInt):
1763         (WebCore::GridResolvedPosition::next):
1764
1765 2014-06-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1766
1767         [GTK] Remove all deprecated API from GObject DOM bindings
1768         https://bugs.webkit.org/show_bug.cgi?id=133728
1769
1770         Reviewed by Martin Robinson.
1771
1772         Remove all deprecated symbols from the GObject DOM bindings,
1773         keeping the deprecation infraestructure for future API breaks.
1774
1775         * PlatformGTK.cmake: Remove WebKitDOMDeprecated files from the
1776         build.
1777         * bindings/gobject/WebKitDOMDeprecated.cpp: Removed.
1778         * bindings/gobject/WebKitDOMDeprecated.h: Removed.
1779         * bindings/gobject/WebKitDOMDeprecated.symbols: Removed.
1780         * bindings/gobject/webkitdom.symbols: Updated to the current API.
1781         * bindings/scripts/CodeGeneratorGObject.pm:
1782         (SkipFunction): Remove exceptions for deprecated API.
1783         (GetFunctionDeprecationInformation): Ditto.
1784         (GetEffectiveFunctionName): Ditto.
1785         * bindings/scripts/test/GObject/WebKitDOMTestEventTarget.cpp:
1786         (webkit_dom_test_event_target_dispatch_event): Deleted.
1787         * bindings/scripts/test/GObject/WebKitDOMTestEventTarget.h:
1788         * bindings/scripts/test/GObject/WebKitDOMTestEventTarget.symbols:
1789         * dom/Element.idl: Remove GObject exception.
1790
1791 2014-06-12  Zalan Bujtas  <zalan@apple.com>
1792
1793         Subpixel rendering: Make <input type=> and <button> elements' decoration subpixel aware.
1794         https://bugs.webkit.org/show_bug.cgi?id=133812
1795         <rdar://problem/17286309>
1796
1797         Reviewed by Simon Fraser.
1798
1799         Enable <input type=> and <button> decoration painting on subpixel positions.
1800         The theme size is still integral, but its position is snapped to device pixels.
1801         Theme's label, the InlineTextBox is already subpixel position aware.
1802         webkit.org/b/132005 tracks the rest of the themes.
1803
1804         Not testable.
1805
1806         * accessibility/AccessibilityObject.cpp:
1807         (WebCore::AccessibilityObject::boundingBoxForQuads): Keep integral snapping for now.
1808         * platform/Theme.h:
1809         (WebCore::Theme::paint):
1810         (WebCore::Theme::inflateControlPaintRect):
1811         * platform/mac/ThemeMac.h:
1812         * platform/mac/ThemeMac.mm:
1813         (WebCore::inflateRect):
1814         (WebCore::configureToggleButton):
1815         (WebCore::sharedRadioCell):
1816         (WebCore::sharedCheckboxCell):
1817         (WebCore::paintToggleButton):
1818         (WebCore::setUpButtonCell):
1819         (WebCore::button):
1820         (WebCore::paintButton):
1821         (WebCore::paintStepper):
1822         (WebCore::ThemeMac::inflateControlPaintRect):
1823         (WebCore::ThemeMac::paint):
1824         * rendering/RenderBlock.cpp:
1825         (WebCore::RenderBlock::addVisualOverflowFromTheme): Keep integral snapping for now.
1826         * rendering/RenderFlowThread.cpp:
1827         (WebCore::RenderFlowThread::addRegionsVisualOverflowFromTheme): Keep integral snapping for now.
1828         * rendering/RenderTheme.cpp:
1829         (WebCore::RenderTheme::paint):
1830         (WebCore::RenderTheme::adjustRepaintRect):
1831         * rendering/RenderTheme.h:
1832         * rendering/RenderThemeMac.h:
1833         * rendering/RenderThemeMac.mm:
1834         (WebCore::RenderThemeMac::adjustRepaintRect):
1835
1836 2014-06-12  Brent Fulgham  <bfulgham@apple.com>
1837
1838         [Win] Avoid fork bomb during build
1839         https://bugs.webkit.org/show_bug.cgi?id=133837
1840         <rdar://problem/17296034>
1841
1842         Reviewed by Tim Horton.
1843
1844         * WebCore.vcxproj/build-generated-files.sh: Use a reasonable
1845         default value when the 'num-cpus' script is not available.
1846
1847 2014-06-12  Gavin Barraclough  <barraclough@apple.com>
1848
1849         Add support for thread/WorkQueue QoS
1850         https://bugs.webkit.org/show_bug.cgi?id=130688
1851
1852         Reviewed by Anders Carlson & Simon Fraser.
1853
1854         WebCore's ScrollingThread should be UserInteractive.
1855
1856         * page/scrolling/ScrollingThread.cpp:
1857         (WebCore::ScrollingThread::threadCallback):
1858             - ScrollingThread should be UserInteractive
1859
1860 2014-06-12  Brent Fulgham  <bfulgham@apple.com>
1861
1862         [Mac] Build fix after r169919.
1863
1864         * WebCore.xcodeproj/project.pbxproj: The 'TileController.h' file must be a private header.
1865
1866 2014-06-12  Andy Estes  <aestes@apple.com>
1867
1868         [Mac] Speculative build fix after r169921.
1869
1870         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1871         (WebCore::SourceBufferPrivateAVFObjC::destroyRenderers):
1872
1873 2014-06-12  Jer Noble  <jer.noble@apple.com>
1874
1875         [MSE][Mac] Stop observing the sample buffer renderers when destroying them.
1876         https://bugs.webkit.org/show_bug.cgi?id=133831
1877
1878         Reviewed by Beth Dakin.
1879
1880         Release our retain on our AVSampleBufferDisplayLayer and AVSampleBufferAudioRenderer by stopping
1881         our observation of its properties when removing them from the SourceBufferPrivateAVFObjC object.
1882
1883         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1884         (WebCore::SourceBufferPrivateAVFObjC::destroyRenderers):
1885
1886 2014-06-12  Brent Fulgham  <bfulgham@apple.com>
1887
1888         Correct file locations after r169914. These should have been
1889         in platform/graphics/ca.
1890
1891         Rubberstamped by Tim Horton.
1892
1893         * WebCore.xcodeproj/project.pbxproj:
1894         * platform/graphics/ca/TileController.cpp: Copied from platform/graphics/ca/mac/TileController.cpp.
1895         * platform/graphics/ca/TileController.h: Copied from platform/graphics/ca/mac/TileController.h.
1896         * platform/graphics/ca/TileGrid.cpp: Copied from platform/graphics/ca/mac/TileGrid.cpp.
1897         * platform/graphics/ca/TileGrid.h: Copied from platform/graphics/ca/mac/TileGrid.h.
1898         * platform/graphics/ca/mac/TileController.cpp: Removed.
1899         * platform/graphics/ca/mac/TileController.h: Removed.
1900         * platform/graphics/ca/mac/TileGrid.cpp: Removed.
1901         * platform/graphics/ca/mac/TileGrid.h: Removed.
1902
1903 2014-06-12  Andy Estes  <aestes@apple.com>
1904
1905         Fix the build after r169913.
1906
1907         * loader/HistoryController.cpp:
1908         (WebCore::HistoryController::restoreScrollPositionAndViewState):
1909
1910 2014-06-12  Alex Christensen  <achristensen@webkit.org>
1911
1912         Collect correct web timing data from CFNetwork.
1913         https://bugs.webkit.org/show_bug.cgi?id=133824
1914         <rdar://problem/17273654>
1915
1916         Reviewed by Simon Fraser.
1917
1918         Covered by existing web timing tests.
1919
1920         * platform/network/mac/ResourceHandleMac.mm:
1921         (WebCore::ResourceHandle::getConnectionTimingData):
1922         Use _kCFNTimingDataFetchStart as the reference start time key.
1923
1924 2014-06-12  Brent Fulgham  <bfulgham@apple.com>
1925
1926         Convert TileController and TileGrid from ObjC to C++
1927         https://bugs.webkit.org/show_bug.cgi?id=133819
1928         <rdar://problem/17291841>
1929
1930         Reviewed by Tim Horton.
1931
1932         Convert TileGrid.mm and TileController.mm into C++ implementations. This required creating a 'frameForLayer'
1933         wrapper to call the 'frame' method of the CALayer object.
1934
1935         * WebCore.xcodeproj/project.pbxproj:
1936         * platform/graphics/ca/mac/TileController.cpp: Copied from platform/graphics/ca/mac/TileController.mm.
1937         (WebCore::TileController::blankPixelCountForTiles):
1938         * platform/graphics/ca/mac/TileController.mm: Removed.
1939         * platform/graphics/ca/mac/TileGrid.cpp: Copied from platform/graphics/ca/mac/TileGrid.mm.
1940         * platform/graphics/ca/mac/TileGrid.h:
1941         * platform/graphics/ca/mac/TileGrid.mm: Removed.
1942         * platform/graphics/mac/WebLayer.h:
1943         * platform/graphics/mac/WebLayer.mm:
1944         (WebCore::frameForLayer): Wrapper function to hide ObjC call from C++ compilation unit.
1945
1946 2014-06-12  Simon Fraser  <simon.fraser@apple.com>
1947
1948         [iOS WK2] Fix crash on back/foward swipe
1949         https://bugs.webkit.org/show_bug.cgi?id=133826
1950         <rdar://problem/17032752>
1951
1952         Reviewed by Tim Horton.
1953
1954         AsyncScrollingCoordinator::frameViewForScrollingNode() would crash with a null root
1955         state node, because HistoryController::restoreScrollPositionAndViewState() tried
1956         to restore scroll position (via restoreViewState()) before hooking up the scrolling
1957         coordinator.
1958         
1959         Fix by doing the scrollingCoordinator->frameViewRootLayerDidChange() before
1960         calling restoreViewState().
1961         
1962         Also add a defensive null-check on the root state node in updateScrollPositionAfterAsyncScrollTimerFired().
1963
1964         * loader/HistoryController.cpp:
1965         (WebCore::HistoryController::restoreScrollPositionAndViewState):
1966         * page/scrolling/AsyncScrollingCoordinator.cpp:
1967         (WebCore::AsyncScrollingCoordinator::frameViewForScrollingNode):
1968
1969 2014-06-12  Anders Carlsson  <andersca@apple.com>
1970
1971         Add a space after the comma.
1972
1973         * platform/network/HTTPHeaderMap.cpp:
1974         (WebCore::HTTPHeaderMap::add):
1975
1976 2014-06-12  Anders Carlsson  <andersca@apple.com>
1977
1978         Move header value merging to HTTPHeaderMap
1979         https://bugs.webkit.org/show_bug.cgi?id=133815
1980
1981         Reviewed by Andreas Kling.
1982
1983         * platform/network/HTTPHeaderMap.cpp:
1984         (WebCore::HTTPHeaderMap::set):
1985         (WebCore::HTTPHeaderMap::add):
1986         * platform/network/HTTPHeaderMap.h:
1987         * platform/network/ResourceRequestBase.cpp:
1988         (WebCore::ResourceRequestBase::addHTTPHeaderField):
1989         * platform/network/ResourceResponseBase.cpp:
1990         (WebCore::ResourceResponseBase::addHTTPHeaderField):
1991         * xml/XMLHttpRequest.cpp:
1992         (WebCore::XMLHttpRequest::setRequestHeaderInternal):
1993
1994 2014-06-12  Anders Carlsson  <andersca@apple.com>
1995
1996         Add ShapeValue.cpp and move ShapeValue::isImageValid() there
1997         https://bugs.webkit.org/show_bug.cgi?id=133809
1998
1999         Reviewed by Antti Koivisto.
2000
2001         This gets rid of CachedImage.h (and ResourceRequest and friends) from RenderStyle.h.
2002
2003         * CMakeLists.txt:
2004         * WebCore.vcxproj/WebCore.vcxproj:
2005         * WebCore.vcxproj/WebCore.vcxproj.filters:
2006         * WebCore.xcodeproj/project.pbxproj:
2007         * css/CSSComputedStyleDeclaration.cpp:
2008         (WebCore::shapePropertyValue):
2009         * css/CSSCrossfadeValue.cpp:
2010         * css/CSSFilterImageValue.cpp:
2011         * css/StyleResolver.h:
2012         * page/animation/CSSPropertyAnimation.cpp:
2013         (WebCore::blendFunc):
2014         * rendering/ShapeValue.cpp: Added.
2015         (WebCore::ShapeValue::isImageValid):
2016         * rendering/shapes/ShapeOutsideInfo.cpp:
2017         (WebCore::referenceBox):
2018         (WebCore::ShapeOutsideInfo::computedShape):
2019         (WebCore::ShapeOutsideInfo::isEnabledFor):
2020         * rendering/style/ShapeValue.h:
2021         (WebCore::ShapeValue::type):
2022         (WebCore::ShapeValue::setImage):
2023         (WebCore::ShapeValue::ShapeValue):
2024         (WebCore::ShapeValue::isImageValid): Deleted.
2025
2026 2014-06-12  Zalan Bujtas  <zalan@apple.com>
2027
2028         Subpixel rendering: Make <select> element's decoration subpixel aware.
2029         https://bugs.webkit.org/show_bug.cgi?id=133781
2030         <rdar://problem/17272083>
2031
2032         Reviewed by Simon Fraser.
2033
2034         Enable <select> decoration painting on subpixel positions.
2035         The theme size is still integral, but its position is snapped to device pixels.
2036         Theme's label, the InlineTextBox is already subpixel position aware.
2037         webkit.org/b/132005 tracks the rest of the themes.
2038
2039         Not testable.
2040
2041         * rendering/RenderTheme.cpp:
2042         (WebCore::RenderTheme::paint):
2043         * rendering/RenderTheme.h:
2044         (WebCore::RenderTheme::paintMenuList):
2045         * rendering/RenderThemeMac.h:
2046         * rendering/RenderThemeMac.mm:
2047         (WebCore::inflateRect):
2048         (WebCore::RenderThemeMac::adjustRepaintRect):
2049         (WebCore::RenderThemeMac::paintMenuList):
2050         (WebCore::RenderThemeMac::progressBarRectForBounds):
2051         (WebCore::RenderThemeMac::setPopupButtonCellState):
2052         (WebCore::RenderThemeMac::inflateRect): Deleted.
2053
2054 2014-06-12  Jer Noble  <jer.noble@apple.com>
2055
2056         [MSE][Mac] Crash in MediaSourcePrivateAVFObjC::naturalSize()
2057         https://bugs.webkit.org/show_bug.cgi?id=133789
2058
2059         Reviewed by Eric Carlson.
2060
2061         Add null-check to proctect against being queried for the naturalSize before we have a
2062         m_mediaSourcePrivate.
2063
2064         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2065         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::naturalSize):
2066
2067 2014-06-12  Alberto Garcia  <berto@igalia.com>
2068
2069         [GTK] fails to build with --disable-webgl --disable-accelerated-compositing
2070         https://bugs.webkit.org/show_bug.cgi?id=131267
2071
2072         Reviewed by Philippe Normand.
2073
2074         Add missing headers needed for Float32Array::create().
2075
2076         * Modules/webaudio/AudioBuffer.cpp:
2077
2078 2014-06-12  Sergio Villar Senin  <svillar@igalia.com>
2079
2080         [GTK] REGRESSION: application name is not correctly appended to the UA
2081         https://bugs.webkit.org/show_bug.cgi?id=133793
2082
2083         Reviewed by Carlos Garcia Campos.
2084
2085         We must use a blank to separate the default UA provided by WebKitGtk
2086         from the application name coming from the public API.
2087
2088         Added an extra test case to the API tests to catch regressions.
2089
2090         * platform/gtk/UserAgentGtk.cpp:
2091         (WebCore::standardUserAgent):
2092
2093 2014-06-12  Zan Dobersek  <zdobersek@igalia.com>
2094
2095         WorkerRunLoop::Task::performTask should take in WorkerGlobalScope* to avoid downcasting
2096         https://bugs.webkit.org/show_bug.cgi?id=133616
2097
2098         Reviewed by Andreas Kling.
2099
2100         * workers/WorkerRunLoop.cpp:
2101         (WebCore::WorkerRunLoop::Task::performTask): Demand the context parameter to be a pointer
2102         to WorkerGlobalScope instead of ScriptExecutionContext, avoiding an unnecessary downcast.
2103         In the future this complete code path should use a reference to WorkerGlobalScope instead
2104         of a pointer.
2105         * workers/WorkerRunLoop.h:
2106
2107 2014-06-12  Sergio Villar Senin  <svillar@igalia.com>
2108
2109         [GTK] Unsupported browser in www.icloud.com
2110         https://bugs.webkit.org/show_bug.cgi?id=133403
2111
2112         Reviewed by Martin Robinson.
2113
2114         We claim to be Safari (among others) to ensure maximum
2115         compatibility with existing web sites. Valid Safari UA strings do
2116         always (since Safari 3.0) contain the string "Version/X" before
2117         the "Safari/X" part. We were wrongly only adding it in very
2118         specific cases and we were placing it at the wrong position as it
2119         must precede the "Safari/X" part.
2120
2121         From now on we unconditionally prepend the "Version/X" string to
2122         the "Safari/X" part as we always claim to be Safari. This makes
2123         the NeedsSafariVersion6 quirk invalid. This not only fixes
2124         "unsupported browser" issues in icloud.com, but also in
2125         globalforestwatch.com and live.com among many others.
2126
2127         Apart from that I'm bumping the Safari Version in the UA to 8.0 as
2128         we're already claiming to be "Safari/538.35"" which corresponds to
2129         Safari 8 beta.
2130
2131         * platform/gtk/UserAgentGtk.cpp:
2132         (WebCore::buildUserAgentString):
2133         (WebCore::standardUserAgentForURL):
2134
2135 2014-06-12  Pratik Solanki  <psolanki@apple.com>
2136
2137         Avoid creating a CFData when checking if a resource is file backed
2138         https://bugs.webkit.org/show_bug.cgi?id=133783
2139
2140         Reviewed by Andreas Kling.
2141
2142         Export SharedBuffer::hasPlatformData().
2143
2144         No new tests because no functional changes.
2145
2146         * WebCore.exp.in:
2147         * platform/SharedBuffer.h:
2148
2149 2014-06-11  Myles C. Maxfield  <mmaxfield@apple.com>
2150
2151         SVGGlyphToPathTranslator ASSERTs when encountering a missing glyph in an SVG font
2152         https://bugs.webkit.org/show_bug.cgi?id=133528
2153
2154         Reviewed by Simon Fraser.
2155
2156         Turns out this assertion is benign. We can take an early out of advance() (which
2157         is then handled properly by Font::dashesForIntersectionsWithRect()
2158
2159         Test: svg/custom/skip-underline-missing-glyph.html
2160
2161         * platform/graphics/mac/FontMac.mm:
2162         (WebCore::Font::dashesForIntersectionsWithRect): Rather than skip partial results,
2163         don't skip anything at all to be consistent.
2164         * rendering/svg/SVGTextRunRenderingContext.cpp:
2165         (WebCore::SVGGlyphToPathTranslator::advance): Take an early out to avoid an ASSERT.
2166
2167 2014-06-11  Simon Fraser  <simon.fraser@apple.com>
2168
2169         [iOS WK2] Give WebKitTestRunner a viewport configuration with initial scale=1 for testing
2170         https://bugs.webkit.org/show_bug.cgi?id=133779
2171
2172         Reviewed by Benjamin Poulain.
2173
2174         Add a "testing" viewport configuration with initial scale of 1.
2175
2176         * WebCore.exp.in:
2177         * page/ViewportConfiguration.cpp:
2178         (WebCore::ViewportConfiguration::testingParameters):
2179         * page/ViewportConfiguration.h:
2180
2181 2014-06-11  Pratik Solanki  <psolanki@apple.com>
2182
2183         Keep CFDataRefs in SharedBuffer instead of merging them
2184         https://bugs.webkit.org/show_bug.cgi?id=133775
2185
2186         Reviewed by Alexey Proskuryakov.
2187
2188         Instead of merging the CFDataRefs into one buffer, save them in as CFDataRefs in
2189         SharedBuffer. They will get merged when code calls buffer() later on.
2190
2191         No new tests because no functional changes.
2192
2193         * platform/network/cf/ResourceHandleCFNet.cpp:
2194         (WebCore::ResourceHandle::handleDataArray):
2195
2196 2014-06-11  Alexey Proskuryakov  <ap@apple.com>
2197
2198         editing/selection/selection-in-iframe-removed-crash.html or selection-invalid-offset.html crashes intermittently
2199         https://bugs.webkit.org/show_bug.cgi?id=111521
2200         <rdar://problem/15159351>
2201
2202         Reviewed by Brady Eidson.
2203
2204         Covered by existing tests.
2205
2206         * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::commitData): Bail out if the
2207         load was canceled from under receivedFirstData(). Since this is where we commit the
2208         load, there are ample opportunities for scripts or clients to do anything.
2209
2210 2014-06-11  Zalan Bujtas  <zalan@apple.com>
2211
2212         Subpixel rendering: RenderBox's content clipping should clip on device pixel boundary.
2213         https://bugs.webkit.org/show_bug.cgi?id=133767
2214         <rdar://problem/17272365>
2215
2216         Reviewed by Simon Fraser.
2217
2218         Push RenderBox's content clipping to device pixel boundaries. Integral snapping makes
2219         content cut off prematurely.
2220
2221         Test: fast/inline-block/hidpi-margin-top-with-subpixel-value-and-overflow-hidden.html
2222
2223         * rendering/RenderBox.cpp:
2224         (WebCore::RenderBox::pushContentsClip):
2225
2226 2014-06-11  Anders Carlsson  <andersca@apple.com>
2227
2228         Remove XHRReplayData::addHeader
2229         https://bugs.webkit.org/show_bug.cgi?id=133776
2230
2231         Reviewed by Antti Koivisto.
2232
2233         Just pass the HTTP header map to XHRReplayData::create directly.
2234
2235         * inspector/InspectorResourceAgent.cpp:
2236         (WebCore::InspectorResourceAgent::willLoadXHR):
2237         * inspector/NetworkResourcesData.cpp:
2238         (WebCore::XHRReplayData::create):
2239         (WebCore::XHRReplayData::XHRReplayData):
2240         (WebCore::XHRReplayData::addHeader): Deleted.
2241         * inspector/NetworkResourcesData.h:
2242
2243 2014-06-11  Andy Estes  <aestes@apple.com>
2244
2245         Fix the Mac build.
2246
2247         * WebCore.exp.in: Exported __ZN7WebCore19ResourceRequestBase15setHTTPReferrerERKN3WTF6StringE
2248         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: Moved ivar declarations to @interface to account for the 32-bit legacy runtime.
2249
2250 2014-06-11  Simon Fraser  <simon.fraser@apple.com>
2251
2252         Make FrameView 8 bytes smaller
2253         https://bugs.webkit.org/show_bug.cgi?id=133771
2254
2255         Reviewed by Anders Carlsson.
2256
2257         m_borderX and m_borderY were historical cruft.
2258
2259         * page/FrameView.cpp:
2260         (WebCore::FrameView::reset):
2261         * page/FrameView.h:
2262
2263 2014-06-11  David Kilzer  <ddkilzer@apple.com>
2264
2265         WindowFeatures arguments shoud ignore invalid characters in values
2266         <http://webkit.org/b/133703>
2267         <rdar://problem/17254118>
2268
2269         Reviewed by Andy Estes.
2270
2271         Test: fast/dom/Window/window-property-invalid-characters-ignored.html
2272
2273         * page/WindowFeatures.cpp:
2274         (WebCore::WindowFeatures::WindowFeatures): Set |length| based on
2275         |buffer|, not |features|.  Switch to using a for loop.  Switch
2276         to unsigned types since we are working with positive offsets
2277         into a String.
2278
2279 2014-06-11  David Kilzer  <ddkilzer@apple.com>
2280
2281         Viewport arguments should ignore invalid characters in values
2282         <http://webkit.org/b/133555>
2283         <rdar://problem/17179650>
2284
2285         Reviewed by Daniel Bates.
2286
2287         Test: fast/viewport/viewport-warnings-7.html
2288
2289         * dom/Document.cpp:
2290         (WebCore::Document::processArguments): Set |length| based on
2291         |buffer|, not |features|.  Switch to using a for loop.  Switch
2292         to unsigned types since we are working with positive offsets
2293         into a String.
2294
2295 2014-06-11  Anders Carlsson  <andersca@apple.com>
2296
2297         Move some HTTP header field accessors to ResourceRequestBase.cpp
2298         https://bugs.webkit.org/show_bug.cgi?id=133773
2299
2300         Reviewed by Andreas Kling.
2301
2302         This will avoid having to include HTTPHeaderNames.h from ResourceRequestBase.h.
2303
2304         * platform/network/ResourceRequestBase.cpp:
2305         (WebCore::ResourceRequestBase::httpContentType):
2306         (WebCore::ResourceRequestBase::setHTTPContentType):
2307         (WebCore::ResourceRequestBase::httpReferrer):
2308         (WebCore::ResourceRequestBase::setHTTPReferrer):
2309         (WebCore::ResourceRequestBase::httpOrigin):
2310         (WebCore::ResourceRequestBase::setHTTPOrigin):
2311         (WebCore::ResourceRequestBase::httpUserAgent):
2312         (WebCore::ResourceRequestBase::setHTTPUserAgent):
2313         (WebCore::ResourceRequestBase::httpAccept):
2314         (WebCore::ResourceRequestBase::setHTTPAccept):
2315         * platform/network/ResourceRequestBase.h:
2316         (WebCore::ResourceRequestBase::httpContentType): Deleted.
2317         (WebCore::ResourceRequestBase::setHTTPContentType): Deleted.
2318         (WebCore::ResourceRequestBase::httpReferrer): Deleted.
2319         (WebCore::ResourceRequestBase::setHTTPReferrer): Deleted.
2320         (WebCore::ResourceRequestBase::httpOrigin): Deleted.
2321         (WebCore::ResourceRequestBase::setHTTPOrigin): Deleted.
2322         (WebCore::ResourceRequestBase::httpUserAgent): Deleted.
2323         (WebCore::ResourceRequestBase::setHTTPUserAgent): Deleted.
2324         (WebCore::ResourceRequestBase::httpAccept): Deleted.
2325         (WebCore::ResourceRequestBase::setHTTPAccept): Deleted.
2326
2327 2014-06-11  Anders Carlsson  <andersca@apple.com>
2328
2329         Remove some more unneeded member functions from HTTPHeaderMap
2330         https://bugs.webkit.org/show_bug.cgi?id=133768
2331
2332         Reviewed by Simon Fraser.
2333
2334         * loader/CrossOriginAccessControl.cpp:
2335         (WebCore::createAccessControlPreflightRequest):
2336         * platform/network/HTTPHeaderMap.cpp:
2337         (WebCore::HTTPHeaderMap::find): Deleted.
2338         (WebCore::HTTPHeaderMap::keys): Deleted.
2339         * platform/network/HTTPHeaderMap.h:
2340
2341 2014-06-11  Jer Noble  <jer.noble@apple.com>
2342
2343         Unreviwed Mac release build fix; mark the keyPath parameter as unused.
2344
2345         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2346         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
2347
2348 2014-06-11  Brent Fulgham  <bfulgham@apple.com>
2349
2350         [Win] Avoid deadlock with AVFoundation
2351         https://bugs.webkit.org/show_bug.cgi?id=133762
2352         <rdar://problem/17128248>
2353
2354         Reviewed by Eric Carlson.
2355
2356         Always invoke our notifications asynchronously so that we do not
2357         execute long-running code while holding the AVFWrapper map mutex
2358         lock. AVFoundationCF callbacks can deadlock if we call into AVF
2359         while holding this lock.
2360
2361
2362         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2363         (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification):
2364
2365 2014-06-11  Csaba Osztrogonác  <ossy@webkit.org>
2366
2367         [CMake] One more URTBF after r169826.
2368
2369         * CMakeLists.txt: Generate files to the proper place.
2370
2371 2014-06-11  Csaba Osztrogonác  <ossy@webkit.org>
2372
2373         [CMake]URTBF after r169826.
2374
2375         * CMakeLists.txt: Typo fix.
2376
2377 2014-06-11  Anders Carlsson  <andersca@apple.com>
2378
2379         Get rid of an unneeded HTTPHeaderMap::remove overload
2380         https://bugs.webkit.org/show_bug.cgi?id=133763
2381
2382         Reviewed by Andreas Kling.
2383
2384         Change HTTPHeaderMap::remove to return whether an entry was removed or not and simplify
2385         ResourceRequestBase::clearHTTPAuthorization.
2386
2387         * platform/network/HTTPHeaderMap.cpp:
2388         (WebCore::HTTPHeaderMap::remove):
2389         * platform/network/HTTPHeaderMap.h:
2390         * platform/network/ResourceRequestBase.cpp:
2391         (WebCore::ResourceRequestBase::clearHTTPAuthorization):
2392
2393 2014-06-11  Jer Noble  <jer.noble@apple.com>
2394
2395         [EME][Mac] Propagate errors from AVSampleBufferDisplayLayer through to MSE
2396         https://bugs.webkit.org/show_bug.cgi?id=133747
2397
2398         Reviewed by Eric Carlson.
2399
2400         Abstract out the delivery of errors in MediaKeySession into its own method, which can be triggered by 
2401         CDMSession objects through the CDMSessionClient interface:
2402         * Modules/encryptedmedia/MediaKeySession.cpp:
2403         (WebCore::MediaKeySession::keyRequestTimerFired):
2404         (WebCore::MediaKeySession::addKeyTimerFired):
2405         (WebCore::MediaKeySession::sendMessage):
2406         (WebCore::MediaKeySession::sendError):
2407         * Modules/encryptedmedia/MediaKeySession.h:
2408         * Modules/mediasource/SourceBuffer.cpp:
2409         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError):
2410         * Modules/mediasource/SourceBuffer.h:
2411         * platform/graphics/SourceBufferPrivateClient.h:
2412         * platform/graphics/CDMSession.h:
2413
2414         Add an Objective-C object which can listen for error KVO notifications:
2415         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2416         (WebCore::SourceBufferPrivateAVFObjCErrorClient::~SourceBufferPrivateAVFObjCErrorClient):
2417         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2418         (-[WebAVSampleBufferErrorListener initWithParent:WebCore::]):
2419         (-[WebAVSampleBufferErrorListener dealloc]):
2420         (-[WebAVSampleBufferErrorListener invalidate]):
2421         (-[WebAVSampleBufferErrorListener beginObservingLayer:]):
2422         (-[WebAVSampleBufferErrorListener stopObservingLayer:]):
2423         (-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
2424         (-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
2425         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
2426         (-[WebAVSampleBufferErrorListener layerFailedToDecode:]):
2427         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
2428         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
2429         (WebCore::SourceBufferPrivateAVFObjC::registerForErrorNotifications):
2430         (WebCore::SourceBufferPrivateAVFObjC::unregisterForErrorNotifications):
2431         (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
2432         (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError):
2433
2434         Register for the new error notifications:
2435         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
2436         (WebCore::CDMSessionMediaSourceAVFObjC::~CDMSessionMediaSourceAVFObjC): Moved to source file.
2437         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
2438         (WebCore::CDMSessionMediaSourceAVFObjC::CDMSessionMediaSourceAVFObjC): Register for error notifications.
2439         (WebCore::CDMSessionMediaSourceAVFObjC::~CDMSessionMediaSourceAVFObjC): Unregister for error notifications.
2440         (WebCore::CDMSessionMediaSourceAVFObjC::layerDidReceiveError): Pass through to CDMSessionClient.
2441         (WebCore::CDMSessionMediaSourceAVFObjC::rendererDidReceiveError): Ditto.
2442
2443 2014-06-11  Andreas Kling  <akling@apple.com>
2444
2445         Don't force CharacterData to override getOwnPropertySlot.
2446         <https://webkit.org/b/133717>
2447
2448         This was preventing us from taking the GetByVal fast path for Text nodes
2449         since they inherit from CharacterData and having a "length" attribute
2450         meant we gave them a custom getOwnPropertySlot, despite not actually
2451         needing it for anything.
2452
2453         Reviewed by Anders Carlsson.
2454
2455         * bindings/scripts/CodeGeneratorJS.pm:
2456         (AttributeShouldBeOnInstance):
2457
2458 2014-06-11  Anders Carlsson  <andersca@apple.com>
2459
2460         Add a script that generates a gperf hash for HTTP header names
2461         https://bugs.webkit.org/show_bug.cgi?id=133760
2462
2463         Reviewed by Andreas Kling.
2464
2465         This is the first step towards getting rid of AtomicString from HTTPHeaderMap.
2466
2467         * CMakeLists.txt:
2468         * DerivedSources.make:
2469         * WebCore.vcxproj/WebCore.vcxproj:
2470         * WebCore.xcodeproj/project.pbxproj:
2471         * platform/network/HTTPHeaderNames.in: Added.
2472         * platform/network/create-http-header-name-table: Added.
2473         (HTTPHeaderName):
2474
2475 2014-06-11  Brent Fulgham  <bfulgham@apple.com>
2476
2477         ROLLOUT: r153510: Broke Table borders on Wikipedia
2478         https://bugs.webkit.org/show_bug.cgi?id=132802
2479         <rdar://problem/16792562>
2480
2481         * rendering/RenderTableCell.cpp:
2482         (WebCore::RenderTableCell::paintCollapsedBorders):
2483         (WebCore::RenderTableCell::alignLeftRightBorderPaintRect): Deleted.
2484         (WebCore::RenderTableCell::alignTopBottomBorderPaintRect): Deleted.
2485         * rendering/RenderTableCell.h:
2486
2487 2014-06-11  peavo@outlook.com  <peavo@outlook.com>
2488
2489         [Curl] Empty headers in request response.
2490         https://bugs.webkit.org/show_bug.cgi?id=133483
2491
2492         Reviewed by Brent Fulgham.
2493
2494         When a request is taken from the cache, its cached response headers are empty, if the cache entry was created in the same session.
2495         It is only when the cache entry is loaded from disc, that the response headers are properly set.
2496         We need to set the cached response headers in both cases.
2497         There is also an issue if two jobs are loading the same url at the same time.
2498         Both jobs will then write to the cache content file, and create invalid content.
2499         This can be fixed by only letting the first request write to the content file.
2500
2501         * platform/network/curl/CurlCacheEntry.cpp:
2502         (WebCore::CurlCacheEntry::CurlCacheEntry):
2503         (WebCore::CurlCacheEntry::isLoading): Added method to check if cache entry is loading the content.
2504         (WebCore::CurlCacheEntry::saveResponseHeaders): Set the cached response headers when response is saved.
2505         (WebCore::CurlCacheEntry::invalidate): To be on the safe side, close content file when entry is invalidated.
2506         (WebCore::CurlCacheEntry::parseResponseHeaders): Made parameter const.
2507         * platform/network/curl/CurlCacheEntry.h: Keep track of which job is creating this cache entry.
2508         (WebCore::CurlCacheEntry::getJob):
2509         * platform/network/curl/CurlCacheManager.cpp:
2510         (WebCore::CurlCacheManager::loadIndex): When cache entry is loaded from disc, there is no associated job.
2511         (WebCore::CurlCacheManager::didReceiveResponse): Bail out if cache entry is already currently loading,
2512         otherwise associate this job with the new cache entry.
2513         (WebCore::CurlCacheManager::didFinishLoading): Changed parameter type.
2514         (WebCore::CurlCacheManager::isCached): Don't report the url as cached if it's currently loading content.
2515         (WebCore::CurlCacheManager::didReceiveData): Don't write to the content file if the entry is not associated with the job.
2516         (WebCore::CurlCacheManager::didFail): Changed parameter type.
2517         * platform/network/curl/CurlCacheManager.h: Changed parameter type.
2518         * platform/network/curl/ResourceHandleManager.cpp: Ditto.
2519         (WebCore::writeCallback):
2520         (WebCore::ResourceHandleManager::downloadTimerCallback):
2521
2522 2014-06-11  Sam Weinig  <sam@webkit.org>
2523
2524         REGRESSION (r133705): Layout Test js/dom/webidl-type-mapping.html is failing
2525         https://bugs.webkit.org/show_bug.cgi?id=133736
2526
2527         * bindings/scripts/CodeGeneratorJS.pm:
2528         (GenerateImplementation):
2529         Turns out we can't remove the HashTable yet after all, as JavaScriptCore
2530         relies on hasSetterOrReadonlyProperties bit to make put work correctly. We
2531         can, however, skip creating the table, and just use the value array during
2532         reification. 
2533
2534 2014-06-11  Chris Fleizach  <cfleizach@apple.com>
2535
2536         AX: iOS: VoiceOver ignores input type = date in Safari on iOS7
2537         https://bugs.webkit.org/show_bug.cgi?id=133709
2538
2539         Reviewed by Mario Sanchez Prada.
2540
2541         The date field on iOS appears as a popup button, which is not a type we had encountered for <input> types.
2542         This returns an appropriate role in that case.
2543
2544         * accessibility/AccessibilityRenderObject.cpp:
2545         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2546
2547 2014-06-11  Zan Dobersek  <zdobersek@igalia.com>
2548
2549         Avoid FontGlyphsCacheKey copy in FontGlyphsCacheEntry constructor
2550         https://bugs.webkit.org/show_bug.cgi?id=133674
2551
2552         Reviewed by Andreas Kling.
2553
2554         * platform/graphics/Font.cpp:
2555         (WebCore::FontGlyphsCacheEntry::FontGlyphsCacheEntry): The FontGlyphsCacheKey
2556         variable is already passed-in as an rvalue reference, so it should be moved
2557         into the constructor of the corresponding member variable instead of copied.
2558
2559 2014-06-11  Andy Estes  <aestes@apple.com>
2560
2561         Fix the build after after r169789 on platforms that build with -Wunused-const-variable
2562
2563         * bindings/scripts/CodeGeneratorJS.pm:
2564         (GenerateHashTable): Don't create the value array if it'll never be used.
2565
2566 2014-06-11  Carlos Garcia Campos  <cgarcia@igalia.com>
2567
2568         [GTK] Use a different user agent string depending on the site
2569         https://bugs.webkit.org/show_bug.cgi?id=132681
2570
2571         Reviewed by Anders Carlsson.
2572
2573         We have changed the user agent string several times to try to fix
2574         broken websites that require specific things in the UA string to
2575         properly work. But everytime we change the UA string to fix a
2576         website we break others. We could use different UA string
2577         depending on the website. UserAgentGtk code has also been cleaned
2578         up, using NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL
2579         and avoiding unneeded conversions to UTF-8.
2580
2581         * platform/gtk/UserAgentGtk.cpp:
2582         (WebCore::UserAgentQuirks::UserAgentQuirks): New helper private
2583         class to handle user agent quirks.
2584         (WebCore::UserAgentQuirks::add):
2585         (WebCore::UserAgentQuirks::contains):
2586         (WebCore::UserAgentQuirks::isEmpty):
2587         (WebCore::platformForUAString): Bring back this method that was
2588         removed to always pretend to be Macintosh.
2589         (WebCore::platformVersionForUAString): Return a different platform
2590         version depending on the actual platform.
2591         (WebCore::versionForUAString): Return the WebKit version.
2592         (WebCore::buildUserAgentString): Helper function to build the user
2593         agent taking into account the UserAgentQuirks received.
2594         (WebCore::standardUserAgentStatic): Standard user agent string
2595         when no quirks are present.
2596         (WebCore::standardUserAgent):
2597         (WebCore::standardUserAgentForURL): New method that returns the
2598         user agent string for the given URL.
2599         * platform/gtk/UserAgentGtk.h:
2600
2601 2014-06-11  Alex Christensen  <achristensen@webkit.org>
2602
2603         [Win] Unreviewed build fix.
2604
2605         * platform/network/curl/ResourceRequest.h:
2606         Include missing PassOwnPtr.h.
2607
2608 2014-06-10  Sam Weinig  <sam@webkit.org>
2609
2610         Actually only generate tables for History and Location.
2611
2612         * bindings/scripts/CodeGeneratorJS.pm:
2613         (GenerateImplementation):
2614
2615 2014-06-10  Sam Weinig  <sam@webkit.org>
2616
2617         Attempt to fix the tests.
2618
2619         * bindings/scripts/CodeGeneratorJS.pm:
2620         (GenerateImplementation):
2621         Keep generating HashTables for History and Location, since they use them in
2622         their custom getOwnPropertySlot delegates.
2623
2624 2014-06-10  Benjamin Poulain  <benjamin@webkit.org>
2625
2626         [iOS][WK2] ScrollingTreeOverflowScrollingNode does not use asynchronous touch dispatch
2627         https://bugs.webkit.org/show_bug.cgi?id=133702
2628
2629         Reviewed by Simon Fraser.
2630
2631         * page/scrolling/ScrollingTree.h:
2632         (WebCore::ScrollingTree::scrollingTreeNodeWillStartPanGesture):
2633
2634 2014-06-10  Benjamin Poulain  <benjamin@webkit.org>
2635
2636         Reduce the overhead of updating the animatable style on ARMv7
2637         https://bugs.webkit.org/show_bug.cgi?id=133618
2638
2639         Reviewed by Simon Fraser.
2640
2641         While updating the style for animations, most of the time spent was pure calling overhead.
2642
2643         This patch should reduce this a bit on ARMv7:
2644         1) Get the frame directly from the document instead of document->view->framview->frame.
2645         2) Inline RenderObject::animation(). This is just 3 loads, setting up the registers on the call
2646            site is more expensive than loading the values directly.
2647         3) Inline RenderElement::setAnimatableStyle(). It has only one call site and the call is mostly
2648            overhead.
2649
2650         * css/CSSComputedStyleDeclaration.cpp:
2651         * rendering/RenderElement.cpp:
2652         (WebCore::RenderElement::setAnimatableStyle): Deleted.
2653         * rendering/RenderElement.h:
2654         (WebCore::RenderElement::setAnimatableStyle):
2655         * rendering/RenderObject.cpp:
2656         (WebCore::RenderObject::adjustRectForOutlineAndShadow):
2657         (WebCore::RenderObject::animation): Deleted.
2658         * rendering/RenderObject.h:
2659         (WebCore::RenderObject::animation):
2660         * rendering/RenderView.h:
2661         (WebCore::RenderObject::frame):
2662
2663 2014-06-10  Sam Weinig  <sam@webkit.org>
2664
2665         Don't create a HashTable for JSObjects that use eager reification
2666         https://bugs.webkit.org/show_bug.cgi?id=133705
2667
2668         Reviewed by Geoffrey Garen.
2669
2670         It is unnecessary to create the CompactHashIndex or HashTable for JSObjects
2671         that use eager reification, since we will never look up properties directly.
2672         Instead, we can iterate the HashTableValue array directly during reification.
2673
2674         * bindings/scripts/CodeGeneratorJS.pm:
2675         (GenerateImplementation):
2676         Only generate the value array for prototypes that use eager reification.
2677
2678         (GenerateHashTableValueArray):
2679         Extract out into a helper.
2680
2681         (GenerateHashTable):
2682         Add a parameter, $justGenerateValueArray, that if true, means we only
2683         should generate the value array. 
2684
2685         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2686         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2687         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2688         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2689         * bindings/scripts/test/JS/JSTestException.cpp:
2690         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2691         * bindings/scripts/test/JS/JSTestInterface.cpp:
2692         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2693         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2694         * bindings/scripts/test/JS/JSTestNode.cpp:
2695         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2696         * bindings/scripts/test/JS/JSTestObj.cpp:
2697         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2698         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2699         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2700         * bindings/scripts/test/JS/JSattribute.cpp:
2701         * bindings/scripts/test/JS/JSreadonly.cpp:
2702
2703 2014-06-10  Chris Fleizach  <cfleizach@apple.com>
2704
2705         AX: iOS: Return the language for attributed text marker queries
2706         https://bugs.webkit.org/show_bug.cgi?id=133682
2707
2708         Reviewed by Mario Sanchez Prada.
2709
2710         Add language to the list of objects being returned for attributed text.
2711
2712         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2713         (AXAttributeStringSetLanguage):
2714         (AXAttributedStringAppendText):
2715
2716 2014-06-10  Dan Bernstein  <mitz@apple.com>
2717
2718         WebCore part of [Cocoa] Handling authentication challenges should not require multiple delegate methods
2719         https://bugs.webkit.org/show_bug.cgi?id=133697
2720
2721         Reviewed by Anders Carlsson.
2722
2723         * platform/network/AuthenticationClient.h: Declared new virtual member functions for
2724         requesting default handling of a challenge and rejecting a challenge.
2725         * platform/network/ResourceHandle.h: Override new AuthenticationClient functions.
2726         * platform/network/cf/ResourceHandleCFNet.cpp:
2727         (WebCore::ResourceHandle::receivedRequestToPerformDefaultHandling): Added. Calls
2728         CFURLConnectionPerformDefaultHandlingForChallenge.
2729         (WebCore::ResourceHandle::receivedChallengeRejection): Added. Calls
2730         CFURLConnectionRejectChallenge.
2731         * platform/network/cf/SocketStreamHandle.h: Override new AuthenticationClient functions.
2732         * platform/network/cf/SocketStreamHandleCFNet.cpp:
2733         (WebCore::SocketStreamHandle::receivedRequestToPerformDefaultHandling): Added empty
2734         override.
2735         (WebCore::SocketStreamHandle::receivedChallengeRejection): Ditto.
2736
2737 2014-06-09  Brent Fulgham  <bfulgham@apple.com>
2738
2739         REGRESSION (r167962): Out of bounds read in JSC::StructureIDTable::get()
2740         https://bugs.webkit.org/show_bug.cgi?id=133463
2741         <rdar://problem/17098100>
2742
2743         Reviewed by Geoffrey Garen.
2744
2745         Revise MediaControllerHost implementation so that instead of holding its
2746         own pointer to the JS Controller object, it uses new properties added to
2747         the internal media controls DOM hierarchy. This allows the GC to see the
2748         needed lifecycle of the various media control objects and avoids the
2749         premature deallocation that caused this bug.
2750  
2751         * Modules/mediacontrols/MediaControlsHost.h:
2752         (WebCore::MediaControlsHost::controllerJSValue): Deleted.
2753         (WebCore::MediaControlsHost::setControllerJSValue): Deleted.
2754         * html/HTMLMediaElement.cpp:
2755         (WebCore::HTMLMediaElement::controllerJSValue): Added convenience function
2756         to share logic for retrieving the controller object.
2757         (WebCore::HTMLMediaElement::updateCaptionContainer): Revise to use new method
2758         for accessing the controller.
2759         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot): Connect the media
2760         elements JS wrapper object to the MediaControlsHost JS wrapper. Then connect
2761         the MediaControlsHost JS wrapper to the Controller JS object.
2762         (WebCore::HTMLMediaElement::pageScaleFactorChanged): Revise to use new method
2763         for accessing the controller.
2764
2765 2014-06-10  Myles C. Maxfield  <mmaxfield@apple.com>
2766
2767         Japanese text in Google search is rendered too low and clipped
2768         https://bugs.webkit.org/show_bug.cgi?id=133595
2769
2770         Reviewed by Simon Fraser.
2771
2772         This is a revert of r155324.
2773
2774         By forcing line-height to be normal, r155324 was forcing WebKit to inspect font metrics
2775         to determine the height of a line. This means that if a fallback font was required to
2776         draw a line of text, and the fallback font had a higher ascent than the primary font,
2777         the entire line of text would be pushed down. If we don't force line-height to be normal,
2778         then we use the line-height value instead, which short circuits this mechanism, thereby
2779         not pushing text down.
2780
2781         No new tests (because this is simply a revert)
2782
2783         * css/html.css:
2784         (input): Deleted.
2785
2786 2014-06-10  Zalan Bujtas  <zalan@apple.com>
2787
2788         REGRESSION (r167937): Do not use effective zoom factor while resolving media query's min-, max-(device)width/height values.
2789         https://bugs.webkit.org/show_bug.cgi?id=133681
2790
2791         Reviewed by Simon Fraser.
2792
2793         We lost the default multiplier(zoom) value of 1 with r167937 at template<typename T> T computeLength().
2794         Now MediaQueryEvaluator takes the current page zoom factor into account while resolving min-, max- width values.
2795
2796         This patch explicitly sets the multiplier value to 1 to ensure zoom independent media query value resolving.
2797
2798         Test: fast/media/media-query-with-scaled-content.html
2799
2800         * css/CSSToLengthConversionData.cpp:
2801         (WebCore::CSSToLengthConversionData::viewportWidthFactor):
2802         (WebCore::CSSToLengthConversionData::viewportHeightFactor):
2803         * css/CSSToLengthConversionData.h:
2804         * css/MediaQueryEvaluator.cpp:
2805         (WebCore::MediaQueryEvaluator::eval):
2806         * testing/Internals.cpp:
2807         (WebCore::Internals::setPageZoomFactor):
2808         * testing/Internals.h:
2809         * testing/Internals.idl:
2810
2811 2014-06-10  Simon Fraser  <simon.fraser@apple.com>
2812
2813         https://bugs.webkit.org/show_bug.cgi?id=133694
2814
2815         Revert the part of r169733 that caused this test to start failing.
2816
2817         * rendering/RenderLayerCompositor.cpp:
2818         (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
2819
2820 2014-06-10  Timothy Horton  <timothy_horton@apple.com>
2821
2822         Factor repeated CFRunLoopObserver code out
2823         https://bugs.webkit.org/show_bug.cgi?id=133690
2824
2825         Reviewed by Simon Fraser.
2826
2827         * WebCore.exp.in:
2828         * WebCore.xcodeproj/project.pbxproj:
2829         * platform/cf/RunLoopObserver.cpp: Added.
2830         (WebCore::RunLoopObserver::create):
2831         (WebCore::RunLoopObserver::~RunLoopObserver):
2832         (WebCore::RunLoopObserver::runLoopObserverFired):
2833         (WebCore::RunLoopObserver::schedule):
2834         (WebCore::RunLoopObserver::invalidate):
2835         * platform/cf/RunLoopObserver.h: Added.
2836         (WebCore::RunLoopObserver::isScheduled):
2837         (WebCore::RunLoopObserver::RunLoopObserver):
2838         Factor CFRunLoopObserver management code out of LayerFlushScheduler and WebKit2.
2839
2840         * platform/graphics/ca/LayerFlushScheduler.h:
2841         * platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp:
2842         (WebCore::LayerFlushScheduler::LayerFlushScheduler):
2843         (WebCore::LayerFlushScheduler::~LayerFlushScheduler):
2844         (WebCore::LayerFlushScheduler::layerFlushCallback):
2845         (WebCore::LayerFlushScheduler::schedule):
2846         (WebCore::LayerFlushScheduler::invalidate):
2847         (WebCore::LayerFlushScheduler::runLoopObserverCallback): Deleted.
2848         Make use of WebCore::RunLoopObserver.
2849
2850 2014-06-10  Simon Fraser  <simon.fraser@apple.com>
2851
2852         Modernize loop code in scrolling tree code
2853         https://bugs.webkit.org/show_bug.cgi?id=133688
2854
2855         Reviewed by Anders Carlsson.
2856
2857         Use new loop syntax for walking children.
2858
2859         * page/scrolling/ScrollingStateNode.cpp:
2860         (WebCore::ScrollingStateNode::cloneAndResetChildren):
2861         (WebCore::ScrollingStateNode::removeChild):
2862         (WebCore::ScrollingStateNode::willBeRemovedFromStateTree):
2863         (WebCore::ScrollingStateNode::dump):
2864         * page/scrolling/ScrollingTreeNode.cpp:
2865         (WebCore::ScrollingTreeNode::removeChild):
2866         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2867         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
2868
2869 2014-06-10  Anders Carlsson  <andersca@apple.com>
2870
2871         Add -[WKWebView evaluateJavaScript:completionHandler:]
2872         https://bugs.webkit.org/show_bug.cgi?id=133689
2873         <rdar://problem/17152685>
2874
2875         Reviewed by Geoffrey Garen.
2876
2877         * English.lproj/Localizable.strings:
2878         Add new localizable strings.
2879
2880 2014-06-10  Antti Koivisto  <antti@apple.com>
2881
2882         Serialize ResourceRequests without platform request
2883         https://bugs.webkit.org/show_bug.cgi?id=133679
2884
2885         Reviewed by Alexey Proskuryakov.
2886
2887         We create platform requests in the web process just so we can serialize them. This is unnecessary work.
2888
2889         * platform/network/ResourceRequestBase.h:
2890         (WebCore::ResourceRequestBase::encodingRequiresPlatformData):
2891         (WebCore::ResourceRequestBase::encodeWithoutPlatformData):
2892         (WebCore::ResourceRequestBase::decodeWithoutPlatformData):
2893         
2894             Add encoding and decoding functions here to avoid exposing internals.
2895
2896         * platform/network/cf/ResourceRequest.h:
2897         (WebCore::ResourceRequest::encodingRequiresPlatformData):
2898         
2899             Allow encoding without platform data if it hasn't been created yet and there is no request body.
2900
2901 2014-06-10  Brady Eidson  <beidson@apple.com>
2902
2903         Send more context about text selection to telephone number scanner
2904         <rdar://problem/16874385> and https://bugs.webkit.org/show_bug.cgi?id=133684
2905
2906         Reviewed by Enrica Casucci.
2907
2908         * dom/Range.cpp:
2909         (WebCore::rangesOverlap):Add a utility to check if two ranges overlap.
2910         * dom/Range.h:
2911         
2912         * editing/Editor.cpp:
2913         (WebCore::Editor::scanSelectionForTelephoneNumbers): Create a range that is wider than the 
2914           actual selection to search for phone numbers that are not completely selected yet.
2915
2916 2014-06-10  Alex Christensen  <achristensen@webkit.org>
2917
2918         [iOS] Another unreviewed build fix after r169746.
2919
2920         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2921         Prevent another unused value error.
2922
2923 2014-06-10  Alex Christensen  <achristensen@webkit.org>
2924
2925         [iOS] Unreviewed build fix after r169746.
2926
2927         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2928         (WebCore::MemoryPressureHandler::respondToMemoryPressure):
2929         Protect startTime with !PLATFORM(IOS) to prevent a unused variable build error.
2930
2931 2014-06-10  Chris Fleizach  <cfleizach@apple.com>
2932
2933         AX: WK2: iOS: text editing does not work
2934         https://bugs.webkit.org/show_bug.cgi?id=133666
2935
2936         Reviewed by Mario Sanchez Prada.
2937
2938         In WK2, all the text editing is handled by the WebProcess, so selectedTextRange and setSelectedTextRange
2939         need to be implemented, as well as posting the right value change notification.
2940
2941         * accessibility/ios/AXObjectCacheIOS.mm:
2942         (WebCore::AXObjectCache::postPlatformNotification):
2943         * accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
2944         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2945         (-[WebAccessibilityObjectWrapper postValueChangedNotification]):
2946         (-[WebAccessibilityObjectWrapper _accessibilitySelectedTextRange]):
2947         (-[WebAccessibilityObjectWrapper _accessibilitySetSelectedTextRange:]):
2948
2949 2014-06-10  Andreas Kling  <akling@apple.com>
2950
2951         [iOS WebKit2] Stay in "memory pressure" mode until told otherwise.
2952         <https://webkit.org/b/133671>
2953
2954         When we receive the first memory pressure signal, flip the flag in
2955         MemoryPressureHandler so that isUnderMemoryPressure() returns true
2956         from then on, until the system tells us pressure levels are back
2957         to normal.
2958
2959         The hold-off mechanism is disabled for iOS, that wasn't actually
2960         needed in the first place, since the system is not going to spam
2961         you with tons of notifications.
2962
2963         Also propagate the "critical" flag all the way from the system
2964         to the pressure handler. Note that we don't actually do anything
2965         differently based on the flag yet.
2966
2967         Reviewed by Sam Weinig.
2968
2969         * platform/MemoryPressureHandler.cpp:
2970         (WebCore::MemoryPressureHandler::respondToMemoryPressure):
2971         * platform/MemoryPressureHandler.h:
2972         (WebCore::MemoryPressureHandler::setUnderMemoryPressure):
2973         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2974         (WebCore::MemoryPressureHandler::install):
2975         (WebCore::MemoryPressureHandler::respondToMemoryPressure):
2976
2977 2014-06-10  Simon Fraser  <simon.fraser@apple.com>
2978
2979         Fix logging of sticky scrolling tree nodes
2980         https://bugs.webkit.org/show_bug.cgi?id=133670
2981
2982         Reviewed by Sam Weinig.
2983
2984         ScrollingStateStickyNode::dumpProperties() dumped stickyBoxRect() twice and
2985         didn't dump constrainingRectAtLastLayout(), so fix that.
2986
2987         * page/scrolling/ScrollingStateStickyNode.cpp:
2988         (WebCore::ScrollingStateStickyNode::dumpProperties):
2989
2990 2014-06-05  Sergio Villar Senin  <svillar@igalia.com>
2991
2992         [CSS Grid Layout] Simplify the named grid lines resolution algorithm
2993         https://bugs.webkit.org/show_bug.cgi?id=133543
2994
2995         Reviewed by Darin Adler.
2996
2997         Named grid lines resolution algorithm can be heavily simplified by
2998         inserting the implicit named grid lines generated by each grid
2999         area (<area-name>-{start|end} for rows and columns), into the list
3000         of user defined named grid lines. This way we would only have to
3001         deal with named grid lines and forget about the named grid areas
3002         (as described in the specs
3003         http://dev.w3.org/csswg/css-grid/#grid-placement-slot).
3004
3005         As a nice side effect, we'll get for free the implementation of the
3006         use case described in section 5.2.2 Implicit Named Areas.
3007
3008         Test: fast/css-grid-layout/named-grid-lines-with-named-grid-areas-dynamic-get-set.html
3009
3010         * css/StyleResolver.cpp:
3011         (WebCore::createImplicitNamedGridLinesFromGridArea):
3012         (WebCore::StyleResolver::applyProperty):
3013         * rendering/RenderGrid.cpp:
3014         (WebCore::isStartSide):
3015         (WebCore::gridLinesForSide):
3016         (WebCore::implicitNamedGridLineForSide):
3017         (WebCore::isNonExistentNamedLineOrArea):
3018         (WebCore::RenderGrid::adjustGridPositionsFromStyle):
3019         (WebCore::RenderGrid::resolveNamedGridLinePositionFromStyle):
3020         (WebCore::RenderGrid::resolveGridPositionFromStyle):
3021         (WebCore::RenderGrid::resolveNamedGridLinePositionAgainstOppositePosition):
3022         (WebCore::gridLineDefinedBeforeGridArea): Deleted.
3023         (WebCore::setNamedLinePositionIfDefinedBeforeArea): Deleted.
3024         (WebCore::RenderGrid::adjustNamedGridItemPosition): Deleted.
3025
3026 2014-06-10  Kiran  <kiran.guduru@samsung.com>
3027
3028         [MediaStream] Add getTracks() support to MediaStream.
3029         https://bugs.webkit.org/show_bug.cgi?id=133641
3030
3031         Reviewed by Eric Carlson.
3032
3033         A new method named getTracks is proposed to retrieve all the tracks
3034         of a MediaStream irrespective of the type. This method has been implementd.
3035
3036         Test: fast/mediastream/MediaStream-getTracks.html
3037
3038         * Modules/mediastream/MediaStream.cpp:
3039         (WebCore::MediaStream::getTracks):
3040         * Modules/mediastream/MediaStream.h:
3041         * Modules/mediastream/MediaStream.idl:
3042
3043 2014-06-09  Simon Fraser  <simon.fraser@apple.com>
3044
3045         Remove use of view() in RenderView code
3046         https://bugs.webkit.org/show_bug.cgi?id=133669
3047
3048         Reviewed by Andreas Kling.
3049
3050         view() in RenderView just returns *this, so no need to use it.
3051
3052         * rendering/RenderView.cpp:
3053         (WebCore::RenderView::setSelection):
3054
3055 2014-06-09  Eric Carlson  <eric.carlson@apple.com>
3056
3057         [iOS] Wireless route picker control should use touch event handlers
3058         https://bugs.webkit.org/show_bug.cgi?id=133672
3059
3060         Reviewed by Brent Fulgham.
3061
3062         * Modules/mediacontrols/mediaControlsiOS.js:
3063         (ControllerIOS.prototype.createControls): Listen for touch events.
3064         (ControllerIOS.prototype.handleWirelessPickerButtonTouchStart): New, handle touch start.
3065         (ControllerIOS.prototype.handleWirelessPickerButtonTouchEnd): New, handle touch end.
3066         (ControllerIOS.prototype.handleWirelessPickerButtonTouchCancel): New, handle touch cancel.
3067         (ControllerIOS.prototype.handleWirelessPickerButtonClicked): Deleted.
3068
3069 2014-06-09  Benjamin Poulain  <benjamin@webkit.org>
3070
3071         Do not use a mask when matching the return value of a function call on ARM
3072         https://bugs.webkit.org/show_bug.cgi?id=133614
3073
3074         Reviewed by Andreas Kling.
3075
3076         On ARM, we cannot have garbage on the top bits of booleans. It is faster to check the whole
3077         register for nullity.
3078
3079         * cssjit/FunctionCall.h:
3080         (WebCore::FunctionCall::callAndBranchOnBooleanReturnValue):
3081         (WebCore::FunctionCall::callAndBranchOnCondition):
3082         * cssjit/SelectorCompiler.cpp:
3083         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
3084         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching):
3085         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementFunctionCallTest):
3086         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsActive):
3087         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsHovered):
3088
3089 2014-06-09  Ryosuke Niwa  <rniwa@webkit.org>
3090
3091         Remove the bogus assertion that didn't even build.
3092
3093         * css/CSSPrimitiveValue.cpp:
3094         (WebCore::CSSPrimitiveValue::formatNumberValue):
3095
3096 2014-06-09  Ryosuke Niwa  <rniwa@webkit.org>
3097
3098         Commit the right fix.
3099
3100         * css/CSSPrimitiveValue.cpp:
3101         (WebCore::CSSPrimitiveValue::formatNumberValue):
3102
3103 2014-06-09  Ryosuke Niwa  <rniwa@webkit.org>
3104
3105         Debug build fix after r169731.
3106
3107         * css/CSSPrimitiveValue.cpp:
3108         (WebCore::CSSPrimitiveValue::formatNumberValue):
3109
3110 2014-06-09  Simon Fraser  <simon.fraser@apple.com>
3111
3112         Work towards having frames in the scrolling tree
3113         https://bugs.webkit.org/show_bug.cgi?id=133665
3114
3115         Reviewed by Tim Horton.
3116         
3117         Optionally (based on Setting) create nodes in the scrolling tree for frames which
3118         contain async-scrollable content. This will be used on iOS/WK2 to support accelerated
3119         overflow-scroll in iframes. The setting allows for testing on OS X.
3120         
3121         The change breaks an assumption in ScrollingCoordinator/AsyncScrollingCoordinator
3122         that we're always dealing with the main frame, and changes logic in RenderLayerCompositor
3123         so that we can connect the scrolling tree across frame boundaries. RenderLayerCompositor
3124         maintains a m_subframeScrollLayersNeedReattach flag that gets set whenever we add or remove
3125         scroll-coordinated layers in the current frame. When set, after updating compositing
3126         layers we walk child frames, and, if they have scrolling nodes, re-attach them to the
3127         scrolling tree (which will find the new ancestor node).
3128
3129         Tests: platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed.html
3130                platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame.html
3131
3132         * WebCore.exp.in:
3133         * page/FrameView.cpp:
3134         (WebCore::FrameView::scrollLayerID): Use the new "for role" way of getting the node ID.
3135         * page/Settings.cpp:
3136         * page/Settings.in: Add scrollingTreeIncludesFrames.
3137         * page/scrolling/AsyncScrollingCoordinator.cpp:
3138         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
3139         (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged): Only set
3140         the region for the main frame.
3141         (WebCore::AsyncScrollingCoordinator::frameViewForScrollingNode): updateScrollPositionAfterAsyncScroll()
3142         needs to know which FrameView a given nodeID is hosted in; doing a walk of the frame tree for
3143         non-main frames seems to be the safest way.
3144         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
3145         (WebCore::AsyncScrollingCoordinator::syncChildPositions):
3146         * page/scrolling/AsyncScrollingCoordinator.h:
3147         * page/scrolling/ScrollingCoordinator.cpp:
3148         (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView): Consult the new setting.
3149         (WebCore::ScrollingCoordinator::frameViewHasSlowRepaintObjectsDidChange):
3150         (WebCore::ScrollingCoordinator::frameViewFixedObjectsDidChange):
3151         (WebCore::ScrollingCoordinator::frameViewRootLayerDidChange):
3152         (WebCore::ScrollingCoordinator::synchronousScrollingReasons):
3153         (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons):
3154         (WebCore::ScrollingCoordinator::setForceSynchronousScrollLayerPositionUpdates):
3155         (WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously):
3156         (WebCore::ScrollingCoordinator::replaySessionStateDidChange):
3157         (WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText):
3158         * page/scrolling/ScrollingCoordinator.h:
3159         (WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously): Deleted.
3160         * rendering/RenderLayerBacking.h: Rather than separate functions to get the two scrolling
3161         node IDs, having one scrollingNodeIDForRole() makes calling code cleaner.
3162         * rendering/RenderLayerCompositor.cpp:
3163         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
3164         (WebCore::RenderLayerCompositor::updateCompositingLayers):  call reattachSubframeScrollLayers()
3165         after a compositing tree update.
3166         (WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer): Deals with the various configurations
3167         in which we can do async scrolling of sticky elements.
3168         (WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer):
3169         (WebCore::useCoordinatedScrollingForLayer):
3170         (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
3171         (WebCore::RenderLayerCompositor::requiresCompositingForScrolling): Moved.
3172         (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange): This is a bug fix;
3173         we only need to notify child frames, not all descendant frames.
3174         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
3175         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
3176         (WebCore::enclosingScrollingNodeID):
3177         (WebCore::scrollCoordinatedAncestorInParentOfFrame):
3178         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
3179         (WebCore::RenderLayerCompositor::attachScrollingNode):
3180         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
3181         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
3182         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
3183         (WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers):
3184         (WebCore::RenderLayerCompositor::willRemoveScrollingLayer):
3185         (WebCore::isStickyInAcceleratedScrollingLayerOrViewport): Deleted.
3186         (WebCore::isViewportConstrainedFixedOrStickyLayer): Deleted.
3187         (WebCore::isMainFrameScrollingOrOverflowScrolling): Deleted.
3188         (WebCore::nearestScrollCoordinatedAncestor): Deleted.
3189         * rendering/RenderLayerCompositor.h:
3190         * rendering/RenderView.cpp:
3191         (WebCore::RenderView::setSelection): Added comment.
3192         * testing/InternalSettings.cpp:
3193         (WebCore::InternalSettings::setScrollingTreeIncludesFrames):
3194         * testing/InternalSettings.h: Removed some useless parameter names.
3195         * testing/InternalSettings.idl: Added setScrollingTreeIncludesFrames() setting.
3196
3197 2014-06-09  Benjamin Poulain  <bpoulain@apple.com>
3198
3199         Improve CSSPrimitiveValue::customCSSText for ARMv7
3200         https://bugs.webkit.org/show_bug.cgi?id=133597
3201
3202         Reviewed by Andreas Kling.
3203
3204         On imgur, some script is updating some layout on timers and on scroll.
3205
3206         It looks like CSSPrimitiveValue::customCSSText() is a little constrained
3207         by the instruction cache on ARMv7. This patch improve the situation a bit.
3208
3209         First, the creation of the string itself is changed to go from two allocation to one.
3210         Previously, we would allocate a StringBuffer and adopt it. Now we allocate a StringImpl
3211         directly with the inline buffer.
3212
3213         The second issue is that the compiler was generating a real copy constructor for every
3214         assignment of the "text" variable (likely because the variable span is so large).
3215         This was solved by moving the string creating into a separate function (to fix the span)
3216         and being careful with passing PassRef<StringImpl> around.
3217
3218         Then there was the problem that the compiler was a little too aggressive with inlining
3219         which caused each "case" to repeat the same prologue and epilogue before formatValue().
3220         This was solved by adding formatNumberValue() with NEVER_INLINE to have the prologue/epilogue
3221         in a single place.
3222
3223         On older device, that's about 3% improvement on style access. On modern ARM64/x86_64
3224         there is no noticeable difference.
3225
3226         * css/CSSPrimitiveValue.cpp:
3227         (WebCore::CSSPrimitiveValue::formatNumberValue):
3228         (WebCore::CSSPrimitiveValue::formatNumberForcustomCSSText):
3229         (WebCore::CSSPrimitiveValue::customCSSText):
3230         (WebCore::formatNumber): Deleted.
3231         * css/CSSPrimitiveValue.h:
3232
3233 2014-06-09  Alex Christensen  <achristensen@webkit.org>
3234
3235         [iOS WebGL] Fix EXT_shader_texture_lod.
3236         https://bugs.webkit.org/show_bug.cgi?id=133633
3237
3238         Reviewed by Brady Eidson.
3239
3240         Covered by the Khronos test (and in LayoutTests):
3241         conformance/extensions/ext-shader-texture-lod.html
3242
3243         * html/canvas/WebGLRenderingContext.cpp:
3244         (WebCore::WebGLRenderingContext::getExtension):
3245         (WebCore::WebGLRenderingContext::getSupportedExtensions):
3246         Added shader texture lod name to match value from glGetString(GL_EXTENSIONS) on iOS.
3247
3248 2014-06-09  Benjamin Poulain  <bpoulain@apple.com>
3249
3250         Document::updateStyleIfNeededForNode can get very expensive
3251         https://bugs.webkit.org/show_bug.cgi?id=133599
3252
3253         Reviewed by Andreas Kling.
3254
3255         When pages are querying their style, we first run through
3256         Document::updateStyleIfNeededForNode() to find if that particular node needs style recalc.
3257
3258         The problem was that updateStyleIfNeededForNode() could get really expensive. For each node,
3259         it needs to check the whole parent chain to find if any needs style recalc.
3260         When web pages get a bunch of nodes and querying their style, we ended up going over a lot
3261         of nodes just to find there is nothing to do.
3262
3263         This patch adds two tweaks to reduce the problem:
3264         First, before querying nodeOrItsAncestorNeedsStyleRecalc() we check if the Document is dirty at all.
3265         The other part is making nodeOrItsAncestorNeedsStyleRecalc() faster by removing useless elements check.
3266
3267         * dom/Document.cpp:
3268         (WebCore::nodeOrItsAncestorNeedsStyleRecalc):
3269         (WebCore::Document::updateStyleIfNeededForNode):
3270
3271 2014-06-09  Enrica Casucci  <enrica@apple.com>
3272
3273         iOS WebKit: Crash in charactersAroundPosition.
3274         https://bugs.webkit.org/show_bug.cgi?id=133659
3275         <rdar://problem/17220870>
3276
3277         Reviewed by Benjamin Poulain.
3278
3279         Ensure that we stay within the vector boundaries
3280         when returning the characters around the position.
3281
3282         * editing/VisibleUnits.cpp:
3283         (WebCore::charactersAroundPosition):
3284
3285 2014-06-09  Alexey Proskuryakov  <ap@apple.com>
3286
3287         Properly reset UStringSearch object in SearchBuffer constructor.
3288         https://bugs.webkit.org/show_bug.cgi?id=133662
3289         <rdar://problem/17240136>
3290
3291         Reviewed by Tim Horton.
3292
3293         * editing/TextIterator.cpp: (WebCore::SearchBuffer::~SearchBuffer):
3294
3295 2014-06-09  Eric Carlson  <eric.carlson@apple.com>
3296
3297         Automatic text track selection can select more than one track
3298         https://bugs.webkit.org/show_bug.cgi?id=133590
3299
3300         Reviewed by Brent Fulgham.
3301
3302         Test: media/video-trackmenu-selection.html
3303
3304         * html/HTMLMediaElement.cpp:
3305         (WebCore::HTMLMediaElement::configureTextTrack): Consider the currently selected
3306             track, if any.
3307
3308         * page/CaptionUserPreferencesMediaAF.cpp:
3309         (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Drive-by change
3310             to make sure no non-visible text tracks are included in the track menu.
3311
3312 2014-06-09  Jer Noble  <jer.noble@apple.com>
3313
3314         [Mac] Hang when painting media before compositing mode activated
3315         https://bugs.webkit.org/show_bug.cgi?id=133655
3316
3317         Reviewed by Eric Carlson.
3318
3319         When asked to paint(), MediaPlayerPrivateAVFoundationObjC should not create an image generator
3320         or a video output. These operations are synchronous, and will block the drawing thread and cause
3321         a spin. paint() as opposed to paintImageInContext() is only called when painting the layer tree
3322         and MediaPlayerPrivateAVFoundationObjC will paint by creating a AVPlayerLayer, not by painting
3323         frames directly into the tree.
3324
3325         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3326         (WebCore::MediaPlayerPrivateAVFoundationObjC::paint):
3327
3328 2014-06-09  Jer Noble  <jer.noble@apple.com>
3329
3330         [Mac][MSE] Exception thrown from ~MediaPlayerPrivateMediaSourceAVFObjC().
3331         https://bugs.webkit.org/show_bug.cgi?id=133656
3332
3333         Reviewed by Eric Carlson.
3334
3335         AVSampleBufferRenderSynchronizer can't handle being passed a NULL observer, so only attempt
3336         to remove the time jumped or duration observer if one was actually created.
3337
3338         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3339         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC):
3340
3341 2014-06-09  Zalan Bujtas  <zalan@apple.com>
3342
3343         Subpixel rendering: Pixelsnapping empty rounded rect results in NaN radii width/height.
3344         https://bugs.webkit.org/show_bug.cgi?id=133654
3345
3346         Reviewed by Simon Fraser.
3347
3348         Empty rounded rects don't need snapping.
3349
3350         Not testable.
3351
3352         * platform/graphics/RoundedRect.cpp:
3353         (WebCore::RoundedRect::pixelSnappedRoundedRectForPainting):
3354
3355 2014-05-21  Myles C. Maxfield  <mmaxfield@apple.com>
3356
3357         REGRESSION: missing underline under CJK text
3358         https://bugs.webkit.org/show_bug.cgi?id=128145
3359
3360         Reviewed by Darin Adler.
3361
3362         This patch refactors the GlyphToPathTranslator which is used to find intersections of
3363         glyphs and underlines. It was modified to allow for querying these pieces of
3364         information:
3365         1) The extents of the glyph. This can be used to make the underlines skip an entire
3366         glyph, wholesale
3367         2) What kind of skipping behavior should be used
3368         3) The Path which represents the glyph
3369         There are three skipping behaviors:
3370         1) (SkipDescenders) The previous behavior
3371         2) (SkipGlyph) Make the underline skip over the entire glyph, using the extents() function
3372         3) (DrawOverGlyph) Make the underline plow through the glyph, ignoring any descenders
3373
3374         Calculating which underlining behavior to use depends on what the base codepoint that
3375         originated that glyph is. This means that we have to map from glyphs to characters,
3376         something which is nontrivial to do. In order to solve this problem, this patch adds
3377         an optional vector to GlyphBuffer which represents the location in the original string
3378         from which a particular glyph originated. Then, when our WidthIterator code adds
3379         glyphs to the GlyphBuffer, we can include the extra information about where we are
3380         in the input string. Once this data is available, the GlyphPathTranslator can look up
3381         the base codepoint from which this glyph originates, and can run ICU functions on that
3382         codepoint.
3383
3384         We can use the ICU ublock_getCode() function to find which Unicode block a particular
3385         codepoint comes from. If the codepoint comes from a CJK block, we will use
3386         DrawOverGlyph; otherwise, we will use SkipDescenders.
3387
3388         Test: fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink-cjk.html
3389
3390         * platform/graphics/Font.cpp:
3391         (WebCore::sharedUnderlineType): Look up the base codepoint from which this glyph
3392         originates, call ublock_getCode to get its Unicode block, then return
3393         a GlyphUnderlineType accordingly. This code is shared between SVG and non-SVG.
3394         * platform/graphics/Font.h: New virtual functions in GlyphToPathTranslator, as well as
3395         function signatures for the above two functions.
3396         * platform/graphics/GlyphBuffer.h: Add an optional instance member for the location
3397         from within the original string from which a particular glyph originates.
3398         (WebCore::GlyphBuffer::clear): Updated for new member.
3399         (WebCore::GlyphBuffer::add): Ditto.
3400         (WebCore::GlyphBuffer::saveOffsetsInString): Opt-in to using the new variable
3401         (WebCore::GlyphBuffer::offsetInString): New variable accessor.
3402         * platform/graphics/TextRun.h: SVG needs the TextRun to use sharedUnderlineType.
3403         * platform/graphics/WidthIterator.cpp:
3404         (WebCore::WidthIterator::advanceInternal): Use GlyphBuffer's new variable (if present).
3405         * platform/graphics/mac/ComplexTextController.cpp:
3406         (WebCore::ComplexTextController::advance): Use GlyphBuffer's new variable (if present).
3407         * platform/graphics/mac/FontMac.mm: Implement new GlyphToPathTranslator functions.
3408         (WebCore::MacGlyphToPathTranslator::path):
3409         (WebCore::MacGlyphToPathTranslator::extents):
3410         (WebCore::MacGlyphToPathTranslator::underlineType): Calls sharedUnderlineType().
3411         (WebCore::MacGlyphToPathTranslator::moveToNextValidGlyph):
3412         (WebCore::MacGlyphToPathTranslator::increment):
3413         (WebCore::Font::dashesForIntersectionsWithRect): Ask the translator what kind of underline
3414         behavior should be used. React accordingly.
3415         (WebCore::MacGlyphToPathTranslator::nextPath): Deleted.
3416         (WebCore::MacGlyphToPathTranslator::incrementIndex): Deleted.
3417         * platform/graphics/win/UniscribeController.cpp:
3418         (WebCore::UniscribeController::shapeAndPlaceItem): Update to new signature of GlyphBuffer::add()
3419         * rendering/svg/SVGTextRunRenderingContext.cpp: Implement new GlyphToPathTranslator functions.
3420         (WebCore::SVGGlyphToPathTranslator::SVGGlyphToPathTranslator):
3421         (WebCore::SVGGlyphToPathTranslator::getCurrentTransform):
3422         (WebCore::SVGGlyphToPathTranslator::path):
3423         (WebCore::SVGGlyphToPathTranslator::extents):
3424         (WebCore::MacGlyphToPathTranslator::underlineType): Calls sharedUnderlineType().
3425         (WebCore::SVGGlyphToPathTranslator::moveToNextValidGlyph):
3426         (WebCore::SVGGlyphToPathTranslator::increment):
3427         (WebCore::SVGTextRunRenderingContext::createGlyphToPathTranslator):
3428         (WebCore::SVGTextRunRenderingContext::drawSVGGlyphs):
3429         (WebCore::SVGGlyphToPathTranslator::nextPath): Deleted.
3430         (WebCore::SVGGlyphToPathTranslator::incrementIndex): Deleted.
3431         * rendering/svg/SVGTextRunRenderingContext.h: SVG needs the TextRun to use sharedUnderlineType.
3432
3433 2014-06-09  Alex Christensen  <achristensen@webkit.org>
3434
3435         [iOS WebGL] Implement OES_vertex_array_object for iOS.
3436         https://bugs.webkit.org/show_bug.cgi?id=133629
3437
3438         Reviewed by Brady Eidson.
3439
3440         Covered by the Khronos test (and in LayoutTests):