Optimize RenderLayer::intersectsDamageRect() slightly
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-03-28  Simon Fraser  <simon.fraser@apple.com>
2
3         Optimize RenderLayer::intersectsDamageRect() slightly
4         https://bugs.webkit.org/show_bug.cgi?id=143186
5
6         Reviewed by Zalan Bujtas.
7
8         We can early return from RenderLayer::intersectsDamageRect() if the
9         damageRect is empty, since nothing will intersect with the empty rect.
10         
11         Slight performance gain when scrolling overflow-scroll with lots of nested,
12         clipping layers.
13
14         * rendering/RenderLayer.cpp:
15         (WebCore::RenderLayer::calculateClipRects):
16
17 2015-03-28  Anders Carlsson  <andersca@apple.com>
18
19         Remove an unused SPI method from WebKitLegacy
20         https://bugs.webkit.org/show_bug.cgi?id=143185
21
22         Reviewed by Sam Weinig.
23
24         * loader/appcache/ApplicationCacheStorage.cpp:
25         (WebCore::ApplicationCacheStorage::storeCopyOfCache): Deleted.
26         * loader/appcache/ApplicationCacheStorage.h:
27
28 2015-03-28  Joonghun Park  <jh718.park@samsung.com>
29
30         nullptr cleanup in InlineFooBox classes
31         https://bugs.webkit.org/show_bug.cgi?id=143178
32
33         Reviewed by Csaba Osztrogonác.
34
35         No new tests, no behavior changes
36
37         Replace 0 with nullptr in InlineFooBox classes.
38
39         * rendering/InlineBox.cpp:
40         (WebCore::InlineBox::prevLeafChildIgnoringLineBreak):
41         * rendering/InlineFlowBox.cpp:
42         (WebCore::InlineFlowBox::removeChild):
43         (WebCore::InlineFlowBox::deleteLine):
44         (WebCore::InlineFlowBox::placeBoxesInInlineDirection):
45         (WebCore::InlineFlowBox::addTextBoxVisualOverflow):
46         * rendering/InlineFlowBox.h:
47         (WebCore::InlineFlowBox::InlineFlowBox):
48         * rendering/InlineTextBox.h:
49         (WebCore::InlineTextBox::InlineTextBox):
50         * rendering/RootInlineBox.cpp:
51         (WebCore::RootInlineBox::getLogicalStartBoxWithNode):
52         (WebCore::RootInlineBox::getLogicalEndBoxWithNode):
53         * rendering/RootInlineBox.h:
54         * rendering/svg/SVGInlineTextBox.cpp:
55         (WebCore::SVGInlineTextBox::SVGInlineTextBox):
56         (WebCore::SVGInlineTextBox::releasePaintingResource):
57         (WebCore::SVGInlineTextBox::restoreGraphicsContextAfterTextPainting):
58         * rendering/svg/SVGRootInlineBox.cpp:
59         (WebCore::SVGRootInlineBox::closestLeafChildForPosition):
60         (WebCore::findFirstAndLastAttributesInVector):
61         * rendering/svg/SVGRootInlineBox.h:
62
63 2015-03-27  Simon Fraser  <simon.fraser@apple.com>
64
65         More modern loops in RenderLayer.cpp
66         https://bugs.webkit.org/show_bug.cgi?id=143175
67
68         Reviewed by Ryosuke Niwa.
69
70         Use modern loops in more places in RenderLayer.app.
71
72         * rendering/RenderLayer.cpp:
73         (WebCore::RenderLayer::update3DTransformedDescendantStatus):
74         (WebCore::RenderLayer::paint):
75         (WebCore::performOverlapTests):
76         (WebCore::RenderLayer::paintFixedLayersInNamedFlows):
77         (WebCore::RenderLayer::paintList):
78         (WebCore::RenderLayer::collectFragments):
79         (WebCore::RenderLayer::updatePaintingInfoForFragments):
80         (WebCore::RenderLayer::paintTransformedLayerIntoFragments):
81         (WebCore::RenderLayer::calculateClipRects):
82
83 2015-03-27  Simon Fraser  <simon.fraser@apple.com>
84
85         nullptr cleanup in RenderLayer
86         https://bugs.webkit.org/show_bug.cgi?id=143174
87
88         Reviewed by Ryosuke Niwa.
89
90         Replace 0 with nullptr in RenderLayer.cpp.
91
92         * rendering/RenderLayer.cpp:
93         (WebCore::RenderLayer::filterRenderer):
94         (WebCore::RenderLayer::updateLayerPositionsAfterLayout):
95         (WebCore::RenderLayer::updateLayerPositionsAfterOverflowScroll):
96         (WebCore::RenderLayer::positionNewlyCreatedOverflowControls):
97         (WebCore::RenderLayer::enclosingOverflowClipLayer):
98         (WebCore::RenderLayer::enclosingCompositingLayer):
99         (WebCore::RenderLayer::enclosingCompositingLayerForRepaint):
100         (WebCore::RenderLayer::enclosingFilterLayer):
101         (WebCore::RenderLayer::enclosingFilterRepaintLayer):
102         (WebCore::RenderLayer::clippingRootForPainting):
103         (WebCore::RenderLayer::transparentPaintingAncestor):
104         (WebCore::transparencyClipBox):
105         (WebCore::RenderLayer::removeChild):
106         (WebCore::RenderLayer::removeOnlyThisLayer):
107         (WebCore::RenderLayer::insertOnlyThisLayer):
108         (WebCore::accumulateOffsetTowardsAncestor):
109         (WebCore::RenderLayer::enclosingScrollableArea):
110         (WebCore::RenderLayer::enclosingPaginationLayerInSubtree):
111         (WebCore::RenderLayer::enclosingElement):
112         (WebCore::RenderLayer::enclosingFlowThreadAncestor):
113         (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
114         (WebCore::RenderLayer::hitTestLayer):
115         (WebCore::RenderLayer::hitTestTransformedLayerInFragments):
116         (WebCore::RenderLayer::hitTestLayerByApplyingTransform):
117         (WebCore::RenderLayer::hitTestList):
118         (WebCore::RenderLayer::updateClipRects):
119         (WebCore::RenderLayer::clipRects):
120         (WebCore::RenderLayer::calculateClipRects):
121
122 2015-03-27  Gwang Yoon Hwang  <yoon@igalia.com>
123
124         [TexMap] Seperate BitmapTexture related classes implementations from TextureMapper
125         https://bugs.webkit.org/show_bug.cgi?id=142386
126
127         Reviewed by Žan Doberšek.
128
129         TextureMapper and TextureMapperGL are bloated and tightly coupled with
130         BitmapTexture. We should move these classes to seperated file of their own.
131         Also, this patch removes friend relationship from TextureMapperGL and  its
132         subsidiary classes.
133
134         The main purpose of this refactoring is to expose BitmapTexturePool to
135         renderers of platformlayers like Video and Canvas. By doing this, each
136         renderer can acquire textures from the global texture pool to paint
137         their contents directly.
138
139         No new tests needed.
140
141         * PlatformEfl.cmake:
142         * PlatformGTK.cmake:
143         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
144         Include BitmapTextureGL and BitmapTexturePool explicitly
145
146         * platform/graphics/texmap/BitmapTexture.cpp: Added.
147         * platform/graphics/texmap/BitmapTexture.h: Added.
148         (WebCore::BitmapTexture::updateContents):
149         Exclude BitmapTexture class from TextureMapper
150
151         * platform/graphics/texmap/BitmapTextureGL.cpp: Added.
152         * platform/graphics/texmap/BitmapTextureGL.h: Added.
153         Exclude BitmapTextureGL class from TextureMapperGL
154         (WebCore::BitmapTextureGL::clipStack): Added.
155         Add the getter for clipStack for TextureMapperGL
156         (WebCore::BitmapTextureGL::Bind): Deleted.
157         (WebCore::BitmapTextureGL::BindAsSurface): Added.
158         Bind used TextureMapperGL's internal data directly to compute projection matrix as a friend class,
159         However, TextureMapperGL can compute projection matrix itself after binding job, so this
160         friend ship is not needed. Also, this patch renames Bind to BindAsSurface to remove ambiguity.
161
162         * platform/graphics/texmap/BitmapTextureImageBuffer.cpp: Added.
163         * platform/graphics/texmap/BitmapTextureImageBuffer.h: Added.
164         Exclude BitmapTextureImageBuffer class from TextureMapperImageBuffer
165
166         * platform/graphics/texmap/BitmapTexturePool.cpp: Added.
167         * platform/graphics/texmap/BitmapTexturePool.h: Added.
168         Exclude BitmapTexturePool class from TextureMapperGL
169         (WebCore::BitmapTexturePool::acquireTexture):
170         Modified to use passed GraphicsContext3D instead of TextureMapperGL to remove redundant coupling
171
172         * platform/graphics/texmap/TextureMapper.cpp:
173         * platform/graphics/texmap/TextureMapper.h:
174         Remove BitmapTexturePool and BitmapTexture from its implementation.
175
176         * platform/graphics/texmap/TextureMapperGL.cpp:
177         * platform/graphics/texmap/TextureMapperGL.h:
178         Remove BitmapTextureGL from its implementation.
179         (WebCore::TextureMapperGL::TextureMapperGL):
180         (WebCore::TextureMapperGL::clipStack):
181         (WebCore::TextureMapperGL::bindSurface):
182         (WebCore::TextureMapperGL::currentSurface):
183         Add a getter of the current surface for filtering operation in BitmapTextureGL.
184         It would be clear to move filtering operation from BitmapTextureGL to TextureMapperGL later.
185
186         (WebCore::TextureMapperGL::ClipStack):
187         Move inner class declaration to public.
188
189         * platform/graphics/texmap/TextureMapperImageBuffer.cpp:
190         * platform/graphics/texmap/TextureMapperImageBuffer.h:
191         Remove BitmapTextureImageBuffer from its implementation.
192
193 2015-03-27  Tim Horton  <timothy_horton@apple.com>
194
195         WebProcess started by editable WKWebView spends 15% of its initialization time loading DataDetectors
196         https://bugs.webkit.org/show_bug.cgi?id=143142
197         <rdar://problem/20324495>
198
199         Reviewed by Anders Carlsson.
200
201         Calling DataDetectorsLibrary() is expensive; we should avoid doing it
202         until actually necessary. When loading a page that makes a caret selection,
203         ServicesOverlayController was calling DataDetectorsLibrary() (ignoring the fact
204         that a caret selection can't have any services associated with it) to avoid
205         crashing on systems where DataDetectors is not available. Instead, we should
206         first check if there's anything to do, and then check for the existence
207         of DataDetectors.
208
209         * page/mac/ServicesOverlayController.mm:
210         (WebCore::ServicesOverlayController::buildPhoneNumberHighlights):
211         Build the list of phone number ranges, and bail (clearing the potential highlights)
212         if it is empty, before calling DataDetectorsLibrary().
213
214         (WebCore::ServicesOverlayController::buildSelectionHighlight):
215         Check the list of selection rects, and bail (clearing the potential highlights)
216         if it is empty, before calling DataDetectorsLibrary().
217
218 2015-03-27  Jer Noble  <jer.noble@apple.com>
219
220         [Mac] Safari fails to fire page "load" event with video[preload=none]
221         https://bugs.webkit.org/show_bug.cgi?id=143147
222
223         Reviewed by Simon Fraser.
224
225         Test: media/video-page-load-preload-none.html
226
227         When told to load() when preload == None, set the networkState to Idle.
228         This causes HTMLMediaElement to set the shouldDelayLoadEvent flag to
229         false, and allows the page's 'load' event to fire.
230
231         Drive-by fix: add setNetworkState() and setReadyState() methods to
232         MediaPlayerPrivateAVFoundation, reducing a bunch of code duplication.
233
234         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
235         (WebCore::MediaPlayerPrivateAVFoundation::load):
236         (WebCore::MediaPlayerPrivateAVFoundation::setNetworkState):
237         (WebCore::MediaPlayerPrivateAVFoundation::setReadyState):
238         (WebCore::MediaPlayerPrivateAVFoundation::updateStates):
239         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
240
241 2015-03-27  Alexey Proskuryakov  <ap@apple.com>
242
243         Calling crypto.webkitSubtle.generateKey causes page memory to never be released
244         https://bugs.webkit.org/show_bug.cgi?id=143151
245         rdar://problem/18940687
246
247         Reviewed by Tim Horton.
248
249         * crypto/mac/CryptoKeyRSAMac.cpp: (WebCore::CryptoKeyRSA::generatePair): Don't.
250
251 2015-03-27  Brent Fulgham  <bfulgham@apple.com>
252
253         Null dereference in InbandMetadataTextTrack handling
254         https://bugs.webkit.org/show_bug.cgi?id=143144
255         <rdar://problem/18983250>
256
257         Reviewed by Eric Carlson.
258
259         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
260         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): Check for null return value from
261         'client()', just like we do in all other methods.
262
263 2015-03-27  Oliver Hunt  <oliver@apple.com>
264
265         Forward additional CFNetwork ATS information to child processes
266         https://bugs.webkit.org/show_bug.cgi?id=143136
267
268         Reviewed by Anders Carlsson.
269
270         Declare SPI.
271
272         * platform/spi/cf/CFNetworkSPI.h:
273
274 2015-03-27  Chris Dumez  <cdumez@apple.com>
275
276         [WK2][NetworkCache] We only cache responses with status codes that are cacheable by default
277         https://bugs.webkit.org/show_bug.cgi?id=143125
278         <rdar://problem/20321172>
279
280         Reviewed by Antti Koivisto.
281
282         Export a couple of extra symbols.
283
284         * platform/network/ResourceResponseBase.h:
285
286 2015-03-27  Jer Noble  <jer.noble@apple.com>
287
288         HTMLMediaElement will fire 'seeked' before seek completes, leading to currentTime discontinuities.
289         https://bugs.webkit.org/show_bug.cgi?id=143132
290
291         Reviewed by Eric Carlson.
292
293         When seeking, if the ready state rises to >= HAVE_CURRENT_DATA, we will fire the 'seeked'
294         event and continue playback. However, if a media engine updates the ready state before its
295         seek operation actually completes, the currentTime it returns may still be the time before
296         the seek.
297
298         Wait until both the ready state rises to HAVE_CURRENT_DATA and m_player->seeking() returns
299         false before firing the 'seeked' event.
300
301         * html/HTMLMediaElement.cpp:
302         (WebCore::HTMLMediaElement::parseAttribute):
303
304 2015-03-26  Geoffrey Garen  <ggaren@apple.com>
305
306         Make some more objects use FastMalloc
307         https://bugs.webkit.org/show_bug.cgi?id=143122
308
309         Reviewed by Csaba Osztrogonác.
310
311         * Modules/geolocation/GeolocationController.h:
312         * Modules/geolocation/NavigatorGeolocation.h:
313         * Modules/indexeddb/DOMWindowIndexedDatabase.h:
314         * Modules/notifications/NotificationController.h:
315         * Modules/webdatabase/DatabaseServer.h:
316         * css/CSSFontFaceSource.h:
317         * html/HTMLMediaSession.h:
318         * inspector/InspectorIndexedDBAgent.h:
319         * inspector/InspectorReplayAgent.h:
320         * page/CaptionUserPreferencesMediaAF.h:
321         * page/PageConsoleClient.h:
322         * page/PageDebuggable.h:
323         * page/animation/CSSPropertyAnimation.cpp:
324         * page/mac/ServicesOverlayController.h:
325         * platform/RemoteCommandListener.h:
326         * platform/Timer.h:
327         * platform/audio/MediaSessionManager.h:
328         * platform/mac/SystemSleepListenerMac.h:
329         * platform/mac/ThemeMac.h:
330         * rendering/svg/RenderSVGResourceSolidColor.h:
331         * replay/ReplayController.h:
332
333 2015-03-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
334
335         FEMorphology::platformApplyGeneric() should bail out if the radius is less than or equal to zero.
336         https://bugs.webkit.org/show_bug.cgi?id=142885.
337
338         Reviewed by Dean Jackson.
339
340         FEMorphology class implementation code clean up.
341         
342         Tests: svg/filters/feMorphology-radius-cases.svg
343
344         * platform/graphics/filters/FEMorphology.cpp:
345         (WebCore::shouldSupersedeExtremum): Reuse code instead of repeating it and
346         use < and > instead of =< and >=.
347         
348         (WebCore::pixelArrayIndex): Returns the array index of a pixel in an image
349         buffer, given: position(x, y), image width and the color channel.
350         
351         (WebCore::columnExtremum): Returns the extremum of a column of pixels.
352         
353         (WebCore::kernelExtremum): Returns the extremum of a filter kernel.
354         
355         (WebCore::FEMorphology::platformApplyGeneric): Apply some code clean-up.
356         The kernel size should be equal to radius of the filter. The extra pixel
357         was causing the resulted image to be asymmetric in some cases.
358         
359         (WebCore::FEMorphology::platformApplyDegenerate):
360         (WebCore::FEMorphology::platformApplySoftware): After applying scaling, we
361         still need to check the resulted radius is negative (overflow case) or less
362         than one (zero radius case) and treat these cases differently.
363         
364         (WebCore::FEMorphology::morphologyOperator): Deleted.
365         (WebCore::FEMorphology::radiusX): Deleted.
366         (WebCore::FEMorphology::radiusY): Deleted.
367         * platform/graphics/filters/FEMorphology.h:
368         (WebCore::FEMorphology::morphologyOperator):
369         (WebCore::FEMorphology::radiusX):
370         (WebCore::FEMorphology::radiusY):
371         Move a single line functions from the source file to the header file.
372
373 2015-03-27  Antti Koivisto  <antti@apple.com>
374
375         Move CacheValidation to platform
376         https://bugs.webkit.org/show_bug.cgi?id=143133
377
378         Reviewed by Chris Dumez.
379
380         It deals with platform types only and is currently violating layering.
381
382         * WebCore.xcodeproj/project.pbxproj:
383         * loader/cache/CacheValidation.cpp: Removed.
384         * loader/cache/CacheValidation.h: Removed.
385         * platform/network/CacheValidation.cpp: Copied from Source/WebCore/loader/cache/CacheValidation.cpp.
386         * platform/network/CacheValidation.h: Copied from Source/WebCore/loader/cache/CacheValidation.h.
387
388 2015-03-27  Commit Queue  <commit-queue@webkit.org>
389
390         Unreviewed, rolling out r177896.
391         https://bugs.webkit.org/show_bug.cgi?id=142978
392
393         Loading libgstclutter.so in-process hangs web process
394         (Requested by mcatanzaro on #webkit).
395
396         Reverted changeset:
397
398         "[GStreamer] Disable gst-plugin-scanner if seccomp filters are
399         enabled"
400         https://bugs.webkit.org/show_bug.cgi?id=140069
401         http://trac.webkit.org/changeset/177896
402
403 2015-03-26  Antti Koivisto  <antti@apple.com>
404
405         Respect cache-control directives in request
406         https://bugs.webkit.org/show_bug.cgi?id=143121
407         rdar://problem/19714040
408
409         Reviewed by Chris Dumez.
410
411         Test: http/tests/cache/disk-cache/disk-cache-request-headers.html
412
413         * loader/cache/CacheValidation.cpp:
414         (WebCore::isCacheHeaderSeparator):
415         (WebCore::isControlCharacter):
416         (WebCore::trimToNextSeparator):
417         (WebCore::parseCacheHeader):
418         (WebCore::parseCacheControlDirectives):
419
420             Factor Cache-control parsing here so it can be used for both requests and responses.
421
422         * loader/cache/CacheValidation.h:
423         * platform/network/ResourceRequestBase.h:
424         * platform/network/ResourceResponseBase.cpp:
425         (WebCore::ResourceResponseBase::ResourceResponseBase):
426         (WebCore::ResourceResponseBase::parseCacheControlDirectives):
427         (WebCore::ResourceResponseBase::cacheControlContainsNoCache):
428         (WebCore::ResourceResponseBase::cacheControlContainsNoStore):
429         (WebCore::ResourceResponseBase::cacheControlContainsMustRevalidate):
430         (WebCore::ResourceResponseBase::cacheControlMaxAge):
431         (WebCore::isCacheHeaderSeparator): Deleted.
432         (WebCore::isControlCharacter): Deleted.
433         (WebCore::trimToNextSeparator): Deleted.
434         (WebCore::parseCacheHeader): Deleted.
435         * platform/network/ResourceResponseBase.h:
436
437 2015-03-27  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
438
439         [GStreamer] share GL context in pipeline, part 2
440         https://bugs.webkit.org/show_bug.cgi?id=143049
441
442         Reviewed by Carlos Garcia Campos.
443
444         This patch, instead of cluttering the GstGL attributes creation in
445         ::handleSyncMessage(), creates a new method ::ensureGstGLContext(),
446         where those attributes are defined. This method is guarded by
447         USE(GSTREAMER_GL)
448
449         ::handlSyncMessage() shall return nothing, according to GStreamer
450         documentation, not a boolean.
451
452         The GstGL attributes are now GRefPtr<> to avoid memory leaks.
453
454         The GstGLAPI and GstGLPlatform are now set given by the pre-processor
455         directives, and the code in ::ensureGstGLContext() is simpler.
456
457         No new tests because this is platform specific and it depends in the
458         run-time availability and configurations of GstGL elements.
459
460         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
461         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
462         Don't initialise the GstGL attributes since are GRefPtr<>
463         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): Changed the
464         signature to use void instead of gboolean.
465         (WebCore::MediaPlayerPrivateGStreamer::ensureGstGLContext): New method.
466         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
467
468 2015-03-26  Jeremy Jones  <jeremyj@apple.com>
469
470         Optimized Fullscreen fails to cleanup because of no longer necessary release of m_playerController in exitFullscreen()
471         https://bugs.webkit.org/show_bug.cgi?id=143120
472
473         Reviewed by Eric Carlson.
474
475         We used to release m_playerController in WebVideoFullscreenInterfaceAVKit::exitFullscreen() in order to make sure 
476         media state was reset. This is no longer necessary as we now have a way the model can explicitly request resetting the
477         media state via resetMediaState(). m_playerController is already released in 
478         WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal(). Releasing it prematurely can actually prevent the exit
479         fullscreen process from completing successfully.
480
481         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
482         (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
483
484 2015-03-26  Zalan Bujtas  <zalan@apple.com>
485
486         Inline continuation code should not take anonymous containing wrapper granted.
487         https://bugs.webkit.org/show_bug.cgi?id=133312
488
489         Reviewed by Dave Hyatt.
490
491         It's wrong to assume that when RenderInline is part of an inline continuation, its containing block
492         is an anonymous wrapper and its sibling might be a block level renderer.
493         When the inline continuation is no longer needed, for example when the block level renderer that initiated the continuation
494         is detached from the render tree, the inline renderes still continue to form continuation.(however they no longer require
495         anonymous wrappers)
496
497         Test: fast/inline/crash-when-position-property-is-changed-and-no-longer-in-continuation.html
498
499         * rendering/RenderInline.cpp:
500         (WebCore::updateStyleOfAnonymousBlockContinuations):
501         (WebCore::RenderInline::styleDidChange):
502
503 2015-03-26  Tim Horton  <timothy_horton@apple.com>
504
505         REGRESSION (r181358 and r181507): Lots of sites think that we support touch events on OS X
506         https://bugs.webkit.org/show_bug.cgi?id=142888
507         <rdar://problem/20227304>
508
509         Reviewed by Beth Dakin.
510
511         * dom/Document.idl:
512         * dom/Element.idl:
513         * html/HTMLBodyElement.idl:
514         * html/HTMLFrameSetElement.idl:
515         * page/DOMWindow.idl:
516         Re-conditionalize a lot of event listeners; sites test ("ontouchstart" in window), which
517         is not covered by NotEnumerable, and so r181358 and r181507 broke a bunch of sites
518         (apple.com, blaze.com, anything using nicescroll.js, etc.) by causing them to think
519         that (Mac) Safari was touch-enabled.
520
521 2015-03-26  Geoffrey Garen  <ggaren@apple.com>
522
523         "lineNo" does not match WebKit coding style guidelines
524         https://bugs.webkit.org/show_bug.cgi?id=143119
525
526         Reviewed by Michael Saboff.
527
528         We can afford to use whole words.
529
530         * bindings/js/JSLazyEventListener.cpp:
531         (WebCore::JSLazyEventListener::initializeJSFunction):
532         * bindings/js/JSMainThreadExecStateInstrumentation.h:
533         (WebCore::JSMainThreadExecState::instrumentFunctionCall):
534         * inspector/InspectorDOMAgent.cpp:
535         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
536         * testing/Internals.cpp:
537         (WebCore::Internals::parserMetaData):
538
539 2015-03-26  Roger Fong  <roger_fong@apple.com>
540
541         Apply blur effect to media control background.
542         https://bugs.webkit.org/show_bug.cgi?id=143116.
543         <rdar://problem/20316964>.
544
545         Reviewed by Brent Fulgham.
546
547         There are still a few issues, like the borders of the controls being blurred with black,
548         and the volume slider background not showing the blur effect. Will fix those separately.
549
550         Add CSS for new divs to create blur effect using back drop filters and blend modes.
551         * Modules/mediacontrols/mediaControlsApple.css:
552         (audio::-webkit-media-controls-panel):
553         (audio::-webkit-media-controls-panel-tint):
554         (audio::-webkit-media-controls-panel-background):
555         (audio::-webkit-media-controls-panel .volume-box):
556         (audio::-webkit-media-controls-volume-slider-container-background):
557         (audio::-webkit-media-controls-volume-slider-container-tint):
558         (audio::-webkit-media-controls-toggle-closed-captions-button): Adjust fill.
559         (audio::-webkit-media-controls-fullscreen-button): Adjust fill.
560         (audio::-webkit-media-controls-fullscreen-button.exit): Adjust fill.
561         (video:-webkit-full-screen::-webkit-media-controls-panel):
562         (audio:-webkit-full-screen::-webkit-media-controls-panel-tint):
563         (audio:-webkit-full-screen::-webkit-media-controls-panel-background):
564         (video:-webkit-full-screen::-webkit-media-controls-panel .volume-box):
565         (video:-webkit-full-screen::-webkit-media-controls-play-button):
566         (video:-webkit-full-screen::-webkit-media-controls-seek-back-button):
567         (video:-webkit-full-screen::-webkit-media-controls-seek-forward-button):
568         (video:-webkit-full-screen::-webkit-media-controls-timeline-container):
569         (video:-webkit-full-screen::-webkit-media-controls-status-display):
570         (audio::-webkit-media-controls-panel .volume-box:active): Deleted.
571         * Modules/mediacontrols/mediaControlsApple.js:
572         (Controller.prototype.createControls):
573         (Controller.prototype.configureInlineControls): Add new divs for blurred background effect.
574         (Controller.prototype.configureFullScreenControls): Ditto.
575         (Controller.prototype.handlePanelMouseDown): The tint div is now in front.
576         (Controller.prototype.drawTimelineBackground): Adjust colors to make border look better with new background.
577         (Controller.prototype.drawVolumeBackground): Ditto.
578
579 2015-03-26  Geoffrey Garen  <ggaren@apple.com>
580
581         Assertion firing in JavaScriptCore/parser/parser.h for statesman.com site
582         https://bugs.webkit.org/show_bug.cgi?id=142974
583
584         Reviewed by Joseph Pecoraro.
585
586         * bindings/js/JSLazyEventListener.cpp:
587         (WebCore::JSLazyEventListener::initializeJSFunction): Use the new override
588         line number API to guarantee that errors will map to the .html file locations
589         that we like.
590
591         * bindings/js/ScriptController.cpp:
592         (WebCore::ScriptController::eventHandlerPosition): Added a FIXME to cover
593         some cases where our line and column numbers are still nonsense.
594
595 2015-03-26  Beth Dakin  <bdakin@apple.com>
596
597         Relevant repainted objects callback is inaccurate and inconsistent for PDF 
598         documents
599         https://bugs.webkit.org/show_bug.cgi?id=143118
600         -and corresponding-
601         rdar://problem/13371582
602
603         Reviewed by Tim Horton.
604
605         Investigating this bug resulted in finding two things that should change for the 
606         relevant repainted objects heuristic. First, we should not count any objects 
607         painted while updating control tints. And secondly, we should not use it at all 
608         for plugin documents. In other documents, we count the plugin area as “painted” 
609         when we get to paint whether or not the plugin has actually loaded. This is 
610         intentional because it allows us to account for chunks of the page that will be 
611         filled in by possibly slow-loading ads. However, if the plugin is the whole 
612         document, then the heuristic just doesn’t make any sense and it leads to 
613         inconsistent behavior at different window sizes. So we’ll only count plugins when 
614         the document is not a plugin document. 
615
616         Don’t count objects during this paint!
617         * page/FrameView.cpp:
618         (WebCore::FrameView::updateControlTints):
619         * page/Page.h:
620         (WebCore::Page::setIsCountingRelevantRepaintedObjects):
621
622         Make sure the document is not a plugin document.
623         * rendering/RenderEmbeddedObject.cpp:
624         (WebCore::RenderEmbeddedObject::paint):
625
626 2015-03-26  Alex Christensen  <achristensen@webkit.org>
627
628         Progress towards CMake on Mac.
629         https://bugs.webkit.org/show_bug.cgi?id=143112
630
631         Reviewed by Chris Dumez.
632
633         * CMakeLists.txt:
634         * PlatformEfl.cmake:
635         * PlatformGTK.cmake:
636         * PlatformMac.cmake:
637         * platform/graphics/mac/IconMac.mm:
638
639 2015-03-26  Jer Noble  <jer.noble@apple.com>
640
641         [iOS] Accessibility crashing because MediaPlayer is laying out UI off the main thread
642         https://bugs.webkit.org/show_bug.cgi?id=142970
643
644         Reviewed by Eric Carlson.
645
646         isMainThread() will (ironically) return true if called from the web thread. Rather than dispatch
647         synchronously to the main thread to allocate the _volumeView, dispatch asynchronously and handle
648         the case where the MPVolumeView has not yet been created.
649
650         * platform/audio/ios/MediaSessionManagerIOS.mm:
651         (-[WebMediaSessionHelper allocateVolumeView]): Dispatch to the main thread to allocate. Move notification
652             registration to -setVolumeView:.
653         (-[WebMediaSessionHelper setVolumeView:]): Added. Register/Unregister for route availablitiy notifications.
654         (-[WebMediaSessionHelper hasWirelessTargetsAvailable]): Handle the possibility of a nil _volumeView.
655
656 2015-03-26  Benjamin Poulain  <bpoulain@apple.com>
657
658         Fix state maching debugging after r181964
659         https://bugs.webkit.org/show_bug.cgi?id=143082
660
661         Reviewed by Alex Christensen.
662
663         * contentextensions/ContentExtensionCompiler.cpp:
664         (WebCore::ContentExtensions::compileRuleList):
665
666 2015-03-25  David Hyatt  <hyatt@apple.com>
667
668         Improve the offsetWidth/Height layout optimization
669         https://bugs.webkit.org/show_bug.cgi?id=143008
670
671         Reviewed by Zalan Bujtas.
672
673         * dom/Document.cpp:
674         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
675         * dom/Document.h:
676         Change Element* to Element&. Clean up the dimension bits to use shifting. Remove both the inline and
677         the positioning restrictions on the optimization check.
678
679         * dom/Element.cpp:
680         (WebCore::Element::offsetWidth):
681         (WebCore::Element::offsetHeight):
682         Change to use Element& instead of Element*.
683
684         (WebCore::Element::clientWidth):
685         (WebCore::Element::clientHeight):
686         (WebCore::Element::scrollWidth):
687         (WebCore::Element::scrollHeight):
688         Turn on the optimization for clientWidth/Height and scrollWidth/Height.
689
690 2015-03-26  Brady Eidson  <beidson@apple.com>
691
692         Apply ContentExtension actions after redirects.
693         <rdar://problem/20062613> and https://bugs.webkit.org/show_bug.cgi?id=143055
694
695         Reviewed by Alex Christensen.
696
697         Tests: http/tests/contentextensions/loading/main-resource-redirect-blocked.php
698                http/tests/contentextensions/subresource-redirect-blocked.html
699
700         This patch moves the "run a URL against the content extension" code from CachedResourceLoader to
701         the ContentExtensionsBackend.
702
703         That allows it to be shared between the CachedResourceLoader where loads are initiated and 
704         ResourceLoader where redirects are handled.
705
706         * contentextensions/ContentExtension.cpp:
707         (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
708
709         * contentextensions/ContentExtensionsBackend.cpp:
710         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
711         (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
712         * contentextensions/ContentExtensionsBackend.h:
713
714         * loader/NetscapePlugInStreamLoader.cpp:
715         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
716
717         * loader/ResourceLoadInfo.h:
718
719         * loader/ResourceLoader.cpp:
720         (WebCore::ResourceLoader::ResourceLoader):
721         (WebCore::ResourceLoader::willSendRequest):
722         * loader/ResourceLoader.h:
723
724         * loader/SubresourceLoader.cpp:
725         (WebCore::SubresourceLoader::SubresourceLoader):
726
727         * loader/cache/CachedResourceLoader.cpp:
728         (WebCore::CachedResourceLoader::requestResource):
729
730         * page/UserContentController.cpp:
731         (WebCore::UserContentController::processContentExtensionRulesForLoad):
732         (WebCore::UserContentController::actionsForResourceLoad): Deleted.
733         (WebCore::UserContentController::globalDisplayNoneStyleSheet): Deleted.
734         (WebCore::UserContentController::displayNoneCSSRule): Deleted.
735         * page/UserContentController.h:
736
737 2015-03-26  Myles C. Maxfield  <mmaxfield@apple.com>
738
739         Crash when laying out (char)0
740         https://bugs.webkit.org/show_bug.cgi?id=143103
741
742         Reviewed by Dean Jackson.
743
744         We currently cache a character -> Font mapping in a HashMap.
745         However, keys in Hashmaps can't be 0. This patch simply skips
746         the cache in this case.
747
748         No new tests, for now. I'm having trouble creating a test because
749         the site that causes this bug generates their page using script,
750         and the script is all minified, and difficult to understand. I
751         will contact the owner of the site and ask for and unminified
752         version of their sources. However, I don't want to that to block
753         this tiny fix from going in.
754
755         * platform/graphics/Font.cpp:
756         (WebCore::Font::systemFallbackFontForCharacter):
757
758 2015-03-26  Jer Noble  <jer.noble@apple.com>
759
760         [Mac][EME] Crash at com.apple.WebCore: WebCore::CDMSessionMediaSourceAVFObjC::releaseKeys + 177
761         https://bugs.webkit.org/show_bug.cgi?id=143080
762
763         Reviewed by Eric Carlson.
764
765         Null-check m_certificate before dereferencing.
766
767         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
768         (WebCore::CDMSessionMediaSourceAVFObjC::releaseKeys):
769
770 2015-03-26  Chris Fleizach  <cfleizach@apple.com>
771
772         AX: [role="button"][aria-pressed] should be exposed as AXCheckbox:AXToggleButton, with role description of "toggle button"
773         https://bugs.webkit.org/show_bug.cgi?id=115298
774
775         Reviewed by Mario Sanchez Prada.
776
777         A role=button + aria-pressed object should be exposed as AXCheckbox on Mac now. It should also convert the
778         aria-pressed state into a 0, 1, 2 number value for the Mac.
779
780         Test: platform/mac/accessibility/aria-pressed-button-attributes.html
781
782         * accessibility/AccessibilityObject.cpp:
783         (WebCore::AccessibilityObject::checkboxOrRadioValue):
784         * accessibility/AccessibilityObject.h:
785         (WebCore::AccessibilityObject::isToggleButton):
786         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
787         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
788         (createAccessibilityRoleMap):
789         (-[WebAccessibilityObjectWrapper subrole]):
790         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
791
792 2015-03-25  Dean Jackson  <dino@apple.com>
793
794         CSS blend modes do not parse when in the shadow tree
795         https://bugs.webkit.org/show_bug.cgi?id=143067
796         <rdar://problem/20302662>
797
798         Reviewed by Anders Carlson.
799
800         The media controls style sheets are injected as UA stylesheets
801         when we come across a <video> or <audio> element. These stylesheets
802         have a different parsing context than the document stylesheets -
803         one that uses the default constructor, which initializes some
804         features like cssCompositingEnabled to false without checking
805         the runtime state.
806
807         The easy fix is to use the global state to initialize the context.
808
809         Unfortunately we can't test this since it only occurs in the shadow
810         tree.
811
812         * css/CSSParser.cpp:
813         (WebCore::CSSParserContext::CSSParserContext): Check the state
814         of RuntimeEnabledFeatures to initialize CSS Regions and
815         CSS Compositing (Blending).
816
817 2015-03-25  Chris Fleizach  <cfleizach@apple.com>
818
819         AX: table cells that use display:block render the table inaccessible to VoiceOver
820         https://bugs.webkit.org/show_bug.cgi?id=143007
821
822         Reviewed by Mario Sanchez Prada.
823
824         When display:block is used on a table cell, it was being ignored because it was anonymous.
825         This is still a valid scenario however if it's still inside of a valid table.
826
827         Test: accessibility/table-cell-display-block.html
828
829         * accessibility/AccessibilityTableCell.cpp:
830         (WebCore::AccessibilityTableCell::computeAccessibilityIsIgnored):
831
832 2015-03-25  Tim Horton  <timothy_horton@apple.com>
833
834         Add a preference to prevent "user-scalable=no" from having any effect
835         https://bugs.webkit.org/show_bug.cgi?id=143032
836
837         Reviewed by Sam Weinig.
838
839         * page/ViewportConfiguration.cpp:
840         (WebCore::ViewportConfiguration::ViewportConfiguration):
841         (WebCore::ViewportConfiguration::allowsUserScaling):
842         * page/ViewportConfiguration.h:
843         (WebCore::ViewportConfiguration::setForceAlwaysUserScalable):
844         If forceAlwaysUserScalable is set to true, force "user-scalable=yes".
845
846 2015-03-25  Dan Bernstein  <mitz@apple.com>
847
848         Another attempt to get the iOS EWS building again.
849
850         * WebCore.xcodeproj/project.pbxproj:
851
852 2015-03-25  Alex Christensen  <achristensen@webkit.org>
853
854         Add case-insensitive checks to DFA bytecode.
855         https://bugs.webkit.org/show_bug.cgi?id=142977
856
857         Reviewed by Benjamin Poulain.
858
859         * contentextensions/DFABytecode.h:
860         (WebCore::ContentExtensions::instructionSizeWithArguments):
861         * contentextensions/DFABytecodeCompiler.cpp:
862         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValue):
863         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValueRange):
864         Add case-insensitive bytecode.
865         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
866         Check to see if case-insensitive bytecodes can be used.
867         (WebCore::ContentExtensions::DFABytecodeCompiler::compileCheckForRange):
868         * contentextensions/DFABytecodeCompiler.h:
869         (WebCore::ContentExtensions::DFABytecodeCompiler::Range::Range):
870         Added Range structure to be able to count the ranges in a future patch deciding if we want to use jump tables.
871         * contentextensions/DFABytecodeInterpreter.cpp:
872         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
873         Interpret case-insensitive bytecodes.
874
875 2015-03-25  Sam Weinig  <sam@webkit.org>
876
877         Address additional review feedback from https://bugs.webkit.org/show_bug.cgi?id=143059.
878
879         * contentextensions/ContentExtensionCompiler.cpp:
880         (WebCore::ContentExtensions::compileRuleList):
881         * contentextensions/ContentExtensionCompiler.h:
882         * contentextensions/ContentExtensionParser.cpp:
883         (WebCore::ContentExtensions::getTypeFlags):
884
885 2015-03-25  Sam Weinig  <sam@webkit.org>
886
887         [Content Extensions] Convert content extension compiling to return error codes and write its output using a client
888         https://bugs.webkit.org/show_bug.cgi?id=143059
889
890         Reviewed by Alex Christensen.
891
892         * WebCore.xcodeproj/project.pbxproj:
893         Add ContentExtensionError.h/cpp.
894
895         * contentextensions/ContentExtensionError.cpp: Added.
896         (WebCore::ContentExtensions::contentExtensionErrorCategory):
897         * contentextensions/ContentExtensionError.h: Added.
898         (WebCore::ContentExtensions::make_error_code):
899         Add ContentExtensionError enum and std::error_code adaptor.
900
901         * contentextensions/ContentExtensionCompiler.h:
902         Instead of returning CompiledContentExtensionData, use a client interface
903         to pass data. Eventually, this should be turned into a direct streaming 
904         interface so we can write directly to a file.
905
906         * contentextensions/ContentExtensionCompiler.cpp:
907         (WebCore::ContentExtensions::compileRuleList):
908         * contentextensions/ContentExtensionParser.cpp:
909         (WebCore::ContentExtensions::getTypeFlags):
910         (WebCore::ContentExtensions::loadTrigger):
911         (WebCore::ContentExtensions::loadAction):
912         (WebCore::ContentExtensions::loadRule):
913         (WebCore::ContentExtensions::loadEncodedRules):
914         (WebCore::ContentExtensions::parseRuleList):
915         * contentextensions/ContentExtensionParser.h:
916         Convert to return an error.
917
918 2015-03-25  Beth Dakin  <bdakin@apple.com>
919
920         REGRESSION (r181660): Safari navigates to link after a starting and canceling a 
921         force preview
922         https://bugs.webkit.org/show_bug.cgi?id=143057
923         -and corresponding-
924         rdar://problem/20251436
925
926         Reviewed by Tim Horton.
927
928         This patch adds a value for ActionUpdated to the ImmediateActionStage enum. Now if 
929         m_immediateActionStage indicates that an immediate action has either begun or 
930         completed then we can have the same behavior.
931         * page/EventHandler.cpp:
932         (WebCore::EventHandler::handleMouseReleaseEvent):
933         * page/EventHandler.h:
934
935 2015-03-25  Dean Jackson  <dino@apple.com>
936
937         MediaControls: Use font with fixed number width
938         https://bugs.webkit.org/show_bug.cgi?id=143018
939         <rdar://problem/20245415>
940
941         Reviewed by Eric Carlson.
942
943         Add a new font-family, specific to Apple platforms,
944         called -apple-system-font-monospaced-numbers. This is
945         a special variant of the system font which uses monospaced
946         forms for the number glyphs - allowing a time reading that
947         doesn't bounce around as the time changes.
948
949         * Modules/mediacontrols/mediaControlsApple.css: Media controls should
950         use the new font.
951         (audio::-webkit-media-controls-time-remaining-display):
952         * Modules/mediacontrols/mediaControlsiOS.css:
953         (audio::-webkit-media-controls-time-remaining-display):
954
955         * platform/graphics/ios/FontCacheIOS.mm: Request a new CTFontRef with
956         the appropriate attributes.
957         (WebCore::createCTFontWithFamilyNameAndWeight):
958         * platform/graphics/mac/FontCacheMac.mm: Ditto, but NSFont.
959         (WebCore::fontWithFamily):
960         * platform/spi/cocoa/CoreTextSPI.h: Expose the constants for
961         the new form so that the public SDK can build.
962
963 2015-03-25  Alex Christensen  <achristensen@webkit.org>
964
965         [Content Extensions] Add multi-DFA compiling and interpreting.
966         https://bugs.webkit.org/show_bug.cgi?id=143010
967
968         Reviewed by Benjamin Poulain.
969
970         * contentextensions/ContentExtensionCompiler.cpp:
971         (WebCore::ContentExtensions::compileRuleList):
972         Compile multiple NFAs to DFAs.
973         * contentextensions/ContentExtensionsBackend.cpp:
974         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
975         Fixed a bug when there are no non-universal actions.
976         We still need to report that no ignore-previous-rules was hit to apply the
977         universal actions which are now accessed through DFABytecodeInterpreter::actionsFromDFARoot
978         and skipped in DFABytecodeInterpreter::interpret.
979         * contentextensions/DFABytecodeCompiler.cpp:
980         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
981         Add a header for each DFA.
982         * contentextensions/DFABytecodeInterpreter.cpp:
983         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
984         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
985         Interpret as many DFAs as there are in the bytecode.
986
987 2015-03-25  Per Arne Vollan  <peavo@outlook.com>
988
989         [Win] Illegal character in project file.
990         https://bugs.webkit.org/show_bug.cgi?id=143051
991
992         Reviewed by Brent Fulgham.
993
994         There is an illegal character in the WebCore project filter.
995         WebCore files are shown unfiltered.
996
997         * WebCore.vcxproj/WebCore.vcxproj.filters:
998
999 2015-03-25  David Hyatt  <hyatt@apple.com>
1000
1001         Add a pref to enable the new block-inside-inline model
1002         https://bugs.webkit.org/show_bug.cgi?id=143050
1003
1004         Reviewed by Sam Weinig.
1005
1006         * page/Settings.in:
1007
1008 2015-03-25  Dan Bernstein  <mitz@apple.com>
1009
1010         iOS Simulator build fix.
1011
1012         * platform/spi/cocoa/IOSurfaceSPI.h:
1013
1014 2015-03-25  Commit Queue  <commit-queue@webkit.org>
1015
1016         Unreviewed, rolling out r181932.
1017         https://bugs.webkit.org/show_bug.cgi?id=143041
1018
1019         The test fails most of the time on bots (Requested by ap on
1020         #webkit).
1021
1022         Reverted changeset:
1023
1024         "[Content Extensions] Add multi-DFA compiling and
1025         interpreting."
1026         https://bugs.webkit.org/show_bug.cgi?id=143010
1027         http://trac.webkit.org/changeset/181932
1028
1029 2015-03-24  Dean Jackson  <dino@apple.com>
1030
1031         Source/WebCore/rendering/RenderThemeMac.mm:2181:118: error: null passed to a callee that requires a non-null argument [-Werror,-Wnonnull]
1032         https://bugs.webkit.org/show_bug.cgi?id=143039
1033
1034         Unreviewed build fix for newer versions of OS X.
1035
1036         * rendering/RenderThemeMac.mm: Define a null language parameter. This
1037         seemed better than turning the clang warning off for just that
1038         function.
1039         (WebCore::AttachmentLayout::layOutTitle):
1040         (WebCore::AttachmentLayout::layOutSubtitle):
1041
1042 2015-03-24  Dan Bernstein  <mitz@apple.com>
1043
1044         Another attempt to fix the build.
1045
1046         * WebCore.xcodeproj/project.pbxproj:
1047         * platform/spi/cocoa/QuartzCoreSPI.h:
1048
1049 2015-03-24  Alex Christensen  <achristensen@webkit.org>
1050
1051         [Content Extensions] Add multi-DFA compiling and interpreting.
1052         https://bugs.webkit.org/show_bug.cgi?id=143010
1053
1054         Reviewed by Benjamin Poulain.
1055
1056         * contentextensions/ContentExtensionCompiler.cpp:
1057         (WebCore::ContentExtensions::compileRuleList):
1058         Compile multiple NFAs to DFAs.
1059         * contentextensions/ContentExtensionsBackend.cpp:
1060         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1061         Fixed a bug when there are no non-universal actions.
1062         We still need to report that no ignore-previous-rules was hit to apply the
1063         universal actions which are now accessed through DFABytecodeInterpreter::actionsFromDFARoot
1064         and skipped in DFABytecodeInterpreter::interpret.
1065         * contentextensions/DFABytecodeCompiler.cpp:
1066         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
1067         Add a header for each DFA.
1068         * contentextensions/DFABytecodeInterpreter.cpp:
1069         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
1070         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1071         Interpret as many DFAs as there are in the bytecode.
1072
1073 2015-03-24  Dan Bernstein  <mitz@apple.com>
1074
1075         Tried to fix the EWS build.
1076
1077         * platform/spi/cocoa/QuartzCoreSPI.h:
1078
1079 2015-03-24  Commit Queue  <commit-queue@webkit.org>
1080
1081         Unreviewed, rolling out r181898 and r181909.
1082         https://bugs.webkit.org/show_bug.cgi?id=143034
1083
1084         Broke fast/regions/auto-size/autoheight-two-pass-layout-
1085         complex-002.html (Requested by ap on #webkit).
1086
1087         Reverted changesets:
1088
1089         "Improve the offsetWidth/Height layout optimization"
1090         https://bugs.webkit.org/show_bug.cgi?id=143008
1091         http://trac.webkit.org/changeset/181898
1092
1093         "Disable layout dimensions optimization for RenderRegions"
1094         https://bugs.webkit.org/show_bug.cgi?id=143017
1095         http://trac.webkit.org/changeset/181909
1096
1097 2015-03-24  Zhuo Li  <zachli@apple.com>
1098
1099         Scripts running in isolated world should not subject to a page's CSP about 'eval'.
1100         https://bugs.webkit.org/show_bug.cgi?id=141316.
1101
1102         Reviewed by Geoffrey Garen.
1103
1104         * bindings/js/ScriptController.cpp:
1105         (WebCore::ScriptController::initScript):
1106         We should not impose the main world Content Security Policy onto the isolated world.
1107
1108 2015-03-24  Chris Dumez  <cdumez@apple.com>
1109
1110         [Mac] Use .cpp file extension instead of .mm for SharedTimerCF and PowerObserverMac
1111         https://bugs.webkit.org/show_bug.cgi?id=143026
1112
1113         Reviewed by Andy Estes.
1114
1115         Use .cpp file extension instead of .mm for SharedTimerCF and
1116         PowerObserverMac.
1117
1118         * WebCore.xcodeproj/project.pbxproj:
1119         * platform/cf/SharedTimerCF.cpp: Renamed from Source/WebCore/platform/cf/SharedTimerCF.mm.
1120         (WebCore::timerFired):
1121         Use WTF::AutodrainedPool instead of @autoreleasepool {}.
1122
1123         * platform/mac/PowerObserverMac.cpp: Renamed from Source/WebCore/platform/mac/PowerObserverMac.mm.
1124
1125 2015-03-24  Yusuke Suzuki  <utatane.tea@gmail.com>
1126
1127         REGRESSION (r181458): Heap use-after-free in JSSetIterator destructor
1128         https://bugs.webkit.org/show_bug.cgi?id=142696
1129
1130         Reviewed and tweaked by Geoffrey Garen.
1131
1132         Use JSSetIterator/JSMapIterator to iterate over JSSet and JSMap.
1133
1134         * ForwardingHeaders/runtime/JSMapIterator.h: Added.
1135         * ForwardingHeaders/runtime/JSSetIterator.h: Added.
1136         * bindings/js/SerializedScriptValue.cpp:
1137         (WebCore::CloneSerializer::serialize):
1138
1139 2015-03-24  Dan Bernstein  <mitz@apple.com>
1140
1141         Tried to fix the iOS Simulator build.
1142
1143         * platform/spi/cocoa/QuartzCoreSPI.h:
1144
1145 2015-03-24  Benjamin Poulain  <bpoulain@apple.com>
1146
1147         Make URL filter patterns matching consistent and add a simple canonicalization step
1148         https://bugs.webkit.org/show_bug.cgi?id=142998
1149
1150         Reviewed by Alex Christensen.
1151
1152         This patch makes two changes to the url filter input:
1153         -Make the matching "Search" by default, the pattern can now appear anywhere
1154          in the URL by default.
1155         -Make the input a little less fragile: do not explode on valid input
1156          that is not formatted in a certain way.
1157
1158         To implement the search behavior, I simply add an implict ".*" in front of the patterns
1159         when that make sense.
1160
1161         To make the input more solid, we do some little modification on the input:
1162         -Remove duplicated ".*".
1163         -Remove matching suffixes that do not bring new information.
1164         -Unify all the ".*" in the same format.
1165
1166         Why do that here? That should be done through a graph analysis on the machine.
1167
1168         The reason is this is incredibly cheap compared to the graph analysis. Any state
1169         removed upfront will save the handling of several hundred nodes in the deterministic
1170         graph.
1171
1172         * contentextensions/URLFilterParser.cpp:
1173         (WebCore::ContentExtensions::Term::isKnownToMatchAnyString):
1174         (WebCore::ContentExtensions::Term::isUniversalTransition):
1175         (WebCore::ContentExtensions::GraphBuilder::finalize):
1176         (WebCore::ContentExtensions::GraphBuilder::assertionBOL):
1177         (WebCore::ContentExtensions::GraphBuilder::fail):
1178         (WebCore::ContentExtensions::GraphBuilder::simplifySunkTerms):
1179
1180 2015-03-24  Chris Dumez  <cdumez@apple.com>
1181
1182         Regression(r181671): Caused Timer-related crashes on iOS / WK1
1183         https://bugs.webkit.org/show_bug.cgi?id=143025
1184
1185         Reviewed by Andy Estes.
1186
1187         Call CFRunLoopAddTimer() on WebThreadRunLoop() instead of
1188         CFRunLoopGetCurrent() for iOS, as we did before r181671.
1189
1190         I inadvertently changed this in r181671 when merging the Mac
1191         and iOS implementations.
1192
1193         No new tests, already covered by existing tests.
1194
1195         * platform/cf/SharedTimerCF.mm:
1196         (WebCore::setSharedTimerFireInterval):
1197
1198 2015-03-24  Dan Bernstein  <mitz@apple.com>
1199
1200         WebCore part of <rdar://problem/20282863> Transforms are flattened in snapshots of on-screen WKWebViews
1201         https://bugs.webkit.org/show_bug.cgi?id=143023
1202
1203         Reviewed by Tim Horton.
1204
1205         * platform/spi/cocoa/QuartzCoreSPI.h: Added the declaration of
1206         CARenderServerRenderLayerWithTransform.
1207
1208 2015-03-24  David Hyatt  <hyatt@apple.com>
1209
1210         Disable layout dimensions optimization for RenderRegions
1211         https://bugs.webkit.org/show_bug.cgi?id=143017
1212
1213         Reviewed by Dean Jackson.
1214
1215         * dom/Document.cpp:
1216         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
1217         Turn off the optimization for regions, since auto height regions can change size
1218         without needing a layout.
1219
1220 2015-03-24  Beth Dakin  <bdakin@apple.com>
1221
1222         Add events related to force click gesture
1223         https://bugs.webkit.org/show_bug.cgi?id=142836
1224         -and corresponding-
1225         rdar://problem/20210239
1226
1227         Reviewed by Dean Jackson.
1228
1229         This patch adds six new events for the force click gesture:
1230
1231         webkitmouseforcewillbegin -> Event is sent just before mousedown to indicate that 
1232         force can be perceived if the user presses any harder. The author should prevent 
1233         default on this event to both prevent the user agent’s default force click 
1234         features and to receive the other 5 events.
1235
1236         webkitmouseforcechanged -> This event fires whenever force changes between the 
1237         mousedown and mouseup. It is a new type of mouse event that includes a force 
1238         variable which is a normalized number between 0 (corresponds to click) and 1 
1239         (corresponds to force click). In this patch, I have only added code to send this 
1240         event between mousedown and mouseforcedown, but as a followup patch, we plan to 
1241         send it through mouseup.
1242
1243         webkitmouseforcecancelled -> If the user releases their finger from the trackpad 
1244         after pressing hard enough to send webkitmouseforcewillbegin events but not hard 
1245         enough to force click, this event will be sent to indicate that the user bailed 
1246         out on the gesture.
1247
1248         webkitmouseforcedown -> The down part of the force click.
1249
1250         webkitmouseforceup -> The up part of the force click. This event is added in this 
1251         patch, but does not yet fire. That is work for a follow-up patch.
1252
1253         webkitmouseforceclick -> The equivalent of the click event for the force click. 
1254         Should fire just after webkitmouseforceup. This event is added in this patch, but 
1255         does not yet fire. That is work for a follow-up patch.
1256
1257         Add new files for WebKitMouseForceEvent to build systems.
1258         * DerivedSources.cpp:
1259         * DerivedSources.make:
1260         * WebCore.vcxproj/WebCore.vcxproj:
1261         * WebCore.vcxproj/WebCore.vcxproj.filters:
1262         * WebCore.xcodeproj/project.pbxproj:
1263         * WebCore.xcodeproj/project.pbxproj:
1264
1265         Plumbing for new events.
1266         * dom/Document.idl:
1267
1268         Code to dispatch the new events. Currently the code that calls these functions is 
1269         in WebKit2.
1270         * dom/Element.cpp:
1271         (WebCore::Element::dispatchMouseForceWillBegin):
1272         (WebCore::Element::dispatchMouseForceChanged):
1273         (WebCore::Element::dispatchMouseForceDown):
1274         (WebCore::Element::dispatchMouseForceUp):
1275         (WebCore::Element::dispatchMouseForceClick):
1276         (WebCore::Element::dispatchMouseForceCancelled):
1277         * dom/Element.h:
1278
1279         More plumbing.
1280         * dom/Element.idl:
1281         * dom/EventNames.h:
1282         * dom/EventNames.in:
1283
1284         Our new type of mouse event that includes force.
1285         * dom/WebKitMouseForceEvent.cpp: Added.
1286         (WebCore::WebKitMouseForceEventInit::WebKitMouseForceEventInit):
1287         (WebCore::WebKitMouseForceEvent::WebKitMouseForceEvent):
1288         (WebCore::WebKitMouseForceEvent::~WebKitMouseForceEvent):
1289         (WebCore::WebKitMouseForceEvent::eventInterface):
1290         * dom/WebKitMouseForceEvent.h: Added.
1291         * dom/WebKitMouseForceEvent.idl: Added.
1292
1293         More plumbing.
1294         * html/HTMLAttributeNames.in:
1295         * html/HTMLBodyElement.cpp:
1296         (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
1297         * html/HTMLBodyElement.idl:
1298         * html/HTMLElement.cpp:
1299         (WebCore::HTMLElement::createEventHandlerNameMap):
1300         * page/DOMWindow.idl:
1301         * page/EventHandler.h:
1302         (WebCore::EventHandler::lastMouseDownEvent):
1303
1304 2015-03-24  Anders Carlsson  <andersca@apple.com>
1305
1306         Fix designated initializer violations
1307         https://bugs.webkit.org/show_bug.cgi?id=143016
1308         rdar://problem/20268858
1309
1310         Reviewed by Dan Bernstein.
1311
1312         Mark -[DOMObject init] as unavailable.
1313
1314         * bindings/objc/DOMObject.h:
1315         * bindings/objc/DOMObject.mm:
1316         (-[DOMObject init]):
1317
1318 2015-03-24  Benjamin Poulain  <benjamin@webkit.org>
1319
1320         CSS Selectors Level 4: enable case-insensitive attribute matching by default
1321         https://bugs.webkit.org/show_bug.cgi?id=142960
1322
1323         Reviewed by Andreas Kling.
1324
1325         All open issues have been resolved, enable the feature by default.
1326
1327         Test: fast/css/attribute-selector-case-insensitive.html
1328
1329         * css/CSSGrammar.y.in:
1330
1331 2015-03-24  Dean Jackson  <dino@apple.com>
1332
1333         MediaControls: Scrubber and Time displays have the incorrect blending
1334         https://bugs.webkit.org/show_bug.cgi?id=143011
1335         <rdar://problem/20245251>
1336
1337         Reviewed by Eric Carlson.
1338
1339         The scrubber in media controls should use plus-darker blending. Then
1340         the scrubber itself should use a slightly transparent black (55% opacity)
1341         when drawing.
1342
1343         * Modules/mediacontrols/mediaControlsiOS.css:
1344         (audio::-webkit-media-controls-timeline): Add the blend mode.
1345         * Modules/mediacontrols/mediaControlsiOS.js:
1346         (ControllerIOS.prototype.drawTimelineBackground): Start drawing with
1347         transparency. I changed the order of rendering to make it
1348         more clear we draw the three parts in left to right order.
1349
1350 2015-03-24  David Hyatt  <hyatt@apple.com>
1351
1352         Improve the offsetWidth/Height layout optimization
1353         https://bugs.webkit.org/show_bug.cgi?id=143008
1354
1355         Reviewed by Dean Jackson.
1356
1357         * dom/Document.cpp:
1358         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
1359         * dom/Document.h:
1360         Change Element* to Element&. Clean up the dimension bits to use shifting. Remove both the inline and
1361         the positioning restrictions on the optimization check.
1362
1363         * dom/Element.cpp:
1364         (WebCore::Element::offsetWidth):
1365         (WebCore::Element::offsetHeight):
1366         Change to use Element& instead of Element*.
1367
1368         (WebCore::Element::clientWidth):
1369         (WebCore::Element::clientHeight):
1370         (WebCore::Element::scrollWidth):
1371         (WebCore::Element::scrollHeight):
1372         Turn on the optimization for clientWidth/Height and scrollWidth/Height.
1373
1374 2015-03-24  Yoav Weiss  <yoav@yoav.ws>
1375
1376         Stop image from displaying when src attribute is removed or emptied
1377         https://bugs.webkit.org/show_bug.cgi?id=142677
1378
1379         Reviewed by Chris Dumez.
1380
1381         Previously, we ignored empty attribute as failed URL, and didn't update the
1382         renderer when an image was removed. This patch fixes that.
1383
1384         Tests: fast/dom/HTMLImageElement/image-empty-src.html
1385                fast/dom/HTMLImageElement/image-remove-src.html
1386
1387         * loader/ImageLoader.cpp:
1388         (WebCore::ImageLoader::updateFromElement):
1389
1390 2015-03-17  Philippe Normand  <pnormand@igalia.com>
1391
1392         [OpenWebRTC] RealtimeMediaSourceCenter implementation
1393         https://bugs.webkit.org/show_bug.cgi?id=142476
1394
1395         Reviewed by Eric Carlson.
1396
1397         The old GStreamer MediaStreamCenter is replaced by the OpenWebRTC
1398         RealtimeMediaSourceCenter. It is not yet able to correctly assess
1399         MediaConstraints so it selects the first audio/video sources
1400         available through OpenWebRTC.
1401
1402         * PlatformEfl.cmake: Add new files to the build.
1403         * PlatformGTK.cmake: Ditto.
1404         * platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp: Removed.
1405         * platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp: Added.
1406         (WebCore::initializeOpenWebRTC): Simple function to initialize the
1407         framework, it is going to be used by the PeerConnection backend as well.
1408         * platform/mediastream/openwebrtc/OpenWebRTCUtilities.h: Added.
1409         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp: Added.
1410         (WebCore::mediaSourcesAvailableCallback): Function invoked once
1411         the media sources discovery succeeded within OpenWebRTC.
1412         (WebCore::RealtimeMediaSourceCenter::platformCenter): Instantiate
1413         the OpenWebRTC RealtimeMediaSourceCenter.
1414         (WebCore::RealtimeMediaSourceCenterOwr::RealtimeMediaSourceCenterOwr):
1415         (WebCore::RealtimeMediaSourceCenterOwr::~RealtimeMediaSourceCenterOwr):
1416         (WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints):
1417         Schedule a discovery process for the capture sources.
1418         (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Pick
1419         the first audio/video sources and create a MediaStream accordingly.
1420         (WebCore::RealtimeMediaSourceCenterOwr::getMediaStreamTrackSources):
1421         Not yet implemented.
1422         (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
1423         Method invoked once the capture sources process succeeded. Parse
1424         them and create an internal cache of RealtimeMediaSources accordingly.
1425         (WebCore::RealtimeMediaSourceCenterOwr::firstSource): Utility
1426         function to fetch the first source of the given type from the
1427         RealtimeMediaSources cache.
1428         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h: Renamed from Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h.
1429         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h: Added.
1430
1431 2015-03-24  Csaba Osztrogonác  <ossy@webkit.org>
1432
1433         [EFL] Add OpenWebRTC in jhbuild
1434         https://bugs.webkit.org/show_bug.cgi?id=142778
1435
1436         Reviewed by Gyuyoung Kim.
1437
1438         Original patch by Philippe Normand <pnormand@igalia.com>
1439
1440         * PlatformEfl.cmake: Add OpenWebRTC CFLAGS and LDFLAGS.
1441
1442 2015-03-23 Yoav Weiss  <yoav@yoav.ws>
1443
1444         Update empty image canvas tests and fix a related bug
1445         https://bugs.webkit.org/show_bug.cgi?id=142694
1446
1447         Reviewed by Chris Dumez.
1448
1449         During the work on https://bugs.webkit.org/show_bug.cgi?id=142677
1450         we encountered an issue with canvas tests related to empty image handling
1451         when drawn or used as a pattern. After updating these tests, an issue with
1452         pattern handling was encountered.
1453
1454         The spec, as well as Chrome's implementation, say that when an empty image
1455         is used as a pattern, createPattern should return null. See
1456         https://html.spec.whatwg.org/multipage/scripting.html#fill-and-stroke-styles:check-the-usability-of-the-image-argument
1457         Instead, createPattern returned an exception in this case.
1458         This patch fixes that and makes sure that it returns a null when image loading hasn't started.
1459
1460         Tests: canvas/philip/tests/2d.drawImage.incomplete.emptysrc.html
1461                canvas/philip/tests/2d.drawImage.incomplete.nosrc.html
1462                canvas/philip/tests/2d.drawImage.incomplete.removedsrc.html
1463                canvas/philip/tests/2d.pattern.image.incomplete.emptysrc.html
1464                canvas/philip/tests/2d.pattern.image.incomplete.removedsrc.html
1465
1466         * html/canvas/CanvasRenderingContext2D.cpp:
1467         (WebCore::CanvasRenderingContext2D::createPattern): Return "null" if image is not fully decodeable.
1468
1469 2015-03-23  Alex Christensen  <achristensen@webkit.org>
1470
1471         Fix api tests after r181876.
1472
1473         * contentextensions/ContentExtensionsBackend.cpp:
1474         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1475         Always append a CSSDisplayNoneStyleSheet action if no ignore-previous-rules is seen.
1476         * loader/cache/CachedResourceLoader.cpp:
1477         (WebCore::CachedResourceLoader::requestResource):
1478         Changed an assertion to a null check.
1479
1480 2015-03-23  Dean Jackson  <dino@apple.com>
1481
1482         Timelines are sharing the same canvas background
1483         https://bugs.webkit.org/show_bug.cgi?id=142994
1484         <rdar://problem/20209466>
1485
1486         Reviewed by Brent Fulgham.
1487
1488         Since each MediaControl lives in an isolated world, we
1489         can't rely on a global variable to provide a unique
1490         identifier for a named canvas. The fix is to expose
1491         WebCore's UUID generator, and have each canvas use
1492         that for a name.
1493
1494         * Modules/mediacontrols/MediaControlsHost.cpp:
1495         (WebCore::MediaControlsHost::generateUUID): New method on the
1496         MediaControlsHost that generates a UUID.
1497         * Modules/mediacontrols/MediaControlsHost.h:
1498         * Modules/mediacontrols/MediaControlsHost.idl:
1499
1500         * Modules/mediacontrols/mediaControlsApple.js: Remove the global
1501         variable unique ID that wasn't working, and instead get
1502         an ID from the MediaControlsHost.
1503         (Controller.prototype.createControls):
1504         * Modules/mediacontrols/mediaControlsiOS.js:
1505         (ControllerIOS):
1506
1507 2015-03-23  Brent Fulgham  <bfulgham@apple.com>
1508
1509         Scroll latching logic can get stuck in 'scrollable="no"' iframes
1510         https://bugs.webkit.org/show_bug.cgi?id=142789
1511         <rdar://problem/20129494>
1512
1513         Reviewed by Dean Jackson.
1514
1515         Clean up the EventHandler and latching code as follows:
1516         (1) Do not handle iframe elements as part of the normal latching logic. Instead, iframes should
1517             be evaluated during the 'platformCompleteWheelEvent' phase of processing as top-level scrolling
1518             frames.
1519         (2) Get rid of the ill-conceived notation that we should process non-mainframe and main-frame frames
1520             different.
1521         (3) Modify code to reflect that the scroll latching code really deals with overflow scrolling. Consequently,
1522             the 'findEnclosingScrollableContainer' was renamed to 'findEnclosingOverflowScroll' and does not
1523             treat iframe as a suitable target.
1524         (4) Do not create a latching state object when the container being evaluated is already scrolled to the
1525             extreme position in the direction of the mouse gesture. In this case, we want the enclosing frame
1526             to be the latching target.
1527         (5) Do not treat the state where the mouse wheel gesture has ended manual scrolling, but has not ended
1528             momentum scrolling, as an appropriate time to select a latching target.
1529
1530         * page/EventHandler.cpp:
1531         (WebCore::EventHandler::platformCompleteWheelEvent): Modify signature to remove unneeded argument.
1532         (WebCore::EventHandler::handleWheelEvent): Modify call to 'platformCompleteWheelEvent' to remove unused argument.
1533         * page/EventHandler.h:
1534         * page/mac/EventHandlerMac.mm:
1535         (WebCore::findEnclosingOverflowScroll): Renamed from 'findEnclosingScrollableContainer' and revised per the
1536         notes above.
1537         (WebCore::EventHandler::platformPrepareForWheelEvents): Remove mainFrame vs. non-mainFrame code paths and
1538         consolidate logic.
1539         (WebCore::EventHandler::platformCompleteWheelEvent): Remove unused argument. The wheel event target is no
1540         longer needed here, now that iframes are not processed by this code.
1541         (WebCore::findEnclosingScrollableContainer): Deleted.
1542         * page/scrolling/ScrollLatchingState.cpp:
1543         (WebCore::ScrollLatchingState::setPreviousWheelScrolledElement:) Switch to move operator for passing
1544         a temporary RefPtr to the the function.
1545         * page/scrolling/ScrollLatchingState.h:
1546         * platform/PlatformWheelEvent.h:
1547         (WebCore::PlatformWheelEvent::useLatchedEventElement): Recognize 'phase=ended, momentum=none' as a state
1548         that should not cause latching state to be revised.
1549
1550 2015-03-23  Anders Carlsson  <andersca@apple.com>
1551
1552         Try to fix the iOS build.
1553
1554         * platform/network/mac/CookieJarMac.mm:
1555
1556 2015-03-23  Brady Eidson  <beidson@apple.com>
1557
1558         Content extensions should apply css selectors
1559         https://bugs.webkit.org/show_bug.cgi?id=142604
1560
1561         Reviewed by Alex Christensen.
1562
1563         Tests: http/tests/contentextensions/css-display-none.html
1564
1565         * WebCore.xcodeproj/project.pbxproj:
1566
1567         * contentextensions/ContentExtension.cpp:
1568         (WebCore::ContentExtensions::ContentExtension::create):
1569         (WebCore::ContentExtensions::ContentExtension::ContentExtension):
1570         (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
1571         * contentextensions/ContentExtension.h:
1572         (WebCore::ContentExtensions::ContentExtension::identifier):
1573         (WebCore::ContentExtensions::ContentExtension::compiledExtension):
1574
1575         * contentextensions/ContentExtensionsBackend.cpp:
1576         (WebCore::ContentExtensions::ContentExtensionsBackend::addContentExtension):
1577         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1578         (WebCore::ContentExtensions::ContentExtensionsBackend::globalDisplayNoneStyleSheet):
1579         * contentextensions/ContentExtensionsBackend.h:
1580
1581         * contentextensions/DFABytecodeInterpreter.cpp:
1582         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1583
1584         * dom/DocumentStyleSheetCollection.cpp:
1585         (WebCore::DocumentStyleSheetCollection::maybeAddContentExtensionSheet):
1586         * dom/DocumentStyleSheetCollection.h:
1587
1588         * loader/DocumentLoader.cpp:
1589         (WebCore::DocumentLoader::commitData):
1590         (WebCore::DocumentLoader::startLoadingMainResource):
1591         (WebCore::DocumentLoader::addPendingContentExtensionSheet):
1592         * loader/DocumentLoader.h:
1593
1594         * loader/cache/CachedResourceLoader.cpp:
1595         (WebCore::CachedResourceLoader::requestResource):
1596
1597         * loader/cache/CachedResourceRequest.cpp:
1598         (WebCore::CachedResourceRequest::setInitiator):
1599         * loader/cache/CachedResourceRequest.h:
1600         (WebCore::CachedResourceRequest::initiatingDocumentLoader):
1601
1602         * page/UserContentController.cpp:
1603         (WebCore::UserContentController::globalDisplayNoneStyleSheet):
1604         (WebCore::UserContentController::displayNoneCSSRule):
1605         * page/UserContentController.h:
1606
1607 2015-03-23  Anders Carlsson  <andersca@apple.com>
1608
1609         -[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:] doesn't remove cookies
1610         https://bugs.webkit.org/show_bug.cgi?id=142990
1611         rdar://problem/20241645
1612
1613         Reviewed by Andreas Kling.
1614
1615         Use the Mac version of deleteAllCookiesModifiedSince on iOS as well.
1616
1617         * platform/network/cf/CookieJarCFNet.cpp:
1618         * platform/network/mac/CookieJarMac.mm:
1619
1620 2015-03-23  Conrad Shultz  <conrad_shultz@apple.com>
1621
1622         Replace uses of kCTFontSystemFontType
1623         https://bugs.webkit.org/show_bug.cgi?id=142984
1624
1625         Reviewed by Tim Horton.
1626
1627         * rendering/RenderThemeMac.mm:
1628         (WebCore::AttachmentLayout::layOutTitle):
1629         (WebCore::AttachmentLayout::layOutSubtitle):
1630
1631 2015-03-23  Dean Jackson  <dino@apple.com>
1632
1633         kCTFontSystemFontType is deprecated in CoreText
1634         https://bugs.webkit.org/show_bug.cgi?id=142981
1635         <rdar://problem/20261171>
1636
1637         Reviewed by Beth Dakin.
1638
1639         Update to the non-deprecated version.
1640
1641         * rendering/RenderThemeIOS.mm: kCTFontSystemFontType -> kCTFontUIFontSystem
1642         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
1643
1644 2015-03-23  Eric Carlson  <eric.carlson@apple.com>
1645
1646         [Mac] Enable fullscreen for MSE-based videos
1647         https://bugs.webkit.org/show_bug.cgi?id=142971
1648
1649         Reviewed by Jer Noble.
1650
1651         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1652         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsFullscreen): Return true;
1653
1654 2015-03-23  Alex Christensen  <achristensen@webkit.org>
1655
1656         [MediaFoundation] Implement seek.
1657         https://bugs.webkit.org/show_bug.cgi?id=142594
1658
1659         Reviewed by Darin Adler.
1660
1661         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1662         (WebCore::MediaPlayerPrivateMediaFoundation::seeking):
1663         (WebCore::MediaPlayerPrivateMediaFoundation::seekDouble):
1664         (WebCore::MediaPlayerPrivateMediaFoundation::durationDouble):
1665         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
1666
1667 2015-03-23  Dan Bernstein  <mitz@apple.com>
1668
1669         Fixed the build.
1670
1671         * platform/graphics/cocoa/FontCocoa.mm:
1672         (WebCore::Font::platformBoundsForGlyph): Switched to non-deprecated CTFontOrientation values.
1673         (WebCore::Font::platformWidthForGlyph): Ditto.
1674
1675 2015-03-23  Jer Noble  <jer.noble@apple.com>
1676
1677         [iOS] Accessibility crashing because MediaPlayer is laying out UI off the main thread
1678         https://bugs.webkit.org/show_bug.cgi?id=142970
1679
1680         Reviewed by Eric Carlson.
1681
1682         Return early after synchronously calling to the main thread to allocate the volume
1683         view, to avoid re-allocating the volume view again on the web thread.
1684
1685         * platform/audio/ios/MediaSessionManagerIOS.mm:
1686         (-[WebMediaSessionHelper allocateVolumeView]):
1687
1688 2015-03-23  Tim Horton  <timothy_horton@apple.com>
1689
1690         Add a share item to the link action menu
1691         https://bugs.webkit.org/show_bug.cgi?id=142961
1692         <rdar://problem/19198374>
1693
1694         Reviewed by Beth Dakin.
1695
1696         * English.lproj/Localizable.strings:
1697         Remove some now-unused strings.
1698
1699         * platform/spi/mac/NSMenuSPI.h:
1700         Add some SPI.
1701
1702 2015-03-23  David Kilzer  <ddkilzer@apple.com>
1703
1704         [iOS] Build fix: CoreText deprecated kCTFontSystemFontType
1705
1706         Fix tracked by:  <rdar://problem/20261171>
1707
1708         * rendering/RenderThemeIOS.mm:
1709         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
1710         Add clang pragmas.
1711
1712 2015-03-23  Brent Fulgham  <bfulgham@apple.com>
1713
1714         Unreviewed test fix.
1715
1716         * css/CSSParser.cpp:
1717         (WebCore::CSSParser::parseScrollSnapDestination): Remove new assertion.
1718
1719 2015-03-23  Brent Fulgham  <bfulgham@apple.com>
1720
1721         scroll-snap-destination and scroll-snap-coordinate do not seem to work together properly
1722         https://bugs.webkit.org/show_bug.cgi?id=142552
1723         <rdar://problem/20114743>
1724
1725         Reviewed by Dean Jackson.
1726
1727         Revise the snap point logic as follows:
1728         (1) Put the snap point destination handling in a helper function to make the rest of the code
1729             easier to read.
1730         (2) Make sure we always have a left-hand snap point (i.e., position 0), but don't add multiple
1731             left-hand snap points.
1732         (3) Create a helper function to determine if we should be working with the scroll snap 'elements'
1733             behavior. We want to use this for scroll-snap-destination/scroll-snap-coordinate markup.
1734         (4) Create per-element snap point offsets when using scroll-snap-destination/scroll-snap-coordinate.
1735
1736         * css/CSSParser.cpp:
1737         (WebCore::CSSParser::parseScrollSnapDestination): Add assertion to try to catch bad parser state.
1738         * page/scrolling/AxisScrollSnapOffsets.cpp:
1739         (WebCore::destinationOffsetForViewSize): Added helper function to consolidate logic for handling
1740         destination coordinates.
1741         (WebCore::updateFromStyle): Make sure a left-hand snap point is always provided.
1742         (WebCore::styleUsesElements): Added helper function.
1743         (WebCore::updateSnapOffsetsForScrollableArea): Revise logic to generate 'per-element' snap point
1744         offsets.
1745
1746 2015-03-23  Yoav Weiss  <yoav@yoav.ws>
1747
1748         Refactor ImageLoader's setting of CachedImage
1749         https://bugs.webkit.org/show_bug.cgi?id=142825
1750
1751         Reviewed by Chris Dumez.
1752
1753         No new tests, since there's no functional change.
1754
1755         setImage and setImageWithoutConsideringPendingLoadEvent were not called with new
1756         CachedImages and were not used as originally intended. That resulted in some dead code,
1757         and confusion when going over the code.
1758         This patch renames these methods into equivalent clearImage* methods, and deletes resulting dead code.
1759
1760         * html/HTMLObjectElement.cpp:
1761         (WebCore::HTMLObjectElement::renderFallbackContent): Changed setImage call to clearImage.
1762         * loader/ImageLoader.cpp:
1763         (WebCore::ImageLoader::clearImage):
1764         (WebCore::ImageLoader::clearImageWithoutConsideringPendingLoadEvent):
1765         (WebCore::ImageLoader::notifyFinished):
1766         (WebCore::ImageLoader::elementDidMoveToNewDocument):
1767         (WebCore::ImageLoader::setImage): Deleted.
1768         (WebCore::ImageLoader::setImageWithoutConsideringPendingLoadEvent): Deleted.
1769         * loader/ImageLoader.h:
1770
1771 2015-03-22  Benjamin Poulain  <benjamin@webkit.org>
1772
1773         CSS Selectors: fix attribute case-insensitive matching of Contain and List
1774         https://bugs.webkit.org/show_bug.cgi?id=142932
1775
1776         Reviewed by Darin Adler.
1777
1778         Fix the last two attribute selectors that were using full case-insensitive
1779         match:
1780             -Contain ([foo*=bar]).
1781             -List (foo~=bar]).
1782
1783         Tests: fast/selectors/attribute-contains-value-matching-is-ascii-case-insensitive.html
1784                fast/selectors/attribute-list-value-matching-is-ascii-case-insensitive.html
1785
1786         * css/SelectorChecker.cpp:
1787         (WebCore::attributeValueMatches):
1788         * cssjit/SelectorCompiler.cpp:
1789         (WebCore::SelectorCompiler::attributeValueContains):
1790         (WebCore::SelectorCompiler::attributeValueSpaceSeparetedListContains):
1791
1792 2015-03-22  Benjamin Poulain  <bpoulain@apple.com>
1793
1794         Detect when url filter pattern with groups match the empty string
1795         https://bugs.webkit.org/show_bug.cgi?id=142930
1796
1797         Reviewed by Sam Weinig.
1798
1799         The previous test was only accounting for simple atoms. This patch extends
1800         it to groups.
1801
1802         * contentextensions/URLFilterParser.cpp:
1803         (WebCore::ContentExtensions::Term::quantify):
1804         (WebCore::ContentExtensions::Term::matchesAtLeastOneCharacter):
1805         (WebCore::ContentExtensions::GraphBuilder::finalize):
1806         (WebCore::ContentExtensions::Term::quantifier): Deleted.
1807
1808 2015-03-22  Eric Carlson  <eric.carlson@apple.com>
1809
1810         [Mac] Enable WIRELESS_PLAYBACK_TARGET for WK1
1811         https://bugs.webkit.org/show_bug.cgi?id=142940
1812
1813         Reviewed by Sam Weinig.
1814
1815         * dom/Document.cpp:
1816         (WebCore::Document::didChoosePlaybackTarget): const-ify the didChoosePlaybackTarget argument.
1817         * dom/Document.h:
1818
1819         * html/HTMLMediaSession.cpp:
1820         (WebCore::HTMLMediaSession::didChoosePlaybackTarget): Ditto.
1821         * html/HTMLMediaSession.h:
1822
1823         * page/Page.cpp:
1824         (WebCore::Page::didChoosePlaybackTarget):  Ditto.
1825         * page/Page.h:
1826
1827         * platform/audio/MediaSession.h:
1828         * platform/graphics/MediaPlaybackTargetPickerClient.h:
1829         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: 
1830         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):  Ditto.
1831
1832 2015-03-22  Anders Carlsson  <andersca@apple.com>
1833
1834         _WKWebsiteDataStore should clear WebSQL databases
1835         https://bugs.webkit.org/show_bug.cgi?id=142947
1836
1837         Reviewed by Sam Weinig.
1838
1839         * Modules/webdatabase/DatabaseTracker.cpp:
1840         (WebCore::DatabaseTracker::trackerWithDatabasePath):
1841         Add a hack so we can get at a tracker from the UI process.
1842
1843         (WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
1844         New function that deletes all databases modified after a given time.
1845
1846         * Modules/webdatabase/DatabaseTracker.h:
1847         Add new members and export the ones we want to call from WebKit2.
1848
1849         * Modules/webdatabase/OriginLock.h:
1850         Export the destructor.
1851
1852 2015-03-21  Dean Jackson  <dino@apple.com>
1853
1854         Remove the prefix for CSS Transforms
1855         https://bugs.webkit.org/show_bug.cgi?id=142927
1856         <rdar://problem/11568151>
1857
1858         Reviewed by Simon Fraser.
1859
1860         Support the bare form of:
1861         - transform
1862         - transform-style
1863         - transform-origin
1864         - perspective
1865         - perspective-origin
1866
1867         For transform-style, we also still differentiate the prefixed property
1868         because we may want to use that as an indicator of legacy content.
1869
1870         This is mostly a find and replace, but with some related naming
1871         changes. The DOM interface for WebKitCSSTransformValue remains
1872         unchanged.
1873
1874         Tests: transforms/2d/transform-2d-prefixed.html
1875                transforms/3d/general/prefixed-3dtransform-values.html
1876
1877         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
1878         (WebCore::propertyChangeMayRepaintNonDescendants):
1879         * css/CSSComputedStyleDeclaration.cpp:
1880         (WebCore::isLayoutDependent):
1881         (WebCore::ComputedStyleExtractor::propertyValue):
1882         * css/CSSParser.cpp:
1883         (WebCore::isValidKeywordPropertyAndValue):
1884         (WebCore::isKeywordPropertyID):
1885         (WebCore::parseTranslateTransformValue):
1886         (WebCore::CSSParser::parseValue):
1887         (WebCore::CSSParser::parseTransformOrigin):
1888         (WebCore::CSSParser::parsePerspectiveOrigin):
1889         * css/CSSPropertyNames.in:
1890         * css/StyleProperties.cpp:
1891         (WebCore::StyleProperties::getPropertyValue):
1892         (WebCore::StyleProperties::asText):
1893         * css/WebKitCSSMatrix.cpp:
1894         (WebCore::WebKitCSSMatrix::setMatrixValue):
1895         * html/track/VTTCue.cpp:
1896         (WebCore::VTTCueBox::applyCSSProperties):
1897         * page/animation/AnimationController.cpp:
1898         (WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
1899         * page/animation/CSSPropertyAnimation.cpp:
1900         (WebCore::PropertyWrapperAcceleratedTransform::PropertyWrapperAcceleratedTransform):
1901         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
1902         * page/animation/CompositeAnimation.cpp:
1903         (WebCore::CompositeAnimation::computeExtentOfTransformAnimation):
1904         * page/animation/ImplicitAnimation.cpp:
1905         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation):
1906         * page/animation/KeyframeAnimation.cpp:
1907         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
1908         (WebCore::KeyframeAnimation::validateTransformFunctionList):
1909         * platform/graphics/GraphicsLayer.cpp:
1910         (WebCore::GraphicsLayer::validateTransformOperations):
1911         * platform/graphics/GraphicsLayerClient.h:
1912         * platform/graphics/ca/GraphicsLayerCA.cpp:
1913         (WebCore::propertyIdToString):
1914         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
1915         (WebCore::GraphicsLayerCA::addAnimation):
1916         (WebCore::GraphicsLayerCA::isRunningTransformAnimation):
1917         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
1918         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
1919         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
1920         (WebCore::GraphicsLayerTextureMapper::addAnimation):
1921         * platform/graphics/texmap/TextureMapperAnimation.cpp:
1922         (WebCore::TextureMapperAnimation::applyInternal):
1923         * platform/graphics/texmap/TextureMapperLayer.cpp:
1924         (WebCore::TextureMapperLayer::syncAnimations):
1925         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1926         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHasActiveTransformAnimation):
1927         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms):
1928         (WebCore::CoordinatedGraphicsLayer::addAnimation):
1929         * rendering/RenderLayerBacking.cpp:
1930         (WebCore::RenderLayerBacking::updateGeometry):
1931         (WebCore::RenderLayerBacking::startAnimation):
1932         (WebCore::RenderLayerBacking::startTransition):
1933         (WebCore::RenderLayerBacking::graphicsLayerToCSSProperty):
1934         (WebCore::RenderLayerBacking::cssToGraphicsLayerProperty):
1935         * rendering/RenderLayerCompositor.cpp:
1936         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
1937         (WebCore::RenderLayerCompositor::isRunningTransformAnimation):
1938         * svg/SVGElement.cpp:
1939         (WebCore::populateAttributeNameToCSSPropertyIDMap):
1940
1941 2015-03-21  Commit Queue  <commit-queue@webkit.org>
1942
1943         Unreviewed, rolling out r181824.
1944         https://bugs.webkit.org/show_bug.cgi?id=142935
1945
1946         Broke Windows build (Requested by ap on #webkit).
1947
1948         Reverted changeset:
1949
1950         "Remove the prefix for CSS Transforms"
1951         https://bugs.webkit.org/show_bug.cgi?id=142927
1952         http://trac.webkit.org/changeset/181824
1953
1954 2015-03-20  Dean Jackson  <dino@apple.com>
1955
1956         Remove the prefix for CSS Transforms
1957         https://bugs.webkit.org/show_bug.cgi?id=142927
1958         <rdar://problem/11568151>
1959
1960         Reviewed by Simon Fraser.
1961
1962         Support the bare form of:
1963         - transform
1964         - transform-style
1965         - transform-origin
1966         - perspective
1967         - perspective-origin
1968
1969         For transform-style, we also still differentiate the prefixed property
1970         because we may want to use that as an indicator of legacy content.
1971
1972         This is mostly a find and replace, but with some related naming
1973         changes. The DOM interface for WebKitCSSTransformValue remains
1974         unchanged.
1975
1976         Tests: transforms/2d/transform-2d-prefixed.html
1977                transforms/3d/general/prefixed-3dtransform-values.html
1978
1979         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
1980         (WebCore::propertyChangeMayRepaintNonDescendants):
1981         * css/CSSComputedStyleDeclaration.cpp:
1982         (WebCore::isLayoutDependent):
1983         (WebCore::ComputedStyleExtractor::propertyValue):
1984         * css/CSSParser.cpp:
1985         (WebCore::isValidKeywordPropertyAndValue):
1986         (WebCore::isKeywordPropertyID):
1987         (WebCore::parseTranslateTransformValue):
1988         (WebCore::CSSParser::parseValue):
1989         (WebCore::CSSParser::parseTransformOrigin):
1990         (WebCore::CSSParser::parsePerspectiveOrigin):
1991         * css/CSSPropertyNames.in:
1992         * css/StyleProperties.cpp:
1993         (WebCore::StyleProperties::getPropertyValue):
1994         (WebCore::StyleProperties::asText):
1995         * css/WebKitCSSMatrix.cpp:
1996         (WebCore::WebKitCSSMatrix::setMatrixValue):
1997         * html/track/VTTCue.cpp:
1998         (WebCore::VTTCueBox::applyCSSProperties):
1999         * page/animation/AnimationController.cpp:
2000         (WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
2001         * page/animation/CSSPropertyAnimation.cpp:
2002         (WebCore::PropertyWrapperAcceleratedTransform::PropertyWrapperAcceleratedTransform):
2003         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2004         * page/animation/CompositeAnimation.cpp:
2005         (WebCore::CompositeAnimation::computeExtentOfTransformAnimation):
2006         * page/animation/ImplicitAnimation.cpp:
2007         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation):
2008         * page/animation/KeyframeAnimation.cpp:
2009         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
2010         (WebCore::KeyframeAnimation::validateTransformFunctionList):
2011         * platform/graphics/GraphicsLayer.cpp:
2012         (WebCore::GraphicsLayer::validateTransformOperations):
2013         * platform/graphics/GraphicsLayerClient.h:
2014         * platform/graphics/ca/GraphicsLayerCA.cpp:
2015         (WebCore::propertyIdToString):
2016         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
2017         (WebCore::GraphicsLayerCA::addAnimation):
2018         (WebCore::GraphicsLayerCA::isRunningTransformAnimation):
2019         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
2020         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2021         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2022         (WebCore::GraphicsLayerTextureMapper::addAnimation):
2023         * platform/graphics/texmap/TextureMapperAnimation.cpp:
2024         (WebCore::TextureMapperAnimation::applyInternal):
2025         * platform/graphics/texmap/TextureMapperLayer.cpp:
2026         (WebCore::TextureMapperLayer::syncAnimations):
2027         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2028         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHasActiveTransformAnimation):
2029         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms):
2030         (WebCore::CoordinatedGraphicsLayer::addAnimation):
2031         * rendering/RenderLayerBacking.cpp:
2032         (WebCore::RenderLayerBacking::updateGeometry):
2033         (WebCore::RenderLayerBacking::startAnimation):
2034         (WebCore::RenderLayerBacking::startTransition):
2035         (WebCore::RenderLayerBacking::graphicsLayerToCSSProperty):
2036         (WebCore::RenderLayerBacking::cssToGraphicsLayerProperty):
2037         * rendering/RenderLayerCompositor.cpp:
2038         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
2039         (WebCore::RenderLayerCompositor::isRunningTransformAnimation):
2040         * svg/SVGElement.cpp:
2041         (WebCore::populateAttributeNameToCSSPropertyIDMap):
2042
2043 2015-03-20  Yusuke Suzuki  <utatane.tea@gmail.com>
2044
2045         REGRESSION (r179429): Potential Use after free in JavaScriptCore`WTF::StringImpl::ref + 83
2046         https://bugs.webkit.org/show_bug.cgi?id=142410
2047
2048         Reviewed by Geoffrey Garen.
2049
2050         The same issues are found in the existing code; PropertyName does not have ownership.
2051         This patch rewrite the point that should have ownership to Identifier.
2052
2053         * bindings/js/JSDOMWindowCustom.cpp:
2054         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
2055         (WebCore::JSDOMWindow::putByIndex):
2056         * bindings/js/ReadableStreamJSSource.cpp:
2057         (WebCore::getInternalSlotFromObject):
2058         * bindings/scripts/CodeGeneratorJS.pm:
2059         (GenerateImplementation):
2060         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2061         (WebCore::JSTestCustomNamedGetter::getOwnPropertySlotByIndex):
2062         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2063         (WebCore::JSTestEventTarget::getOwnPropertySlotByIndex):
2064         * bindings/scripts/test/JS/JSTestInterface.cpp:
2065         (WebCore::JSTestInterface::putByIndex):
2066
2067 2015-03-20  Simon Fraser  <simon.fraser@apple.com>
2068
2069         Log the slow-scrolling reasons (if any) on first commit of a ScrollingTreeFrameScrollingNodeMac
2070         https://bugs.webkit.org/show_bug.cgi?id=142917
2071
2072         Reviewed by Beth Dakin.
2073         
2074         The scrollperf test would fail to detect transitions between slow and fast scrolling
2075         for new pages, because there was no logging when slow-scrolling scrolling tree was
2076         torn down, and a new fast-scrolling tree constructed.
2077         
2078         Fix by always logging the slow-scrolling reasons in the first update of the
2079         ScrollingTreeFrameScrollingNodeMac, even when the slow-scrolling reasons haven't
2080         changed.
2081
2082         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2083         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2084         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
2085         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
2086
2087 2015-03-19  Geoffrey Garen  <ggaren@apple.com>
2088
2089         Function.prototype.toString should not decompile the AST
2090         https://bugs.webkit.org/show_bug.cgi?id=142853
2091
2092         Reviewed by Sam Weinig.
2093
2094         * bindings/js/JSLazyEventListener.cpp:
2095         (WebCore::JSLazyEventListener::initializeJSFunction): Adjust the line
2096         number of attribute event listeners to account for the leading newline
2097         now added by JavaScriptCore.
2098
2099         This solution is not perfect, but there are a lot of pre-existing problems
2100         with line and column reporting for attribute event listeners, and this
2101         preserves existing behavior with reasonable reliability.
2102
2103 2015-03-20  Alex Christensen  <achristensen@webkit.org>
2104
2105         Progress towards CMake on Mac.
2106         https://bugs.webkit.org/show_bug.cgi?id=136003
2107
2108         Reviewed by Chris Dumez.
2109
2110         * PlatformMac.cmake:
2111         Added some directories to create forwarding headers from.
2112         Generate ObjC bindings.
2113
2114 2015-03-20  Per Arne Vollan  <peavo@outlook.com>
2115
2116         [WinCairo] Crash when leaving page while video is playing.
2117         https://bugs.webkit.org/show_bug.cgi?id=142578
2118
2119         Reviewed by Alex Christensen.
2120
2121         This can happen when there is an asynchronous event invoked from a video worker
2122         thread, accessing the media player object after it has been deleted.
2123         This is solved by resetting the media player pointer in the event object,
2124         when the media player is deleted.
2125
2126         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2127         (WebCore::MediaPlayerPrivateMediaFoundation::~MediaPlayerPrivateMediaFoundation):
2128         (WebCore::MediaPlayerPrivateMediaFoundation::addListener):
2129         (WebCore::MediaPlayerPrivateMediaFoundation::removeListener):
2130         (WebCore::MediaPlayerPrivateMediaFoundation::notifyDeleted):
2131         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::AsyncCallback):
2132         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::~AsyncCallback):
2133         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::Invoke):
2134         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::onMediaPlayerDeleted):
2135         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2136         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerListener::MediaPlayerListener):
2137         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerListener::~MediaPlayerListener):
2138         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerListener::onMediaPlayerDeleted):
2139
2140 2015-03-20  Chris Dumez  <cdumez@apple.com>
2141
2142         Regression(r181782): Caused WebKit2.RestoreSessionStateContainingFormData API test to crash
2143         https://bugs.webkit.org/show_bug.cgi?id=142911
2144
2145         Reviewed by Antti Koivisto.
2146
2147         Drop the isBackForwardLoadType(m_loadType) assertion in
2148         FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad(). This assertion
2149         used to hold true when goToBackForwardItem() was only called with
2150         history navigation load types. However, after r181782, we use a Standard
2151         load in the cases where we do not wish to display stale content (e.g.
2152         restoring session state).
2153
2154         The assertion comment says "We only use cache-only loads to avoid
2155         resubmitting forms". However, we then call loadDifferentDocumentItem()
2156         which already takes care of using the ReturnCacheDataElseLoad cache
2157         policy as the HistoryItem has form data and we pass
2158         MayNotAttemptCacheOnlyLoadForFormSubmissionItem as parameter.
2159
2160         No new tests, covered by WebKit2.RestoreSessionStateContainingFormData
2161         API test.
2162
2163         * loader/FrameLoader.cpp:
2164         (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
2165
2166 2015-03-20  Andy Estes  <aestes@apple.com>
2167
2168         [Content Filtering] Adopt NEFilterSource unblock handling
2169         https://bugs.webkit.org/show_bug.cgi?id=142904
2170
2171         Reviewed by Andreas Kling.
2172
2173         * platform/cocoa/NetworkExtensionContentFilter.mm:
2174         (WebCore::NetworkExtensionContentFilter::unblockHandler):
2175         Returned an unblock handler that calls -[NEFilterSource remediateWithDecisionHandler:].
2176         * platform/cocoa/ParentalControlsContentFilter.mm:
2177         (WebCore::ParentalControlsContentFilter::unblockHandler): Used ASCIILiteral.
2178
2179 2015-03-19  Andy Estes  <aestes@apple.com>
2180
2181         [Content Filtering] Add tests for unblock requests
2182         https://bugs.webkit.org/show_bug.cgi?id=142900
2183
2184         Reviewed by Andreas Kling.
2185
2186         Currently the iOS Parental Controls content filter has a mechanism for requesting that a page be unblocked.
2187         WebKit implements this by listening for navigations originating from the filter's error page to a special URL,
2188         and requesting the page be unblocked via platform API, which might cause UI to be displayed. If the unblock is
2189         successful then we schedule a reload of the frame in order to display the unblocked document.
2190
2191         NetworkExtension also supports unblock requests, so in preparation for adopting its API, this patch allows
2192         content filters to specify their own unblock request method, teaches MockContentFilter to provide such a method,
2193         and writes tests to cover both allowed and denied unblock requests.
2194
2195         The content filter that blocks a load creates a ContentFilterUnblockHandler, passing it a lambda that is executed
2196         when a navigation matches the filter's special unblock URL. Filters can also specify that a script be executed in
2197         the context of its error page if the unblock is denied.
2198
2199         All platform content filters can handle unblock requests like this with the exception of iOS Parental Controls in WebKit2.
2200         Since UI can be displayed by the system in this case, the request must be made from within the UI process. Therefore the
2201         existing method is retained of serializing a WebFilterEvaluator and intercepting navigation policy calls in the UI process.
2202
2203         Tests: contentfiltering/allow-after-unblock-request.html
2204                contentfiltering/block-after-unblock-request.html
2205
2206         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
2207         (WebCore::JSMockContentFilterSettings::decisionPoint): Added some using statements for clarity.
2208         (WebCore::JSMockContentFilterSettings::setDecisionPoint): Ditto.
2209         (WebCore::toJSValue): Returns a JSValue from a Decision.
2210         (WebCore::toDecision): Returns a Decision from a JSValue.
2211         (WebCore::JSMockContentFilterSettings::decision): Used toJSValue.
2212         (WebCore::JSMockContentFilterSettings::setDecision): Used toDecision.
2213         (WebCore::JSMockContentFilterSettings::unblockRequestDecision): Used toJSValue.
2214         (WebCore::JSMockContentFilterSettings::setUnblockRequestDecision): Used toDecision.
2215         * loader/ContentFilter.cpp:
2216         (WebCore::ContentFilter::createIfNeeded): Passed a reference to the owning DocumentLoader.
2217         (WebCore::ContentFilter::ContentFilter): Ditto.
2218         (WebCore::ContentFilter::unblockHandler): If the unblockHandler requests that a script be executed when an
2219         unblock request is denied, create a wrapper unblockHandler that executes that script in m_documentLoader's frame.
2220         * loader/ContentFilter.h:
2221         * loader/DocumentLoader.cpp:
2222         (WebCore::DocumentLoader::responseReceived): Passed this to ContentFilter::createIfNeeded.
2223         * loader/FrameLoader.cpp:
2224         (WebCore::FrameLoader::prepareForLoadStart): Called PolicyChecker::prepareForLoadStart.
2225         * loader/PolicyChecker.cpp:
2226         (WebCore::PolicyChecker::prepareForLoadStart): Reset m_contentFilterUnblockHandler.
2227         (WebCore::PolicyChecker::checkNavigationPolicy): Moved logic to here from WebKit1's WebFrameLoaderClient.
2228         Placing it here allows it to be shared between WebKit1 and WebKit2 (when the unblock handler does not need to
2229         be called in the UI process).
2230         * loader/PolicyChecker.h:
2231         (WebCore::PolicyChecker::setContentFilterUnblockHandler): Added.
2232         * page/Frame.h: Made Frame ThreadSafeRefCounted, since RefPtr<Frames> are captured in lambdas that can be
2233         copied by background threads managed by the underlying platform.
2234         * platform/ContentFilterUnblockHandler.h:
2235         (WebCore::ContentFilterUnblockHandler::unblockURLScheme): Returned the Apple content filter scheme.
2236         (WebCore::ContentFilterUnblockHandler::unblockURLHost): Returned the unblock URL host.
2237         (WebCore::ContentFilterUnblockHandler::clear): Deleted.
2238         * platform/PlatformContentFilter.h:
2239         (WebCore::PlatformContentFilter::unblockRequestDeniedScript): Returned the unblock request denied script.
2240         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
2241         (WebCore::ContentFilterUnblockHandler::ContentFilterUnblockHandler): Added a constructor that takes an
2242         unblockURLHost and a UnblockRequesterFunction. Added an alternate constructor for iOS Parental Controls on
2243         WebKit2 that takes an unblockURLHost and a WebFilterEvaluator.
2244         (WebCore::ContentFilterUnblockHandler::needsUIProcess): Returned true if m_webFilterEvaluator is non-null.
2245         (WebCore::ContentFilterUnblockHandler::encode): Encoded m_unblockURLHost in addition to m_webFilterEvaluator.
2246         (WebCore::ContentFilterUnblockHandler::decode): Decoded m_unblockURLHost in addition to m_webFilterEvaluator.
2247         (WebCore::ContentFilterUnblockHandler::canHandleRequest): Returned true if there is a either a m_unblockRequester
2248         or a m_webFilterEvaluator and the request's host and scheme match those of the unblock request URL.
2249         (WebCore::dispatchToMainThread): Added a helper to dispatch a block to the main thread. Then if the web thread
2250         is enabled on iOS, dispatch it there.
2251         (WebCore::ContentFilterUnblockHandler::requestUnblockAsync): Renamed from handleUnblockRequestAndDispatchIfSuccessful.
2252         Requested an unblock using either m_unblockRequester or m_webFilterEvaluator, then called decisionHandler with the response.
2253         (WebCore::scheme): Moved to ContentFilterUnblockHandler::unblockURLScheme.
2254         (WebCore::ContentFilterUnblockHandler::handleUnblockRequestAndDispatchIfSuccessful): Renamed to requestUnblockAsync.
2255         * platform/cocoa/ParentalControlsContentFilter.mm:
2256         (WebCore::ParentalControlsContentFilter::unblockHandler): Returned an unblock handler using the WebFilterEvaluator constructor.
2257         * testing/MockContentFilter.cpp: Added using statments for clarity.
2258         (WebCore::settings): Added a helper to get MockContentFilterSettings::singleton().
2259         (WebCore::MockContentFilter::canHandleResponse): Used the helper.
2260         (WebCore::MockContentFilter::MockContentFilter): Took advantage of the using statements.
2261         (WebCore::MockContentFilter::addData): Ditto.
2262         (WebCore::MockContentFilter::finishedAddingData): Ditto.
2263         (WebCore::MockContentFilter::unblockHandler): Returned a ContentFilterUnblockHandler that checks settings() for its decision.
2264         (WebCore::MockContentFilter::unblockRequestDeniedScript): Returned the script to execute in MockContentFilter's
2265         error page when an unblock request is denied.
2266         (WebCore::MockContentFilter::maybeDetermineStatus): Took advantage of settings() and using statements.
2267         * testing/MockContentFilterSettings.cpp:
2268         (WebCore::MockContentFilterSettings::unblockRequestURL): Constructed a static unblock URL and returned it.
2269         * testing/MockContentFilterSettings.h:
2270         (WebCore::MockContentFilterSettings::unblockURLHost): Returned the filter's unblock URL host.
2271         (WebCore::MockContentFilterSettings::unblockRequestDecision): Returns the decision to make for an unblock request.
2272         (WebCore::MockContentFilterSettings::setUnblockRequestDecision): Sets the decision to make for an unblock request.
2273         * testing/MockContentFilterSettings.idl: Added the unblockRequestDecision and unblockRequestURL attributes.
2274
2275 2015-03-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2276
2277         [GTK] Crash due to empty drag image during drag-and-drop
2278         https://bugs.webkit.org/show_bug.cgi?id=142671
2279
2280         Reviewed by Philippe Normand.
2281
2282         Return early from ImageBuffer constructor if an empty size is
2283         given. This is a speculative fix for a crash while starting a drag
2284         and drop operation, that I haven't been able to reproduce.
2285
2286         * platform/graphics/cairo/ImageBufferCairo.cpp:
2287         (WebCore::ImageBuffer::ImageBuffer):
2288
2289 2015-03-19  Chris Dumez  <cdumez@apple.com>
2290
2291         [WK2] We should allow stale content when restoring a killed / crashed WebProcess
2292         https://bugs.webkit.org/show_bug.cgi?id=142893
2293         <rdar://problem/19633737>
2294         <rdar://problem/19869257>
2295
2296         Reviewed by Antti Koivisto.
2297
2298         Always use ReturnCacheDataElseLoad cache policy for history navigations.
2299         Previously, we would use the default protocol cache policy for history
2300         navigations if m_stateMachine.committedFirstRealDocumentLoad() returned
2301         false so that we do not display stale content when restoring the session
2302         state of Safari statup (rdar://problem/8131355). This is now handled
2303         before reaching this method by no longer using "IndexedBackForward"
2304         FrameLoadType when restoring session tabs, and using "Standard" load
2305         type instead.
2306
2307         * loader/FrameLoader.cpp:
2308         (WebCore::FrameLoader::loadDifferentDocumentItem):
2309
2310 2015-03-19  Andy Estes  <aestes@apple.com>
2311
2312         [Content Filtering] Move ContentFilter to from platform/ to loader/
2313         https://bugs.webkit.org/show_bug.cgi?id=142897
2314
2315         Reviewed by Dan Bernstein.
2316
2317         ContentFilterCollection never contained any platform code, so it doesn't make sense for it to be in platform.
2318         Move it to loader/, since ContentFilters are owned by DocumentLoaders, and just call it ContentFilter. Extract
2319         the abstract part of ContentFilter into a new base class called PlatformContentFilter that each of the
2320         individual filters inherit from.
2321
2322         * WebCore.xcodeproj/project.pbxproj:
2323         * loader/ContentFilter.cpp: Renamed from Source/WebCore/platform/ContentFilter.cpp.
2324         (WebCore::ContentFilter::types): Moved from ContentFilterCollection.
2325         (WebCore::ContentFilter::createIfNeeded): Ditto.
2326         (WebCore::ContentFilter::ContentFilter): Ditto.
2327         (WebCore::ContentFilter::addData): Ditto.
2328         (WebCore::ContentFilter::finishedAddingData): Ditto.
2329         (WebCore::ContentFilter::needsMoreData): Ditto.
2330         (WebCore::ContentFilter::didBlockData): Ditto.
2331         (WebCore::ContentFilter::getReplacementData): Ditto.
2332         (WebCore::ContentFilter::unblockHandler): Ditto.
2333         * loader/ContentFilter.h: Copied from Source/WebCore/platform/ContentFilter.h.
2334         (WebCore::ContentFilter::type): Replaced a use of ContentFilterCollection.
2335         * platform/PlatformContentFilter.h: Renamed from Source/WebCore/platform/ContentFilter.h.
2336         * platform/cocoa/NetworkExtensionContentFilter.h: Inherited from PlatformContentFilter.
2337         * platform/cocoa/ParentalControlsContentFilter.h: Ditto.
2338         * testing/MockContentFilter.h: Ditto.
2339
2340 2015-03-19  Dean Jackson  <dino@apple.com>
2341
2342         CSS Animations with triggers should map scroll position to duration
2343         https://bugs.webkit.org/show_bug.cgi?id=142870
2344         <rdar://problem/20227244>
2345
2346         Reviewed by Simon Fraser.
2347
2348         Expose a prototype implementation of what will eventually be called
2349         animation-timebase, mapping the scroll location to the duration of an
2350         animation. This only applies if the animation has a start and end
2351         trigger.
2352
2353         Test: animations/trigger-container-scroll-boundaries.html
2354
2355         * css/CSSComputedStyleDeclaration.cpp:
2356         (WebCore::createAnimationTriggerValue): Change to downcast.
2357
2358         * css/CSSToStyleMap.cpp:
2359         (WebCore::CSSToStyleMap::mapAnimationTrigger): Fix a bug where I wasn't
2360         telling the ScrollAnimationTrigger object whether or not it had
2361         an end value. This wasn't visible before because we were not using
2362         the end value.
2363
2364         * page/animation/AnimationBase.cpp:
2365         (WebCore::AnimationBase::fireAnimationEventsIfNeeded): Add a comment and
2366         change to using a downcast.
2367         (WebCore::AnimationBase::timeToNextService): Change to downcast.
2368         (WebCore::AnimationBase::freezeAtTime): Whitespace cleanup.
2369         (WebCore::AnimationBase::getElapsedTime): Calculate the elapsedTime based
2370         on the scroll position relative to the start and end trigger spots.
2371
2372         * page/animation/AnimationController.cpp:
2373         (WebCore::AnimationControllerPrivate::updateAnimations): Since this
2374         can potentially call into beginAnimationUpdateTime, it should have
2375         an update blocker. This fixes the assert we were seeing in tests.
2376         (WebCore::AnimationControllerPrivate::scrollWasUpdated): Keep track of the scroll
2377         position so we don't need to ask for it all the time.
2378         * page/animation/AnimationControllerPrivate.h:
2379         (WebCore::AnimationControllerPrivate::scrollPosition): New accessor.
2380
2381         * platform/animation/AnimationTrigger.h: Add downcast macros.
2382         (WebCore::ScrollAnimationTrigger::create): Calculate hasEndValue from the passed
2383         parameters rather than a separate value.
2384         (WebCore::ScrollAnimationTrigger::hasEndValue):
2385         (WebCore::ScrollAnimationTrigger::ScrollAnimationTrigger):
2386         (WebCore::ScrollAnimationTrigger::setHasEndValue): Deleted.
2387
2388         * platform/graphics/ca/GraphicsLayerCA.cpp:
2389         (WebCore::GraphicsLayerCA::animationCanBeAccelerated): If we have an
2390         animation of this sort, we can't use a CAAnimation.
2391
2392 2015-03-19  Eric Carlson  <eric.carlson@apple.com>
2393
2394         [Mac] Move MediaPlaybackTargetPicker
2395         https://bugs.webkit.org/show_bug.cgi?id=142889
2396
2397         Move WebMediaPlaybackTargetPickerProxy from WK2 and rename as MediaPlaybackTargetPicker so it
2398         can be used by both WK2 and WK1.
2399
2400         Reviewed by Tim Horton.
2401
2402         * WebCore.xcodeproj/project.pbxproj:
2403         * platform/graphics/MediaPlaybackTargetPicker.cpp: Copied from Source/WebKit2/UIProcess/WebMediaPlaybackTargetPickerProxy.cpp.
2404         * platform/graphics/MediaPlaybackTargetPicker.h: Copied from Source/WebKit2/UIProcess/WebMediaPlaybackTargetPickerProxy.h.
2405         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h: Copied from Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h.
2406         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: Copied from Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm.
2407
2408 2015-03-19  Enrica Casucci  <enrica@apple.com>
2409
2410         REGRESSION (r109593): Clicking after last inline element could cause a crash.
2411         https://bugs.webkit.org/show_bug.cgi?id=142880
2412         rdar://problem/17222294
2413
2414         Reviewed by Ryosuke Niwa.
2415
2416         Test: editing/selection/click-after-last-inline-crash.html
2417
2418         * rendering/RootInlineBox.cpp:
2419         (WebCore::RootInlineBox::closestLeafChildForLogicalLeftPosition):
2420
2421 2015-03-19  Enrica Casucci  <enrica@apple.com>
2422
2423         One more build fix after r181760.
2424
2425         * page/EventHandler.cpp:
2426         (WebCore::EventHandler::handleDrag):
2427
2428 2015-03-19  Jessie Berlin  <jberlin@webkit.org>
2429
2430         Build fix after r181760.
2431
2432         * rendering/RenderAttachment.h:
2433
2434 2015-03-19  Jer Noble  <jer.noble@apple.com>
2435
2436         [WK2][Mac] Fullscreen animations with mismatched aspect ratios are "squished".
2437         https://bugs.webkit.org/show_bug.cgi?id=142132
2438
2439         Reviewed by Tim Horton.
2440
2441         Add a new utility method to calculate a rect with a specific aspect ratio wrapping a smaller one.
2442
2443         * platform/graphics/GeometryUtilities.cpp:
2444         (WebCore::smallestRectWithAspectRatioAroundRect):
2445         * platform/graphics/GeometryUtilities.h:
2446
2447 2015-03-19  Chris Dumez  <cdumez@apple.com>
2448
2449         Get rid of "CachePolicyCache" cache policy
2450         https://bugs.webkit.org/show_bug.cgi?id=142881
2451
2452         Reviewed by Antti Koivisto.
2453
2454         Get rid of "CachePolicyCache" cache policy as it is unused.
2455
2456         * loader/cache/CachePolicy.h:
2457         * loader/cache/CachedResource.cpp:
2458         (WebCore::CachedResource::mustRevalidateDueToCacheHeaders):
2459         * page/DiagnosticLoggingKeys.cpp:
2460         (WebCore::DiagnosticLoggingKeys::mustRevalidateIsExpiredKey): Deleted.
2461         * page/DiagnosticLoggingKeys.h:
2462
2463 2015-03-19  Alex Christensen  <achristensen@webkit.org>
2464
2465         [Content Extensions] Test regular expression parse failures.
2466         https://bugs.webkit.org/show_bug.cgi?id=142872
2467
2468         Reviewed by Benjamin Poulain.
2469
2470         * contentextensions/URLFilterParser.cpp:
2471         (WebCore::ContentExtensions::GraphBuilder::finalize):
2472         (WebCore::ContentExtensions::GraphBuilder::quantifyAtom):
2473         (WebCore::ContentExtensions::URLFilterParser::addPattern):
2474         (WebCore::ContentExtensions::URLFilterParser::statusString):
2475         * contentextensions/URLFilterParser.h:
2476         Changed failures that can never happen to assertions.
2477
2478 2015-03-19  Enrica Casucci  <enrica@apple.com>
2479
2480         Release build fix after https://trac.webkit.org/r181760.
2481
2482         Unreviewed.
2483
2484         * page/EventHandler.cpp:
2485         (WebCore::EventHandler::handleDrag):
2486
2487 2015-03-19  Enrica Casucci  <enrica@apple.com>
2488
2489         <attachment> should put URLs on the pasteboard so that Finder can accept drops.
2490         https://bugs.webkit.org/show_bug.cgi?id=142801
2491         rdar://problem/19982527
2492
2493         Reviewed by Tim Horton.
2494
2495         Test: editing/pasteboard/drag-and-drop-attachment-contenteditable.html
2496
2497         This patch adds all the necessary support to write attachment elements into
2498         the pasteboard, including the promised type.
2499
2500         * WebCore.xcodeproj/project.pbxproj:
2501         * page/DragActions.h:
2502         * page/DragClient.h:
2503         (WebCore::DragClient::declareAndWriteAttachment):
2504         * page/DragController.cpp:
2505         (WebCore::DragController::draggableElement):
2506         (WebCore::DragController::startDrag):
2507         * page/DragController.h:
2508         (WebCore::DragController::draggingAttachmentURL):
2509         * page/EventHandler.cpp:
2510         (WebCore::EventHandler::dragHysteresisExceeded):
2511         (WebCore::EventHandler::handleDrag):
2512         * page/mac/DragControllerMac.mm:
2513         (WebCore::DragController::declareAndWriteAttachment):
2514         * page/win/DragControllerWin.cpp:
2515         (WebCore::DragController::declareAndWriteAttachment):
2516         * platform/URL.cpp:
2517         (WebCore::URL::fileURLWithFileSystemPath):
2518         * platform/URL.h:
2519         * rendering/HitTestResult.cpp:
2520         (WebCore::HitTestResult::absoluteAttachmentURL):
2521         * rendering/HitTestResult.h:
2522
2523 2015-03-19  Chris Dumez  <cdumez@apple.com>
2524
2525         Unreviewed, fix linking error after r181753.
2526
2527         Drop WEBCORE_EXPORT for Settings::minimumDOMTimerInterval() as it is
2528         now inlined.
2529
2530         * page/Settings.h:
2531         (WebCore::Settings::minimumDOMTimerInterval):
2532
2533 2015-03-19  Brady Eidson  <beidson@apple.com>
2534
2535         Part of content extensions should apply css selectors
2536         https://bugs.webkit.org/show_bug.cgi?id=142604
2537
2538         Reviewed by Alex Christensen.
2539
2540         Add a new action for applying the cached global stylesheet.
2541
2542         * contentextensions/CompiledContentExtension.cpp:
2543         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
2544
2545         * contentextensions/ContentExtensionActions.h:
2546
2547         * contentextensions/ContentExtensionCompiler.cpp:
2548         (WebCore::ContentExtensions::serializeActions):
2549
2550         * contentextensions/ContentExtensionParser.cpp:
2551         (WebCore::ContentExtensions::loadAction):
2552
2553         * contentextensions/ContentExtensionRule.cpp:
2554         (WebCore::ContentExtensions::Action::deserialize):
2555         * contentextensions/ContentExtensionRule.h:
2556         (WebCore::ContentExtensions::Action::Action):
2557         (WebCore::ContentExtensions::Action::operator==):
2558         (WebCore::ContentExtensions::Action::stringArgument):
2559         (WebCore::ContentExtensions::Action::cssSelector): Deleted.
2560
2561         * contentextensions/ContentExtensionsBackend.cpp:
2562         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
2563
2564         * loader/cache/CachedResourceLoader.cpp:
2565         (WebCore::CachedResourceLoader::requestResource):
2566
2567 2015-03-19  Chris Dumez  <cdumez@apple.com>
2568
2569         Clean up DOMTimer related settings
2570         https://bugs.webkit.org/show_bug.cgi?id=142837
2571
2572         Reviewed by Darin Adler.
2573
2574         Clean up DOMTimer related settings:
2575         - Make default minimum timer interval 4ms instead of 10ms as all ports
2576           were setting it to 4ms and the specifications says 4ms.
2577         - Get rid of setters for default DOMTimer interval values as they are
2578           not set anymore.
2579         - Move default DOMTimer interval values from Settings to DOMTimer as
2580           those are global (not per-page) and not really settings.
2581         - Stop using abbreviations in the names (e.g. min -> minimum).
2582         - Move DOMTimer settings members from Page to Settings. There is no
2583           reason for those to be stored on the Page. The getters were private
2584           so call-sites had to go via Settings anyway. Also, call-sites already
2585           had to do a null check on the page to get the settings. It seems
2586           unfortunate for the settings to do another null-check on the page for
2587           retrieving the setting value from the page.
2588         - Inline the DOMTimer settings getters as these are trivial.
2589
2590         * dom/Document.cpp:
2591         (WebCore::Document::minimumTimerInterval):
2592         (WebCore::Document::timerAlignmentInterval):
2593         * dom/ScriptExecutionContext.cpp:
2594         (WebCore::ScriptExecutionContext::minimumTimerInterval):
2595         (WebCore::ScriptExecutionContext::timerAlignmentInterval):
2596         * page/DOMTimer.h:
2597         * page/Page.cpp:
2598         (WebCore::Page::Page):
2599         (WebCore::Page::setTimerThrottlingEnabled):
2600         (WebCore::Page::setMinimumTimerInterval): Deleted.
2601         (WebCore::Page::minimumTimerInterval): Deleted.
2602         * page/Page.h:
2603         (WebCore::Page::timerAlignmentInterval): Deleted.
2604         * page/Settings.cpp:
2605         (WebCore::Settings::Settings):
2606         (WebCore::Settings::setMinimumDOMTimerInterval):
2607         (WebCore::Settings::setDOMTimerAlignmentInterval):
2608         (WebCore::Settings::setHiddenPageDOMTimerAlignmentInterval): Deleted.
2609         (WebCore::Settings::hiddenPageDOMTimerAlignmentInterval): Deleted.
2610         (WebCore::Settings::setDefaultMinDOMTimerInterval): Deleted.
2611         (WebCore::Settings::defaultMinDOMTimerInterval): Deleted.
2612         (WebCore::Settings::setMinDOMTimerInterval): Deleted.
2613         (WebCore::Settings::minDOMTimerInterval): Deleted.
2614         (WebCore::Settings::setDefaultDOMTimerAlignmentInterval): Deleted.
2615         (WebCore::Settings::defaultDOMTimerAlignmentInterval): Deleted.
2616         (WebCore::Settings::domTimerAlignmentInterval): Deleted.
2617         * page/Settings.h:
2618         (WebCore::Settings::minimumDOMTimerInterval):
2619         (WebCore::Settings::domTimerAlignmentInterval):
2620         * testing/InternalSettings.cpp:
2621         (WebCore::InternalSettings::Backup::Backup):
2622         (WebCore::InternalSettings::Backup::restoreTo):
2623         (WebCore::InternalSettings::setMinimumTimerInterval):
2624
2625 2015-03-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2626
2627         [GTK] Scrollbars look bad with GTK+ 3.16
2628         https://bugs.webkit.org/show_bug.cgi?id=140800
2629
2630         Reviewed by Sergio Villar Senin.
2631
2632         Take margin into account when rendering scrollbars. This fixes the
2633         huge scrollbars rendered with GTK+ 3.16. We don't need to check
2634         the GTK+ version because in previous versions the marging were 0,
2635         so the same code just works.
2636
2637         * platform/gtk/ScrollbarThemeGtk.cpp:
2638         (WebCore::adjustRectAccordingToMargin):
2639         (WebCore::ScrollbarThemeGtk::paintTrackBackground):
2640         (WebCore::ScrollbarThemeGtk::paintThumb):
2641
2642 2015-03-19  Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
2643
2644         [Streams API] Update ReadableStream API according new version of the specification
2645         https://bugs.webkit.org/show_bug.cgi?id=142822
2646
2647         Reviewed by Benjamin Poulain.
2648
2649         This patch updates the IDL of ReadableStream according the new version of the spec, which splits functionality between ReadableStream and ReadableStreamReader.
2650         In particular, this patch removes read(), ready, closed and state from ReadableStream and it adds the getReader method.
2651
2652         Covered by updated readablestream-constructor.html test.
2653
2654         * Modules/streams/ReadableStream.cpp:
2655         (WebCore::ReadableStream::ReadableStream):
2656         (WebCore::ReadableStream::state): Deleted.
2657         (WebCore::ReadableStream::closed): Deleted.
2658         (WebCore::ReadableStream::ready): Deleted.
2659         * Modules/streams/ReadableStream.h:
2660         (WebCore::ReadableStream::internalState): Added to make mac build system happy, to be used by ReadableStreamReader.
2661         * Modules/streams/ReadableStream.idl:
2662         * bindings/js/JSReadableStreamCustom.cpp:
2663         (WebCore::JSReadableStream::cancel):
2664         (WebCore::JSReadableStream::getReader):
2665         (WebCore::JSReadableStream::read): Deleted.
2666         (WebCore::getOrCreatePromiseDeferredFromObject): Deleted.
2667         (WebCore::readyPromiseSlotName): Deleted.
2668         (WebCore::JSReadableStream::ready): Deleted.
2669         (WebCore::closedPromiseSlotName): Deleted.
2670         (WebCore::JSReadableStream::closed): Deleted.
2671
2672 2015-03-18  Manuel Rego Casasnovas  <rego@igalia.com>
2673
2674         Unreviewed. GTK build fix after r181720.
2675
2676         * rendering/RenderImage.cpp:
2677         (WebCore::RenderImage::styleDidChange):
2678
2679 2015-03-18  Antti Koivisto  <antti@apple.com>
2680
2681         Test disk cache behavior when using back navigation cache policy
2682         https://bugs.webkit.org/show_bug.cgi?id=142848
2683
2684         Reviewed by Chris Dumez.
2685
2686         Add a way to override the normal cache policy so we can test reload behavior of cache without actually reloading.
2687
2688         Test: http/tests/cache/disk-cache-validation-back-navigation-policy.html
2689
2690         * loader/FrameLoader.cpp:
2691         (WebCore::FrameLoader::addExtraFieldsToRequest):
2692         * loader/FrameLoader.h:
2693         (WebCore::FrameLoader::setOverrideCachePolicyForTesting):
2694         * testing/Internals.cpp:
2695         (WebCore::Internals::setOverrideCachePolicy):
2696         * testing/Internals.h:
2697         * testing/Internals.idl:
2698
2699 2015-03-18  Yusuke Suzuki  <utatane.tea@gmail.com>
2700
2701         TextFragment#start() is always >= 0 since its type is unsigned
2702         https://bugs.webkit.org/show_bug.cgi?id=142860
2703
2704         Reviewed by Andreas Kling.
2705
2706         Since TextFragment::m_start is unsigned, the result of
2707         TextFragment::start() is always >= 0 and assertion is not effective.
2708         This patch removes this assertion to suppress warnings.
2709
2710         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2711         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
2712
2713 2015-03-18  Alex Christensen  <achristensen@webkit.org>
2714
2715         [ContentExtensions] Prepare for compiling stylesheets of selectors to be used on every page.
2716         https://bugs.webkit.org/show_bug.cgi?id=142799
2717
2718         Reviewed by Brady Eidson.
2719
2720         * WebCore.xcodeproj/project.pbxproj:
2721         Make private headers to use with API tests.
2722         * contentextensions/CompiledContentExtension.cpp:
2723         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
2724         * contentextensions/CompiledContentExtension.h:
2725         Added method to get only the selectors from the root of the DFA, which apply to all URLs.
2726         * contentextensions/ContentExtensionCompiler.cpp:
2727         (WebCore::ContentExtensions::compileRuleList):
2728         Added checking if the trigger will match everything.
2729         These actions can be put directly on the root of the DFA without adding extra epsilon transitions to the NFA.
2730         * contentextensions/DFA.h:
2731         (WebCore::ContentExtensions::DFA::nodeAt):
2732         * contentextensions/DFABytecodeInterpreter.cpp:
2733         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
2734         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
2735         * contentextensions/DFABytecodeInterpreter.h:
2736         * contentextensions/NFA.h:
2737         * contentextensions/URLFilterParser.cpp:
2738         (WebCore::ContentExtensions::Term::quantifier):
2739         Sink terms to a vector then add nodes to NFA when finalizing after checking for regexes that match everything.
2740         (WebCore::ContentExtensions::GraphBuilder::GraphBuilder):
2741         (WebCore::ContentExtensions::GraphBuilder::finalize):
2742         (WebCore::ContentExtensions::GraphBuilder::parseStatus):
2743         (WebCore::ContentExtensions::GraphBuilder::atomPatternCharacter):
2744         (WebCore::ContentExtensions::GraphBuilder::atomBuiltInCharacterClass):
2745         (WebCore::ContentExtensions::GraphBuilder::quantifyAtom):
2746         (WebCore::ContentExtensions::GraphBuilder::atomBackReference):
2747         (WebCore::ContentExtensions::GraphBuilder::assertionBOL):
2748         (WebCore::ContentExtensions::GraphBuilder::assertionWordBoundary):
2749         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassAtom):
2750         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassRange):
2751         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassBuiltIn):
2752         (WebCore::ContentExtensions::GraphBuilder::atomParentheticalAssertionBegin):
2753         (WebCore::ContentExtensions::GraphBuilder::disjunction):
2754         (WebCore::ContentExtensions::GraphBuilder::hasError):
2755         (WebCore::ContentExtensions::GraphBuilder::fail):
2756         (WebCore::ContentExtensions::GraphBuilder::sinkFloatingTermIfNecessary):
2757         (WebCore::ContentExtensions::URLFilterParser::addPattern):
2758         (WebCore::ContentExtensions::URLFilterParser::statusString):
2759         (WebCore::ContentExtensions::GraphBuilder::errorMessage): Deleted.
2760         * contentextensions/URLFilterParser.h:
2761         Use an enum instead of strings for the status to avoid checking strings when we have a regex that matches everything.
2762
2763 2015-03-18  Yusuke Suzuki  <utatane.tea@gmail.com>
2764
2765         Fix build failure due to FALLTHROUGH in unreachable code
2766         https://bugs.webkit.org/show_bug.cgi?id=142703
2767
2768         Reviewed by Benjamin Poulain.
2769
2770         FALLTHROUGH should not exist in unreachable code marked by
2771         ASSERT_NOT_REACHABLE.
2772
2773         When !ENABLE(CSS_SELECTOR_JIT) and Debug mode is enabled,
2774         both ASSERT_NOT_REACHED and FALLTHROUGH are instantiated
2775         and it cause build failure.
2776
2777         Here, since CompiledSingle/CompiledSingleWithRootFilter are
2778         not set when !ENABLE(CSS_SELECTOR_JIT). So dropping FALLTHROUGH
2779         and leave ASSERT_NOT_REACHED.
2780         And since ASSERT_NOT_ReACHED is stripped when Release build,
2781         I've inserted FALLTHROUGH() if ASSERT_DISABLED.
2782         This fix is the same to r162906.
2783
2784         * dom/SelectorQuery.cpp:
2785         (WebCore::SelectorDataList::execute):
2786
2787 2015-03-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
2788
2789         Switching between two SVG images with no intrinsic sizes causes them to get the default SVG size instead of the container size.
2790         https://bugs.webkit.org/show_bug.cgi?id=142805.
2791
2792         Reviewed by Darin Adler.
2793         
2794         The bug happens due to wrong logic in RenderImage::imageDimensionsChanged().
2795         This function decides to setNeedsLayout() if the intrinsic size of the image
2796         changes. If the size does not change, it only repaints the image rectangle.
2797         When switching the src of the an image between two SVG images and both of
2798         them have no intrinsic size, we do not updateInnerContentRect() and this
2799         means an SVGImageForContainer is not going to be created for this image.
2800         When the image is drawn, it is drawn directly from the SVGImage. And this
2801         means the drawing has to be scaled by container_size / SVG_default_intrinsic_size
2802         
2803         After figuring out that I need to updateInnerContentRect() to fix this bug,
2804         I found out Blink has already changed this code to do the same thing. But 
2805         they also did more clean-up in this function. Here is the link
2806         https://codereview.chromium.org/114323004. I think their change seems correct
2807         although they did not say what exactly they were trying to fix.
2808         
2809         The plan for repaintOrMarkForLayout(), which is the new name of this function,
2810         is the following:
2811             -- setNeedLayout() if the intrinsic size changes and it affects the size
2812                of the image.
2813             -- updateInnerContentRect() if the intrinsic size did not change but the
2814                image has exiting layout.
2815             -- repaint the image rectangle if layout is not needed.
2816             
2817         This change also removes the call to computeLogicalWidthInRegion(), which is
2818         almost running a layout for the image. This call figures out whether the image
2819         needs to setNeedsLayout(). This call is unnecessary; the image needs to run a
2820         layout if the intrinsic size has changed and it affects the size of the image.
2821                     
2822         Test: svg/as-image/svg-no-intrinsic-size-switching.html
2823
2824         * rendering/RenderImage.cpp:
2825         (WebCore::RenderImage::styleDidChange): Change the function call.
2826         (WebCore::RenderImage::imageChanged): Rename local variable and change the
2827         function call.
2828         
2829         (WebCore::RenderImage::updateIntrinsicSizeIfNeeded): Simplify this function.
2830         Call setIntrinsicSize() with the new size unless the image is in error state.
2831         
2832         (WebCore::RenderImage::repaintOrMarkForLayout): This a better name for this
2833         function since it is called even if the intrinsic size was not changed.
2834         (WebCore::RenderImage::imageDimensionsChanged): Deleted.
2835         
2836         * rendering/RenderImage.h: Rename imageDimensionsChanged() and change the 
2837         updateIntrinsicSizeIfNeeded() to return void.
2838         
2839         * rendering/svg/RenderSVGForeignObject.cpp:
2840         (WebCore::RenderSVGForeignObject::paint): Code cleanup. This function can
2841         only handle the paint phases PaintPhaseForeground and PaintPhaseSelection.
2842         Use this information to simplify the logic and order of painting there.
2843
2844 2015-03-18  Jeremy Jones  <jeremyj@apple.com>
2845
2846         Fix typo in playerViewControllerWillCancelOptimizedFullscree.
2847         https://bugs.webkit.org/show_bug.cgi?id=142745
2848
2849         Reviewed by Darin Adler.
2850
2851         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2852         (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscreen:]):
2853         (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscree:]): Deleted.
2854
2855 2015-03-18  Simon Fraser  <simon.fraser@apple.com>
2856
2857         Avoid repaints when changing transform on an element with multiple background images
2858         https://bugs.webkit.org/show_bug.cgi?id=142841
2859
2860         Reviewed by Zalan Bujtas.
2861         
2862         Replace the cheap test for changed images in RenderElement::updateFillImages()
2863         with an exhaustive test that walks the entire list of background images,
2864         since any ensuing repaint is way more expensive than a slightly more expensive check here.
2865         
2866         Test: fast/repaint/multiple-backgrounds-style-change.html
2867
2868         * rendering/RenderElement.cpp:
2869         (WebCore::RenderElement::updateFillImages):
2870         * rendering/style/FillLayer.cpp:
2871         (WebCore::layerImagesIdentical): See if both images are the same (either none
2872         or both mask images, and same image pointer).
2873         (WebCore::FillLayer::imagesIdentical): Walk the two FillLayer lists, checking the images
2874         on each one. Returns false if we reach the end of one list before the other, or the images
2875         are different.
2876         * rendering/style/FillLayer.h: New static function; static because
2877         it compares two FillLayer lists, and I think that makes more sense than
2878         a member function.
2879
2880 2015-03-18  Anders Carlsson  <andersca@apple.com>
2881
2882         Pass cookies by reference in CookieHash functions
2883         https://bugs.webkit.org/show_bug.cgi?id=142839
2884
2885         Reviewed by Sam Weinig.
2886
2887         * platform/Cookie.h:
2888         (WebCore::CookieHash::hash):
2889         (WebCore::CookieHash::equal):
2890
2891 2015-03-18  Tim Horton  <timothy_horton@apple.com>
2892
2893         Temporarily fix the !ENABLE(CSS_SELECTOR_JIT) and assertions-enabled build
2894
2895         * dom/SelectorQuery.cpp:
2896         (WebCore::SelectorDataList::execute):
2897
2898 2015-03-18  Myles C. Maxfield  <mmaxfield@apple.com>
2899
2900         Call CTFontSetRenderingParameters before rendering text
2901         https://bugs.webkit.org/show_bug.cgi?id=142816
2902
2903         Reviewed by Darin Adler.
2904
2905         No new tests.
2906
2907         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2908         (WebCore::showGlyphsWithAdvances):
2909         * platform/spi/cocoa/CoreTextSPI.h:
2910
2911 2015-03-18  Chris Dumez  <cdumez@apple.com>
2912
2913         [WK2] Log the number of network cache requests that we have never seen before
2914         https://bugs.webkit.org/show_bug.cgi?id=142828
2915         <rdar://problem/19632130>
2916
2917         Reviewed by Antti Koivisto.
2918
2919         Add diagnostic logging key for network cache efficacy logging.
2920
2921         * page/DiagnosticLoggingKeys.cpp:
2922         (WebCore::DiagnosticLoggingKeys::neverSeenBeforeKey):
2923         (WebCore::DiagnosticLoggingKeys::requestKey):
2924         * page/DiagnosticLoggingKeys.h:
2925
2926 2015-03-18  Yusuke Suzuki  <utatane.tea@gmail.com>
2927
2928         Use filterRootId in SelectorQuery even if CSS JIT is not enabled
2929         https://bugs.webkit.org/show_bug.cgi?id=142703
2930
2931         Reviewed by Benjamin Poulain.
2932
2933         filterRootId pruning path is not inherently related to CSS JIT.
2934         This patch enables filterRootId even in the environment
2935         where CSS JIT is not enabled.
2936
2937         * dom/SelectorQuery.cpp:
2938         (WebCore::filterRootById):
2939         (WebCore::SelectorDataList::executeSingleSelectorData):
2940         (WebCore::SelectorDataList::execute):
2941         * dom/SelectorQuery.h:
2942
2943 2015-03-18  Zalan Bujtas  <zalan@apple.com>
2944
2945         Simple line layout: Use Vector<>::const_iterator instead of custom FlowContents::Iterator.
2946         https://bugs.webkit.org/show_bug.cgi?id=142809
2947
2948         Reviewed by Antti Koivisto.
2949
2950         FlowContents::Iterator simply iterates on a vector<>. No need to custom implement it.
2951
2952         No change in functionality.
2953
2954         * rendering/SimpleLineLayoutFlowContents.h:
2955         (WebCore::SimpleLineLayout::FlowContents::begin):
2956         (WebCore::SimpleLineLayout::FlowContents::end):
2957         (WebCore::SimpleLineLayout::FlowContents::Iterator::Iterator): Deleted.
2958         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator++): Deleted.
2959         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator--): Deleted.
2960         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator==): Deleted.
2961         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator!=): Deleted.
2962         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*): Deleted.
2963         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->): Deleted.
2964         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2965         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
2966
2967 2015-03-18  Zalan Bujtas  <zalan@apple.com>
2968
2969         Simple line layout: Change FlowContents::segmentForPosition() to segmentForRun().
2970         https://bugs.webkit.org/show_bug.cgi?id=142785
2971
2972         Reviewed by Antti Koivisto.
2973
2974         This is in transition to support <br>. A particular position could point to multiple
2975         segments when <br> is directly followed by text.
2976
2977         No change in functionality.
2978
2979         * rendering/SimpleLineLayoutFlowContents.cpp:
2980         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForRunSlow):
2981         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPositionSlow): Deleted.
2982         * rendering/SimpleLineLayoutFlowContents.h:
2983         (WebCore::SimpleLineLayout::FlowContents::segmentForRun):
2984         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPosition): Deleted.
2985         (WebCore::SimpleLineLayout::FlowContents::segmentForPosition): Deleted.
2986         * rendering/SimpleLineLayoutResolver.cpp:
2987         (WebCore::SimpleLineLayout::RunResolver::Run::text):
2988
2989 2015-03-17  Simon Fraser  <simon.fraser@apple.com>
2990
2991         Skip trying to paint overlay scrollbars when there are none or they are clipped out
2992         https://bugs.webkit.org/show_bug.cgi?id=142811
2993         rdar://problem/20200725
2994
2995         Reviewed by Darin Adler.
2996
2997         In some content with lots of layers and overflow:scroll, we could spend 20% of
2998         the time under paintOverflowControlsForFragments() setting up an (empty) clip,
2999         and then trying to draw scrollbars that we don't have.
3000         
3001         Avoid calling paintOverflowControlsForFragments() if there are no scrollbars,
3002         and don't both setting up an empty clip just to paint nothing.
3003
3004         * rendering/RenderLayer.cpp:
3005         (WebCore::RenderLayer::paintLayerContents):
3006         (WebCore::RenderLayer::paintOverflowControlsForFragments):
3007
3008 2015-03-18  Per Arne Vollan  <peavo@outlook.com>
3009
3010         [WinCairo] Unreviewed build fix after r181665.
3011
3012         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3013         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
3014
3015 2015-03-18  Joseph Pecoraro  <pecoraro@apple.com>
3016
3017         Remove unused "preprocessor" parameter to sub-CodeGenerators
3018         https://bugs.webkit.org/show_bug.cgi?id=142793
3019
3020         Reviewed by Darin Adler.
3021
3022         * bindings/scripts/CodeGenerator.pm:
3023         (ProcessDocument):
3024         (FileNamePrefix):
3025         * bindings/scripts/CodeGeneratorObjC.pm:
3026
3027 2015-03-18  Zalan Bujtas  <zalan@apple.com>
3028
3029         Simple line layout: Split fragments on renderer boundary on the fly.
3030         https://bugs.webkit.org/show_bug.cgi?id=142579
3031
3032         Reviewed by Antti Koivisto.
3033
3034         Fragment splitting at renderers' boundary at the end of the line is no longer needed.
3035         This patch ensures that TextFragmentIterator::nextTextFragment() does not concatenate
3036         fragments across renderer boundary.
3037
3038         Test: fast/text/simple-line-with-multiple-renderers.html
3039
3040         * rendering/SimpleLineLayout.cpp:
3041         (WebCore::SimpleLineLayout::revertRuns):
3042         (WebCore::SimpleLineLayout::LineState::isEmpty):
3043         (WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded): Check if fragments need a new run and
3044         whether neighboring fragments need collapsing.
3045         (WebCore::SimpleLineLayout::LineState::revertUncommitted): Revert fragments over multiple renderers if they form
3046         a fragment continuation.
3047         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
3048         (WebCore::SimpleLineLayout::forceFragmentToLine): Ensure that if a fragment has continuation across multiple renderers,
3049         they all get added to the current line.
3050         (WebCore::SimpleLineLayout::createLineRuns):
3051         (WebCore::SimpleLineLayout::LineState::appendFragment): Deleted.
3052         (WebCore::SimpleLineLayout::FragmentForwardIterator::FragmentForwardIterator): Deleted.
3053         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator++): Deleted.
3054         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator!=): Deleted.
3055         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator*): Deleted.
3056         (WebCore::SimpleLineLayout::begin): Deleted.
3057         (WebCore::SimpleLineLayout::end): Deleted.
3058         (WebCore::SimpleLineLayout::preWrap): Deleted.
3059         (WebCore::SimpleLineLayout::removeTrailingWhitespace): Deleted.
3060         (WebCore::SimpleLineLayout::updateLineConstrains): Deleted.
3061         (WebCore::SimpleLineLayout::splitRunsAtRendererBoundary): Deleted.
3062         (WebCore::SimpleLineLayout::createTextRuns): Deleted.
3063         (WebCore::SimpleLineLayout::create): Deleted.
3064         (WebCore::SimpleLineLayout::Layout::create): Deleted.
3065         * rendering/SimpleLineLayoutFlowContents.h:
3066         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator+):
3067         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*):
3068         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->):
3069         * rendering/SimpleLineLayoutFunctions.cpp:
3070         (WebCore::SimpleLineLayout::paintFlow): Unrelated fix on non-collapsed tab position.
3071         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3072         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragmentIterator):
3073         (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
3074         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
3075         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
3076         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
3077         * rendering/SimpleLineLayoutTextFragmentIterator.h:
3078         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
3079         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::overlapsToNextRenderer):
3080         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isCollapsible):
3081         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::operator==):
3082         (WebCore::SimpleLineLayout::TextFragmentIterator::isLineBreak):
3083         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split): Deleted.
3084
3085 2015-03-18  Manuel Rego Casasnovas  <rego@igalia.com>
3086
3087         Flex and grid items should be painted as inline-blocks
3088         https://bugs.webkit.org/show_bug.cgi?id=142266
3089
3090         Reviewed by Darin Adler.
3091
3092         Based on Blink r157004 by <cbiesinger@chromium.org>.
3093         https://src.chromium.org/viewvc/blink?revision=157004&view=revision
3094
3095         Both flexbox and grid specs define that the painting order of flex/grid
3096         items is the same as inline blocks. See
3097         http://dev.w3.org/csswg/css-flexbox/#painting and
3098         http://dev.w3.org/csswg/css-grid/#z-order.
3099
3100         Extracted inline blocks painting code from InlineElementBox and moved to
3101         a helper method that will be reused for flexboxes and grids.
3102
3103         Tests: css3/flexbox/flex-item-text-background-not-interleaved.html
3104                fast/css-grid-layout/grid-item-text-background-not-interleaved.html
3105
3106         * rendering/InlineElementBox.cpp:
3107         (WebCore::InlineElementBox::paint): Move code to
3108         RenderElement::paintAsInlineBlock().
3109         * rendering/RenderBlock.cpp:
3110         (WebCore::RenderBlock::paintChild): Add new argument to paint children
3111         as inline blocks.
3112         * rendering/RenderBlock.h: Define PaintType enmu and modify paintChild()
3113         signature to add the new argument.
3114         * rendering/RenderElement.cpp:
3115         (WebCore::paintPhase): Paint element in a phase.
3116         (WebCore::RenderElement::paintAsInlineBlock): Code extracted from
3117         InlineElementBox::paint().
3118         * rendering/RenderElement.h: Add new method signature.
3119         * rendering/RenderFlexibleBox.cpp:
3120         (WebCore::RenderFlexibleBox::paintChildren): Call
3121         RenderBlock::paintChild() with the new argument.
3122         * rendering/RenderGrid.cpp:
3123         (WebCore::RenderGrid::paintChildren): Ditto.
3124
3125 2015-03-18  Chris Dumez  <cdumez@apple.com>
3126
3127         [WK2] Log total number of network cache queries using diagnostic logging
3128         https://bugs.webkit.org/show_bug.cgi?id=142803
3129         <rdar://problem/19632130>
3130
3131         Reviewed by Antti Koivisto.
3132
3133         Add diagnostic logging key needed for network efficacy logging.
3134
3135         * page/DiagnosticLoggingKeys.cpp:
3136         (WebCore::DiagnosticLoggingKeys::retrievalRequestKey):
3137         * page/DiagnosticLoggingKeys.h:
3138
3139 2015-03-18  Tim Horton  <timothy_horton@apple.com>
3140
3141         Fix the build after r181660
3142
3143         * page/EventHandler.cpp:
3144         (WebCore::EventHandler::setImmediateActionStage):
3145         * page/EventHandler.h:
3146         (WebCore::EventHandler::setImmediateActionStage):
3147         Un-inline setImmediateActionStage, because it is exported to WebCore, and
3148         exporting inline thing causes random weak symbol errors on some platforms.
3149
3150 2015-03-17  Conrad Shultz  <conrad_shultz@apple.com>
3151
3152         Ignore some deprecation warnings
3153         https://bugs.webkit.org/show_bug.cgi?id=142813
3154
3155         Reviewed by Mark Rowe.
3156
3157         Fixing the deprecations is tracked by: <rdar://problem/20201450>
3158
3159         * editing/cocoa/HTMLConverter.mm:
3160         (HTMLConverter::_processElement):
3161
3162 2015-03-17  Commit Queue  <commit-queue@webkit.org>
3163
3164         Unreviewed, rolling out r181667, r181682, and r181683.
3165         https://bugs.webkit.org/show_bug.cgi?id=142812
3166
3167         Broke multiple tests with ASan, plus dependent commits
3168         (Requested by ap on #webkit).
3169
3170         Reverted changesets:
3171
3172         "Simple line layout: Split fragments on renderer boundary on
3173         the fly."
3174         https://bugs.webkit.org/show_bug.cgi?id=142579
3175         http://trac.webkit.org/changeset/181667
3176
3177         "Simple line layout: Change FlowContents::segmentForPosition()
3178         to segmentForRun()."
3179         https://bugs.webkit.org/show_bug.cgi?id=142785
3180         http://trac.webkit.org/changeset/181682
3181
3182         "Simple line layout: Use Vector<>::const_iterator instead of
3183         custom FlowContents::Iterator."
3184         https://bugs.webkit.org/show_bug.cgi?id=142809
3185         http://trac.webkit.org/changeset/181683
3186
3187 2015-03-17  Zalan Bujtas  <zalan@apple.com>
3188
3189         Simple line layout: Use Vector<>::const_iterator instead of custom FlowContents::Iterator.
3190         https://bugs.webkit.org/show_bug.cgi?id=142809
3191
3192         Reviewed by Antti Koivisto.
3193
3194         FlowContents::Iterator simply iterates on a vector<>. No need to custom implement it.
3195
3196         No change in functionality.
3197
3198         * rendering/SimpleLineLayoutFlowContents.h:
3199         (WebCore::SimpleLineLayout::FlowContents::begin):
3200         (WebCore::SimpleLineLayout::FlowContents::end):
3201         (WebCore::SimpleLineLayout::FlowContents::Iterator::Iterator): Deleted.
3202         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator++): Deleted.
3203         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator--): Deleted.
3204         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator==): Deleted.
3205         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator!=): Deleted.
3206         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*): Deleted.
3207         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->): Deleted.
3208         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3209         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
3210
3211 2015-03-17  Zalan Bujtas  <zalan@apple.com>
3212
3213         Simple line layout: Change FlowContents::segmentForPosition() to segmentForRun().
3214         https://bugs.webkit.org/show_bug.cgi?id=142785
3215
3216         Reviewed by Antti Koivisto.
3217
3218         This is in transition to support <br>. A particular position could point to multiple
3219         segments when <br> is directly followed by text.
3220
3221         No change in functionality.
3222
3223         * rendering/SimpleLineLayoutFlowContents.cpp:
3224         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForRunSlow):
3225         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPositionSlow): Deleted.
3226         * rendering/SimpleLineLayoutFlowContents.h:
3227         (WebCore::SimpleLineLayout::FlowContents::segmentForRun):
3228         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPosition): Deleted.
3229         (WebCore::SimpleLineLayout::FlowContents::segmentForPosition): Deleted.
3230         * rendering/SimpleLineLayoutResolver.cpp:
3231         (WebCore::SimpleLineLayout::RunResolver::Run::text):
3232
3233 2015-03-17  Chris Dumez  <cdumez@apple.com>
3234
3235         [Mac][iOS] setSharedTimerFireInterval() / stopSharedTimer() are expensive
3236         https://bugs.webkit.org/show_bug.cgi?id=142752
3237         <rdar://problem/20176731>
3238
3239         Reviewed by Antti Koivisto.
3240
3241         setSharedTimerFireInterval() / stopSharedTimer() are expensive on Mac
3242         and iOS on pages using a lot of timers.
3243
3244         For example, on bing.com / iOS, ~15.4% of the CPU time is spent in
3245         setSharedTimerFireInterval() and ~14.7% of the CPU time is spent in
3246         stopSharedTimer(). The expensive calls are CFRunLoopAddTimer (11.4%),
3247         CFRunLoopTimerInvalidate (14.1%), CFRunLoopTimerCreate (3.3%).
3248
3249         The issue is that we keep creating, adding to run loop modes, and then
3250         destroying the sharedTimer for each firing event. This is very
3251         expensive. In such case, the CFRunLoopTimerRef documentation advises to
3252         """
3253         ... create a repeating timer with an initial firing time in the distant
3254         future (or the initial firing time) and a very large repeat interval—on
3255         the order of decades or more—and add it to all the necessary run loop
3256         modes. Then, when you know when the timer should fire next, you reset
3257         the firing time with CFRunLoopTimerSetNextFireDate, perhaps from the
3258         timer’s own callback function. This technique effectively produces a
3259         reusable, asynchronous timer.
3260         """ [1].
3261
3262         Doing so greatly decreases CPU time spend in:
3263         - setSharedTimerFireInterval(): 15.4% -> 4.6%
3264         - stopSharedTimer(): 14.6% -> 8.6%
3265
3266         Overall CPU time spent on bing.com in timerFired() goes down from
3267         ~61.2% to ~49.5%.
3268
3269         This patch also refactors the SharedTimer code to share as much as
3270         possible between Mac and iOS.
3271
3272         This patch is based in part on the following patch:
3273         http://trac.webkit.org/changeset/143210
3274
3275         [1] https://developer.apple.com/library/prerelease/ios/documentation/CoreFoundation/Reference/CFRunLoopTimerRef/index.html#//apple_ref/c/func/CFRunLoopTimerSetNextFireDate
3276
3277         * WebCore.xcodeproj/project.pbxproj:
3278         * platform/SharedTimer.h:
3279         (WebCore::SharedTimer::invalidate):
3280         (WebCore::MainThreadSharedTimer::setFiredFunction): Deleted.
3281         (WebCore::MainThreadSharedTimer::setFireInterval): Deleted.
3282         (WebCore::MainThreadSharedTimer::stop): Deleted.
3283         * platform/ThreadTimers.cpp:
3284         (WebCore::ThreadTimers::fireTimersInNestedEventLoop):
3285         * platform/cf/SharedTimerCF.mm: Added.
3286         (WebCore::applicationDidBecomeActive):
3287         (WebCore::setupPowerObserver):
3288         (WebCore::setSharedTimerFiredFunction):
3289         (WebCore::timerFired):
3290         (WebCore::restartSharedTimer):
3291         (WebCore::invalidateSharedTimer):
3292         (WebCore::setSharedTimerFireInterval):
3293         (WebCore::stopSharedTimer):
3294         * platform/efl/SharedTimerEfl.cpp:
3295         (WebCore::invalidateSharedTimer):
3296         * platform/gtk/SharedTimerGtk.cpp:
3297         (WebCore::invalidateSharedTimer):
3298         * platform/ios/SharedTimerIOS.mm: Removed.
3299         * platform/mac/PowerObserverMac.h: Copied from Source/WebCore/platform/efl/SharedTimerEfl.cpp.
3300         * platform/mac/PowerObserverMac.mm: Renamed from Source/WebCore/platform/mac/SharedTimerMac.mm.
3301         (WebCore::PowerObserver::PowerObserver):
3302         (WebCore::PowerObserver::~PowerObserver):
3303         (WebCore::PowerObserver::didReceiveSystemPowerNotification):
3304         * platform/win/SharedTimerWin.cpp:
3305         (WebCore::removeSharedTimer):
3306
3307 2015-03-17  Tim Horton  <timothy_horton@apple.com>
3308
3309         Cannot invoke action menus anymore
3310         https://bugs.webkit.org/show_bug.cgi?id=142797
3311         <rdar://problem/20032670>
3312
3313         Reviewed by Beth Dakin.
3314
3315         * platform/spi/mac/NSMenuSPI.h:
3316         Add additional NSMenu SPI.
3317
3318 2015-03-17  Zalan Bujtas  <zalan@apple.com>
3319
3320         Simple line layout: Split fragments on renderer boundary on the fly.
3321         https://bugs.webkit.org/show_bug.cgi?id=142579
3322
3323         Reviewed by Antti Koivisto.
3324
3325         Fragment splitting at renderers' boundary at the end of the line is no longer needed.
3326         This patch ensures that TextFragmentIterator::nextTextFragment() does not concatenate
3327         fragments across renderer boundary.
3328
3329         Test: fast/text/simple-line-with-multiple-renderers.html
3330
3331         * rendering/SimpleLineLayout.cpp:
3332         (WebCore::SimpleLineLayout::revertRuns):
3333         (WebCore::SimpleLineLayout::LineState::isEmpty):
3334         (WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded): Check if fragments need a new run and
3335         whether neighboring fragments need collapsing.
3336         (WebCore::SimpleLineLayout::LineState::revertUncommitted): Revert fragments over multiple renderers if they form
3337         a fragment continuation.
3338         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
3339         (WebCore::SimpleLineLayout::forceFragmentToLine): Ensure that if a fragment has continuation across multiple renderers,
3340         they all get added to the current line.
3341         (WebCore::SimpleLineLayout::createLineRuns):
3342         (WebCore::SimpleLineLayout::LineState::appendFragment): Deleted.
3343         (WebCore::SimpleLineLayout::FragmentForwardIterator::FragmentForwardIterator): Deleted.
3344         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator++): Deleted.
3345         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator!=): Deleted.
3346         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator*): Deleted.
3347         (WebCore::SimpleLineLayout::begin): Deleted.
3348         (WebCore::SimpleLineLayout::end): Deleted.
3349         (WebCore::SimpleLineLayout::preWrap): Deleted.
3350         (WebCore::SimpleLineLayout::removeTrailingWhitespace): Deleted.
3351         (WebCore::SimpleLineLayout::updateLineConstrains): Deleted.
3352         (WebCore::SimpleLineLayout::splitRunsAtRendererBoundary): Deleted.
3353         (WebCore::SimpleLineLayout::createTextRuns): Deleted.
3354         (WebCore::SimpleLineLayout::create): Deleted.
3355         (WebCore::SimpleLineLayout::Layout::create): Deleted.
3356         * rendering/SimpleLineLayoutFlowContents.h:
3357         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator+):
3358         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*):
3359         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->):
3360         * rendering/SimpleLineLayoutFunctions.cpp:
3361         (WebCore::SimpleLineLayout::paintFlow): Unrelated fix on non-collapsed tab position.
3362         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3363         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragmentIterator):
3364         (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
3365         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
3366         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
3367         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
3368         * rendering/SimpleLineLayoutTextFragmentIterator.h:
3369         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
3370         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::overlapsToNextRenderer):
3371         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isCollapsible):
3372         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::operator==):
3373         (WebCore::SimpleLineLayout::TextFragmentIterator::isLineBreak):
3374         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split): Deleted.
3375
3376 2015-03-17  Jeremy Jones  <jeremyj@apple.com>
3377
3378         When tab hides, pause fullscreen and exit normally.
3379         https://bugs.webkit.org/show_bug.cgi?id=142685
3380
3381         Reviewed by Eric Carlson.
3382
3383         Pause fullscreen playback when switching tabs. Exit fullscreen is not necessary and even prevents
3384         the normal flow of teardown. This allows the normal exit fullscreen call to succeed and call its callback.
3385
3386         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3387         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
3388
3389 2015-03-17  Per Arne Vollan  <peavo@outlook.com>
3390
3391         [WinCairo] Video position is incorrect when located inside a frame.
3392         https://bugs.webkit.org/show_bug.cgi?id=142784
3393
3394         Reviewed by Brent Fulgham.
3395
3396         We need to take the enclosing frame's position into account, when finding the video position.
3397
3398         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3399         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
3400
3401 2015-03-17  Benjamin Poulain  <bpoulain@apple.com>
3402
3403         Compile character ranges targeting the same state as range check in the bytecode
3404         https://bugs.webkit.org/show_bug.cgi?id=142759
3405
3406         Reviewed by Alex Christensen.
3407
3408         Previously, character ranges would be compiled as many individual character checks.
3409         For example, a transition on "[a-z]" would do 26 character checks + jump, which leads
3410         to enormous matchines.
3411
3412         With this patch, we find the ranges at lowering time and generate a single instruction
3413         for them: "CheckValueRange". This helps making the machine denser when the input
3414         use character sets.
3415
3416         The second part of this patch goes further in the case where the transitions out of
3417         a state cover the entire alphabet. In that case, we create a fallback transition
3418         on the fly and remove all the ranges made useless.
3419         That case is common when ranges are used with inverse character set (e.g. [^a]+a).
3420
3421         * contentextensions/DFABytecode.h:
3422         (WebCore::ContentExtensions::instructionSizeWithArguments):
3423         * contentextensions/DFABytecodeCompiler.cpp:
3424         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValueRange):
3425         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
3426         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
3427         (WebCore::ContentExtensions::DFABytecodeCompiler::compileCheckForRange):
3428         * contentextensions/DFABytecodeCompiler.h:
3429         Extend the compiler to detect ranges and lower them as CheckValueRange.
3430
3431         * contentextensions/DFABytecodeInterpreter.cpp:
3432         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
3433         Range checks in the interpreter.
3434
3435         * contentextensions/NFA.cpp:
3436         (WebCore::ContentExtensions::NFA::setFinal):
3437         This assertion does not make sense with the current codebase. Actions are "compressed",
3438         it is&