border-image with 'fill' keyword does not fill the middle area unless the border...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-03-31  Said Abou-Hallawa  <sabouhallawa@apple.com>
2
3         border-image with 'fill' keyword does not fill the middle area unless the border width is greater than zero.
4         https://bugs.webkit.org/show_bug.cgi?id=142650.
5
6         Reviewed by Simon Fraser.
7
8         The decoration of a RenderBox, a RenderTable or an InlineFlowBox should be
9         drawn if its RenderStyle has a non-zero width border or the border-image
10         has the keyword fill.
11
12         Tests: fast/borders/border-image-fill-inline-no-border.html
13                fast/borders/border-image-fill-no-border.html
14
15         * rendering/InlineFlowBox.cpp:
16         (WebCore::InlineFlowBox::paintBoxDecorations):
17         * rendering/RenderBox.cpp:
18         (WebCore::RenderBox::paintBoxDecorations):
19         * rendering/RenderBoxModelObject.cpp:
20         (WebCore::RenderBoxModelObject::hasBoxDecorationStyle):
21         * rendering/RenderTable.cpp:
22         (WebCore::RenderTable::paintBoxDecorations):
23         * rendering/style/BorderData.h:
24         (WebCore::BorderData::hasFill):
25         * rendering/style/RenderStyle.h:
26
27 2015-03-31  Alex Christensen  <achristensen@webkit.org>
28
29         [Win] Unreviewed build fix.
30
31         * WebCore.vcxproj/WebCore.vcxproj:
32         Don't include inspector files twice in debug builds.
33         InspectorAllInOne.cpp is now used on debug builds.
34
35 2015-03-31  David Hyatt  <hyatt@apple.com>
36
37         [New Block-Inside-Inline Model] Anonymous inline-blocks should size as though they are block-level.
38         https://bugs.webkit.org/show_bug.cgi?id=143271
39
40         Reviewed by Dean Jackson.
41
42         Added fast/block/inside-inlines/block-width-check.html.
43
44         * rendering/RenderBox.cpp:
45         (WebCore::RenderBox::sizesLogicalWidthToFitContent):
46         Return false when an anonymous inline-block is encountered, since we want to treat it like a regular
47         block instead.
48
49 2015-03-31  Commit Queue  <commit-queue@webkit.org>
50
51         Unreviewed, rolling out r182186.
52         https://bugs.webkit.org/show_bug.cgi?id=143270
53
54         it crashes all the WebGL tests on the Debug bots (Requested by
55         dino on #webkit).
56
57         Reverted changeset:
58
59         "Web Inspector: add 2D/WebGL canvas instrumentation
60         infrastructure"
61         https://bugs.webkit.org/show_bug.cgi?id=137278
62         http://trac.webkit.org/changeset/182186
63
64 2015-03-31  Myles C. Maxfield  <mmaxfield@apple.com>
65
66         Crash in CGContextShowGlyphsWithAdvances when passing kCGFontIndexInvalid
67         https://bugs.webkit.org/show_bug.cgi?id=143114
68
69         This is a workaround for <rdar://problem/20230073>. Please remove when it is no longer necessary.
70
71         Reviewed by Alexey Proskuryakov.
72
73         Covered by:
74         compositing/regions/floated-region-with-transformed-child.html
75         compositing/regions/floated-region-with-transformed-child-expected.html
76         fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-005.html
77         fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-005-expected.html
78         fast/regions/overflow/overflow-content-transform-rotate.html
79         fast/regions/overflow/overflow-content-transform-rotate-expected.html
80
81         * platform/graphics/GlyphBuffer.h:
82         (WebCore::GlyphBuffer::shrink): Performing shaping may remove glyphs, so we need to shrink the GlyphBuffer.
83         * platform/graphics/WidthIterator.cpp:
84         (WebCore::applyFontTransforms): Filter out kCGFontIndexInvalid.
85         (WebCore::WidthIterator::advanceInternal): Moved code into applyFontTransforms, and trigger the
86         shrink of the GlyphBuffer.
87
88 2015-03-31  Beth Dakin  <bdakin@apple.com>
89
90         REGRESSION (r173484): Reducing content of scrollable region does not reset scroll 
91         position
92         https://bugs.webkit.org/show_bug.cgi?id=138525
93         -and corresponding-
94         rdar://problem/18166043
95
96         Reviewed by Simon Fraser.
97
98         The change that caused this regression was correct. That change does not allow 
99         RenderLayer to update scroll position after a layout if a rubber-band is currently 
100         happening. The change caused this regression because all of the member variables 
101         in ScrollController that attempt to keep track of the current state of the scroll 
102         gesture (m_inScrollGesture, m_momentumScrollInProgress, and 
103         m_snapRubberbandTimerIsActive) all indicated that a momentum scroll gesture was 
104         still in action for this div even though it very much is not when the bug happens. 
105         Those variables were never properly re-set because the 
106         PlatformWheelEventPhaseEnded events never got dispatched to the ScrollController, 
107         which brought the investigation back to Element.
108
109         We must still dispatch events that have zero delta so that the default event 
110         handlers can handle them, but we should stopPropagation() so that these events are 
111         not sent to the DOM. Websites will break if they get wheel events with no delta.
112         * dom/Element.cpp:
113         (WebCore::Element::dispatchWheelEvent):
114
115 2015-03-31  Alex Christensen  <achristensen@webkit.org>
116
117         [Win] Unreviewed debug build fix after r182186.
118
119         * WebCore.vcxproj/WebCore.vcxproj:
120         Include InspectorAllInOne.cpp in debug builds.
121
122 2015-03-30  David Hyatt  <hyatt@apple.com>
123
124         [New Block-Inside-Inline Model] Make sure line breaks occur before and after the anonymous inline-block.
125         https://bugs.webkit.org/show_bug.cgi?id=143238.
126
127         Reviewed by Dean Jackson.
128
129         Added fast/blocks/inside-inlines/breaking-behavior.html (and new-model equivalent).
130
131         * rendering/InlineFlowBox.h:
132         (WebCore::InlineFlowBox::InlineFlowBox):
133         (WebCore::InlineFlowBox::hasAnonymousInlineBlock):
134         (WebCore::InlineFlowBox::setHasAnonymousInlineBlock):
135         Add a bit to root line boxes (stored in the InlineFlowBox since it has free bits) that indicates whether
136         or not a line is an anonymous inline-block line.
137
138         * rendering/RenderBlockFlow.cpp:
139         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
140         Patch the preferred logical width computation to break both before and after an anonymous inline-block.
141         Also make sure to strip trailing spaces from the line before the anonymous inline-block.
142
143         * rendering/RenderBlockLineLayout.cpp:
144         (WebCore::RenderBlockFlow::constructLine):
145         Patch line construction so that no intermediate boxes are constructed between the InlineBox for the anonymous
146         inline-block and the root line box.
147
148         * rendering/RootInlineBox.cpp:
149         (WebCore::RootInlineBox::ascentAndDescentForBox):
150         The height of a "line" that holds an anonymous inline-block should ignore line-box-contain and also make sure
151         that the margins of the replaced element are "outside" the line, since those margins will collapse.
152
153         * rendering/line/BreakingContext.h:
154         (WebCore::BreakingContext::handleReplaced):
155         Patch handleReplaced to make sure breaks occur both before and after an anonymous inline-block. In the case of
156         a break after the block, we setPreviousLineBrokeCleanly to true so that <br>s that follow the anonymous inline-block
157         are respected.
158
159 2015-03-31  Csaba Osztrogonác  <ossy@webkit.org>
160
161         [EFL] Add nullptr check to GraphicsContext3D::makeContextCurrent()
162         https://bugs.webkit.org/show_bug.cgi?id=143214
163
164         Reviewed by Žan Doberšek.
165
166         * platform/graphics/efl/GraphicsContext3DEfl.cpp:
167         (WebCore::GraphicsContext3D::makeContextCurrent):
168
169 2015-03-31  Matt Baker  <mattbaker@apple.com>
170
171         Web Inspector: add 2D/WebGL canvas instrumentation infrastructure
172         https://bugs.webkit.org/show_bug.cgi?id=137278
173
174         Reviewed by Timothy Hatcher.
175
176         Added backend agent for canvas inspection. A canvas is instrumented once its CanvasRenderingContext has been
177         created. WebGLRenderingContext is instrumented to track the lifetime of shader program objects.
178
179         To instrument off-screen rendering contexts (CSS canvases and detached canvas elements), the canvas agent must
180         track all CanvasRenderingContexts as they are created, even in the absense of the frontend. As far as I know,
181         there is no practical way to identify rendering contexts belonging to a frame that are not in the DOM. In the
182         absence of the inspector frontend the agent does only the minimum required to track the lifetime of rendering
183         contexts and their resources, to avoid creating a negative performance impact.
184
185         Tests: inspector/canvas/canvas-add-remove-events.html
186                inspector/canvas/canvas-context-attributes.html
187                inspector/canvas/canvas-css-name.html
188
189         * CMakeLists.txt:
190         * WebCore.xcodeproj/project.pbxproj:
191
192         * dom/Document.cpp:
193         (WebCore::Document::getCSSCanvasElement):
194         Instrumentation for CSS canvases.
195
196         * html/HTMLCanvasElement.cpp:
197         (WebCore::HTMLCanvasElement::getContext):
198         Instrumentation for context creation.
199
200         * html/canvas/WebGLRenderingContextBase.cpp:
201         (WebCore::WebGLRenderingContextBase::attachShader):
202         (WebCore::WebGLRenderingContextBase::createProgram):
203         (WebCore::WebGLRenderingContextBase::deleteProgram):
204         (WebCore::WebGLRenderingContextBase::detachShader):
205         Instrumentation for programs and shaders.
206
207         * inspector/InspectorAllInOne.cpp:
208
209         * inspector/InspectorCanvasAgent.cpp: Added.
210         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
211         (WebCore::InspectorCanvasAgent::didCreateFrontendAndBackend):
212         (WebCore::InspectorCanvasAgent::willDestroyFrontendAndBackend):
213         (WebCore::InspectorCanvasAgent::frameNavigated):
214         (WebCore::InspectorCanvasAgent::didCreateCSSCanvas):
215         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
216         (WebCore::InspectorCanvasAgent::didAttachShader):
217         (WebCore::InspectorCanvasAgent::didDetachShader):
218         (WebCore::InspectorCanvasAgent::didCreateProgram):
219         (WebCore::InspectorCanvasAgent::didDeleteProgram):
220         (WebCore::InspectorCanvasAgent::getCanvases):
221         (WebCore::InspectorCanvasAgent::canvasDestroyed):
222         (WebCore::InspectorCanvasAgent::canvasDestroyedTimerFired):
223         (WebCore::InspectorCanvasAgent::reset):
224         (WebCore::InspectorCanvasAgent::getCanvasEntry):
225         (WebCore::InspectorCanvasAgent::getProgramEntry):
226         (WebCore::InspectorCanvasAgent::removeShaderFromShaderMap):
227         (WebCore::InspectorCanvasAgent::contextTypeJson):
228         (WebCore::InspectorCanvasAgent::buildObjectForCanvas):
229         * inspector/InspectorCanvasAgent.h: Added.
230         New backend agent.
231
232         * inspector/InspectorController.cpp:
233         (WebCore::InspectorController::InspectorController):
234         Support for new backend agent.
235
236         * inspector/InspectorInstrumentation.cpp:
237         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
238         (WebCore::InspectorInstrumentation::didCreateCSSCanvasImpl):
239         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContextImpl):
240         (WebCore::InspectorInstrumentation::didAttachShaderImpl):
241         (WebCore::InspectorInstrumentation::didDetachShaderImpl):
242         (WebCore::InspectorInstrumentation::didCreateProgramImpl):
243         (WebCore::InspectorInstrumentation::didDeleteProgramImpl):
244         (WebCore::InspectorInstrumentation::instrumentingAgentsForRenderingContext):
245         Plumbing for canvas instrumentation.
246
247         * inspector/InspectorInstrumentation.h:
248         (WebCore::InspectorInstrumentation::didCreateCSSCanvas):
249         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
250         (WebCore::InspectorInstrumentation::didAttachShader):
251         (WebCore::InspectorInstrumentation::didDetachShader):
252         (WebCore::InspectorInstrumentation::didCreateProgram):
253         (WebCore::InspectorInstrumentation::didDeleteProgram):
254
255         * inspector/InstrumentingAgents.cpp:
256         (WebCore::InstrumentingAgents::InstrumentingAgents):
257         (WebCore::InstrumentingAgents::reset):
258         * inspector/InstrumentingAgents.h:
259         (WebCore::InstrumentingAgents::inspectorCanvasAgent):
260         (WebCore::InstrumentingAgents::setInspectorCanvasAgent):
261         Support for new backend agent.
262
263 2015-03-31  Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
264
265         [Streams API] Implement a barebone ReadableStreamReader interface
266         https://bugs.webkit.org/show_bug.cgi?id=142866
267
268         Reviewed by Benjamin Poulain.
269
270         This patch implements a barebone ReadableStreamReader as described in https://streams.spec.whatwg.org/#reader-class.
271         It implements the IDL without implementing most of the functionality behind.
272         It implements ReadableStreamReader JS constructor and the link with ReadableStream.getReader:
273         - Raise an error if stream is already locked
274         - Set the stream reader to the newly created ReadableStreamReader instance.
275
276         Test: streams/readablestreamreader-constructor.html
277
278         * CMakeLists.txt: Adding ReadableStreamReader files.
279         * DerivedSources.cpp: Ditto.
280         * DerivedSources.make: Ditto.
281         * Modules/streams/ReadableStream.cpp:
282         (WebCore::ReadableStream::createReader): Used by JS binding to get access to the reader.
283         * Modules/streams/ReadableStream.h: Declaration of createReader, reader and lock.
284         (WebCore::ReadableStream::reader):
285         (WebCore::ReadableStream::lock):
286         * Modules/streams/ReadableStream.idl: Cleaning-up the IDL.
287         * Modules/streams/ReadableStreamReader.cpp: Added.
288         (WebCore::ReadableStreamReader::create):
289         (WebCore::ReadableStreamReader::ReadableStreamReader):
290         (WebCore::ReadableStreamReader::~ReadableStreamReader):
291         (WebCore::ReadableStreamReader::closed):
292         (WebCore::ReadableStreamReader::activeDOMObjectName):
293         (WebCore::ReadableStreamReader::canSuspend):
294         * Modules/streams/ReadableStreamReader.h: Added.
295         (WebCore::ReadableStreamReader::stream):
296         * Modules/streams/ReadableStreamReader.idl: Added.
297         * WebCore.vcxproj/WebCore.vcxproj:
298         * WebCore.vcxproj/WebCore.vcxproj.filters:
299         * WebCore.xcodeproj/project.pbxproj:
300         * bindings/js/JSBindingsAllInOne.cpp:
301         * bindings/js/JSReadableStreamCustom.cpp:
302         (WebCore::JSReadableStream::getReader):
303         * bindings/js/JSReadableStreamReaderCustom.cpp: Added.
304         (WebCore::JSReadableStreamReader::read):
305         (WebCore::getOrCreatePromiseDeferredFromObject):
306         (WebCore::closedPromiseSlotName):
307         (WebCore::JSReadableStreamReader::closed):
308         (WebCore::JSReadableStreamReader::cancel):
309         (WebCore::JSReadableStreamReader::releaseLock):
310         (WebCore::constructJSReadableStreamReader):
311
312 2015-03-31  Carlos Garcia Campos  <cgarcia@igalia.com>
313
314         [GTK] DnD icon/widget has odd background
315         https://bugs.webkit.org/show_bug.cgi?id=143217
316
317         Reviewed by Martin Robinson.
318
319         Remove DragIcon class since it's no longer needed with GTK+3 and
320         the GTK+2 code there is unused. GTK+ knows what to do with a cairo
321         surface, I guess we migrated the GTK+2 code to GTK+3 without
322         realizing that using the surface was enough.
323
324         * PlatformGTK.cmake:
325         * platform/gtk/DragIcon.cpp: Removed.
326         * platform/gtk/DragIcon.h: Removed.
327
328 2015-03-30  Alex Christensen  <achristensen@webkit.org>
329
330         Unreviewed build fix after r182168.
331
332         * contentextensions/ContentExtensionsBackend.cpp:
333         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
334         Explicitly cast to unsigned.
335
336 2015-03-30  Alex Christensen  <achristensen@webkit.org>
337
338         [Content Extensions] Correctly handle regular expressions matching everything
339         https://bugs.webkit.org/show_bug.cgi?id=143235
340
341         Reviewed by Benjamin Poulain.
342
343         Test: http/tests/contentextensions/whitelist.html
344
345         * contentextensions/CompiledContentExtension.cpp:
346         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
347         Global actions can have non-css actions.  Only put the selectors into the list of selectors.
348         * contentextensions/ContentExtensionCompiler.cpp:
349         (WebCore::ContentExtensions::serializeSelector):
350         (WebCore::ContentExtensions::serializeActions):
351         Merge sequential css selectors with identical triggers (usually .*) into one action to reduce the number of actions.
352         (WebCore::ContentExtensions::compileRuleList):
353         Fail if a regular expression matches everything after ignore-previous-rules.
354         * contentextensions/ContentExtensionError.cpp:
355         (WebCore::ContentExtensions::contentExtensionErrorCategory):
356         * contentextensions/ContentExtensionError.h:
357         Add more failure cases.
358         * contentextensions/ContentExtensionRule.h:
359         (WebCore::ContentExtensions::Trigger::operator==):
360         Allow comparing of Triggers to determine if sequential triggers are equal.
361         * contentextensions/ContentExtensionsBackend.cpp:
362         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
363         Put non-css actions that match everything into the list of actions if ignore-previous-rules was not hit.
364         These actions will be out of order, but order only matters when determining if ignore-previous-rules, and this case is handled correctly.
365         * contentextensions/DFABytecodeInterpreter.cpp:
366         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
367         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
368         Added an assertion that all actions that match everything should be in the first DFA root.
369         We should catch them all with URLFilterParser::MatchesEverything.
370
371 2015-03-30  Myles C. Maxfield  <mmaxfield@apple.com>
372
373         Allow building on Windows without Cygwin
374         https://bugs.webkit.org/show_bug.cgi?id=143219
375
376         Reviewed by Brent Fulgham.
377
378         * AVFoundationSupport.py: Renamed from Source/WebCore/WebCore.vcxproj/MigrateScripts.
379         Move logic from DerivedSources.make to its own script
380         (lookFor):
381         * DerivedSources.make: Paths like /usr/bin don't exist on Windows.
382         Windows uses del instead of rm -f
383         Windows doesn't have printf
384         * WebCore.vcxproj/WebCoreGenerated.make: Pass the CC executable to
385         build-generated-files.pl
386         * WebCore.vcxproj/build-generated-files.pl: Export the CC executable as an environment
387         variable. Don't use /usr/bin.
388         * WebCore.vcxproj/migrate-scripts.pl: Deleted the MigrateScripts makefile. We don't
389         need a whole Makefile just to copy 5 files. Moved this logic into migrate-scripts.pl.
390         (copyFile):
391         * bindings/scripts/preprocessor.pm:
392         (applyPreprocessor): Support passing preprocessing flags to the Visual Studio
393         compiler.
394         * dom/make_names.pl: Ditto.
395
396 2015-03-30  Alexey Proskuryakov  <ap@apple.com>
397
398         Build fix.
399
400         * platform/spi/mac/AVFoundationSPI.h:
401
402 2015-03-30  Sam Weinig  <sam@webkit.org>
403
404         [Content Extensions] Flesh out the UserContentExtensionStore
405         https://bugs.webkit.org/show_bug.cgi?id=143123
406
407         Reviewed by Benjamin Poulain.
408
409         - Adds a variant of getFileSize() that takes a PlatformFileHandle.
410         - Adds a new file system function, rename() which operates as the POSIX
411           rename function does.
412
413         * platform/FileSystem.h:
414         Add new functions.
415
416         * platform/posix/FileSystemPOSIX.cpp:
417         (WebCore::renameFile):
418         (WebCore::getFileSize):
419         Add implementations.
420
421         * platform/gtk/FileSystemGtk.cpp:
422         (WebCore::renameFile):
423         (WebCore::getFileSize):
424         * platform/win/FileSystemWin.cpp:
425         (WebCore::getFileSize):
426         (WebCore::renameFile):
427         Add stubs.
428
429 2015-03-30  Per Arne Vollan  <peavo@outlook.com>
430
431         [WinCairo] Crash when closing window while video is loading
432         https://bugs.webkit.org/show_bug.cgi?id=143088
433
434         Reviewed by Mark Lam.
435
436         When the media player is destroyed, we have to cancel possible calls on the
437         main thread made by a worker thread. Otherwise the destroyed media player
438         will be accessed when performing the call.
439
440         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
441         (WebCore::MediaPlayerPrivateMediaFoundation::~MediaPlayerPrivateMediaFoundation):
442         (WebCore::MediaPlayerPrivateMediaFoundation::endCreatedMediaSource):
443         (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
444         (WebCore::MediaPlayerPrivateMediaFoundation::onTopologySet):
445         (WebCore::MediaPlayerPrivateMediaFoundation::onCreatedMediaSourceCallback):
446         (WebCore::MediaPlayerPrivateMediaFoundation::onTopologySetCallback):
447         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
448
449 2015-03-30  Gwang Yoon Hwang  <yoon@igalia.com>
450
451         [Threaded Compositor] Crash when animation changes frequently.
452         https://bugs.webkit.org/show_bug.cgi?id=143213
453
454         Reviewed by Simon Fraser.
455
456         CompositingCoordinator copies CoordinatedGraphicsLayerState when
457         flushing GraphicsLayer changes, and ThreadedCoordinatedCompositor passes
458         it to compositing thread.
459
460         To ensure thread-safety, we need to provide copy constructor to copy
461         Animation object in TextureMapperAnimation instead of referencing it.
462
463         Since TimingFunction and TransformOperation used by KeyframeValueList are
464         not ThreadSafeRefCounted, these should be cloned also.
465
466         No new tests needed.
467
468         * platform/graphics/GraphicsLayer.h:
469         (WebCore::AnimationValue::AnimationValue):
470         (WebCore::FloatAnimationValue::FloatAnimationValue):
471         (WebCore::TransformAnimationValue::TransformAnimationValue):
472         (WebCore::FilterAnimationValue::FilterAnimationValue):
473         Adds deep copy constructor.
474
475         * platform/graphics/texmap/TextureMapperAnimation.cpp:
476         (WebCore::TextureMapperAnimation::TextureMapperAnimation):
477         Because the name of the animation can be AtomicString, we need to create
478         isolated version of string to ensure thread safty.
479
480         * platform/graphics/texmap/TextureMapperAnimation.h:
481         * platform/graphics/transforms/IdentityTransformOperation.h:
482         * platform/graphics/transforms/Matrix3DTransformOperation.h:
483         * platform/graphics/transforms/MatrixTransformOperation.h:
484         * platform/graphics/transforms/PerspectiveTransformOperation.h:
485         * platform/graphics/transforms/RotateTransformOperation.h:
486         * platform/graphics/transforms/ScaleTransformOperation.h:
487         * platform/graphics/transforms/SkewTransformOperation.h:
488         * platform/graphics/transforms/TransformOperation.h:
489         * platform/graphics/transforms/TranslateTransformOperation.h:
490         Adds TransformOperation::clone() for threadsafety.
491
492 2015-03-30  Chris Dumez  <cdumez@apple.com>
493
494         Cached "Expires" header is not updated upon successful resource revalidation
495         https://bugs.webkit.org/show_bug.cgi?id=143228
496         <rdar://problem/20348059>
497
498         Reviewed by Antti Koivisto.
499
500         Cached "Expires" header was not updated upon successful resource
501         revalidation. This affected both our disk cache and our memory cache.
502         This was caused by shouldUpdateHeaderAfterRevalidation() in
503         CacheValidation.cpp returning false for the "Expires" header.
504
505         There is a comment there stating that the list of ignored headers
506         matches Chromium's net library but that's not the case, at least not
507         anymore:
508         http://osxr.org/android/source/external/chromium/net/http/http_response_headers.cc
509
510         HTTP servers such as Apache return an "Expires" header in their 304
511         responses and the "Expires" header is potentially a new one. However,
512         our caches were ignoring the updated expiration date and kept using the
513         old one, which meant that the cached resource expired sooner than it
514         should have.
515
516         See the following Apache bugs that explain the issue:
517         https://bz.apache.org/bugzilla/show_bug.cgi?id=24884
518         https://bz.apache.org/bugzilla/show_bug.cgi?id=25123
519
520         Test: http/tests/cache/disk-cache/disk-cache-revalidation-new-expire-header.html
521
522         * platform/network/CacheValidation.cpp:
523
524 2015-03-30  Antti Koivisto  <antti@apple.com>
525
526         Don't cache resources that are very unlikely to be reused
527         https://bugs.webkit.org/show_bug.cgi?id=143226
528         <rdar://problem/20347160>
529
530         Reviewed by Geoff Garen.
531
532         Allow overriding resource load priorities via Internals for testing.
533
534         * loader/FrameLoader.cpp:
535         (WebCore::FrameLoader::addExtraFieldsToRequest):
536         (WebCore::FrameLoader::clearTestingOverrides):
537         * loader/FrameLoader.h:
538         (WebCore::FrameLoader::setOverrideResourceLoadPriorityForTesting):
539         (WebCore::FrameLoader::clearOverrideCachePolicyForTesting): Deleted.
540         * page/DiagnosticLoggingKeys.cpp:
541         (WebCore::DiagnosticLoggingKeys::unlikelyToReuseKey):
542         * page/DiagnosticLoggingKeys.h:
543
544             Add a key.
545
546         * testing/Internals.cpp:
547         (WebCore::Internals::resetToConsistentState):
548         (WebCore::stringToResourceLoadPriority):
549         (WebCore::Internals::setOverrideResourceLoadPriority):
550         * testing/Internals.h:
551         * testing/Internals.idl:
552
553 2015-03-30  Javier Fernandez  <jfernandez@igalia.com>
554
555         [CSS Grid Layout] Upgrade align-self and align-items parsing to CSS 3
556         https://bugs.webkit.org/show_bug.cgi?id=133359
557
558         Reviewed by David Hyatt.
559
560         From Blink r164817 and r165264 by <jchaffraix@chromium.org>
561
562         Broaden justify-self's parsing name
563
564         This is in preparation of migrating align-self, align-items
565         and justify-items to the CSS 3 Alignment syntax.
566
567         The current naming was too tied to justify-self and needs to
568         be broadened. This will reduce the follow-up implementations'
569         patches.
570
571         Upgrade align-self and align-items parsing to CSS 3
572
573         This change migrates the 2 properties to the CSS 3 Alignment
574         parsing. The new parsing is identical to how we parse
575         'justify-self'. The 2 properties need to be migrated together
576         as they are used in tandem in CSSComputedStyleDeclaration.
577
578         This change also removes EAlignItems as it is now unused.
579
580         Tests: css3/parse-align-items.html
581                css3/parse-align-self.html
582
583         * css/CSSComputedStyleDeclaration.cpp:
584         (WebCore::resolveAlignmentAuto): Added. Resolves the "auto" value for the alignment properties.
585         (WebCore::valueForItemPositionWithOverflowAlignment): Added. Builds the CSSValue for the for the alignment properties.
586         (WebCore::ComputedStyleExtractor::propertyValue):
587         * css/CSSParser.cpp:
588          (WebCore::isValidKeywordPropertyAndValue): Removed align-self, align-items and justify-items.
589         (WebCore::isKeywordPropertyID): Removed align-self, align-items and justify-items.
590         (WebCore::isBaselinePositionKeyword): Added. Set of keywords related to baseline value.
591         (WebCore::CSSParser::parseItemPositionOverflowPosition): Generic parsing fuction for the alignment properties.
592         (WebCore::CSSParser::parseJustifySelf): Deleted.
593         (WebCore::CSSParser::parseValue): Added align-items and align-self to the list and call to the generic parsing fuction for the alignment properties.
594         * css/CSSParser.h:
595         * css/CSSPrimitiveValueMappings.h:
596         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Added.
597         (WebCore::CSSPrimitiveValue::operator ItemPosition): Added. Replace the old EAlignItems enumeration.
598         (WebCore::CSSPrimitiveValue::operator OverflowAlignment): Added.
599         (WebCore::CSSPrimitiveValue::operator EAlignItems): Deleted.
600         (WebCore::CSSPrimitiveValue::operator EJustifySelf): Deleted.
601         (WebCore::CSSPrimitiveValue::operator EJustifySelfOverflowAlignment): Deleted.
602         * css/CSSPropertyNames.in:
603         * css/CSSValueKeywords.in:
604         * css/StyleBuilderCustom.h:
605         (WebCore::StyleBuilderCustom::applyInheritAlignSelf): Added.
606         (WebCore::StyleBuilderCustom::applyInitialAlignSelf): Added.
607         (WebCore::StyleBuilderCustom::applyValueAlignSelf): Added.
608         (WebCore::StyleBuilderCustom::applyInheritAlignItems): Added.
609         (WebCore::StyleBuilderCustom::applyInitialAlignItems): Added.
610         (WebCore::StyleBuilderCustom::applyValueAlignItems): Added.
611         (WebCore::StyleBuilderCustom::applyInheritJustifySelf): Added.
612         (WebCore::StyleBuilderCustom::applyInitialJustifySelf): Added.
613         (WebCore::StyleBuilderCustom::applyValueJustifySelf): Added.
614         (WebCore::StyleBuilderCustom::applyValueWebkitJustifySelf): Deleted.
615         * css/StyleResolver.cpp:
616         (WebCore::StyleResolver::adjustRenderStyle): isDisplayFlexibleOrGridBox now a RenderStyle function.
617         (WebCore::isDisplayFlexibleBox): Deleted. Moved to RenderStyle.
618         (WebCore::isDisplayGridBox): Deleted. Moved to RenderStyle.
619         (WebCore::isDisplayFlexibleOrGridBox): Deleted. Moved to RenderStyle.
620         * rendering/RenderBox.cpp:
621         (WebCore::flexItemHasStretchAlignment): Adapted to the new ItemPostition enum.
622         * rendering/RenderFlexibleBox.cpp:
623         (WebCore::RenderFlexibleBox::firstLineBaseline): Adapted to the new ItemPostition enum.
624         (WebCore::RenderFlexibleBox::styleDidChange): Adapted to the new ItemPostition enum.
625         (WebCore::RenderFlexibleBox::alignmentForChild): Adapted to the new ItemPostition enum.
626         (WebCore::RenderFlexibleBox::needToStretchChild): Adapted to the new ItemPostition enum.
627         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): Adapted to the new ItemPostition enum.
628         (WebCore::RenderFlexibleBox::alignChildren): Adapted to the new ItemPostition enum.
629         (WebCore::resolveAlignment): Deleted. Moved to RenderStyle.
630         * rendering/RenderFlexibleBox.h:
631         * rendering/RenderFullScreen.cpp:
632         (WebCore::createFullScreenStyle): Adapted to the new ItemPostition enum.
633         * rendering/RenderMenuList.cpp:
634         (WebCore::RenderMenuList::adjustInnerStyle): Adapted to the new ItemPostition enum.
635         * rendering/mathml/RenderMathMLRoot.cpp:
636         (WebCore::RenderMathMLRoot::updateStyle): Adapted to the new ItemPostition enum.
637         * rendering/mathml/RenderMathMLScripts.cpp:
638         (WebCore::RenderMathMLScripts::fixAnonymousStyleForSubSupPair): Adapted to the new ItemPostition enum.
639         (WebCore::RenderMathMLScripts::fixAnonymousStyles): Adapted to the new ItemPostition enum.
640         * rendering/style/ContentData.h:
641         * rendering/style/RenderStyle.cpp:
642         (WebCore::RenderStyle::resolveAlignment): Added.
643         * rendering/style/RenderStyle.h: Adapted to the new ItemPostition enum.
644         * rendering/style/RenderStyleConstants.h: Adapted to the new ItemPostition enum.
645         * rendering/style/StyleRareNonInheritedData.cpp: Adapted to the new ItemPostition enum.
646         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): Adapted to the new ItemPostition enum.
647         (WebCore::StyleRareNonInheritedData::operator==): Adapted to the new ItemPostition enum.
648         * rendering/style/StyleRareNonInheritedData.h: Adapted to the new ItemPostition enum.
649         * style/StyleResolveTree.cpp:
650         (WebCore::Style::determineChange): Changes in the alignItems property cause a Detach.
651
652 2015-03-27  David Hyatt  <hyatt@apple.com>
653
654         [New Block-Inside-Inline Model] Create anonymous inline blocks to hold blocks-inside-inlines.
655         https://bugs.webkit.org/show_bug.cgi?id=143145
656
657         Reviewed by Dean Jackson.
658
659         Added fast/block/inside-inlines/ tests.
660
661         * rendering/RenderBlock.cpp:
662         (WebCore::RenderBlock::renderName):
663         Add support for labeling anonymous inline-blocks when dumped by the render tree.
664
665         * rendering/RenderInline.cpp:
666         (WebCore::RenderInline::addChildIgnoringContinuation):
667         When the pref is set to use the new block-inside-inline model, create an anonymous inline block to
668         hold block children of RenderInlines instead of splitting flows or creating continuations.
669
670         * rendering/RenderObject.h:
671         (WebCore::RenderObject::isAnonymousInlineBlock):
672         Add the definition of isAnonymousInlineBlock (note the exclusion of Ruby, since Ruby creates anonymous
673         inline-blocks also).
674
675 2015-03-30  Chris Dumez  <cdumez@apple.com>
676
677         [WK2][NetworkCache] Add support for "Cache-Control: max-stale" request header
678         https://bugs.webkit.org/show_bug.cgi?id=143159
679         <rdar://problem/20333296>
680
681         Reviewed by Antti Koivisto.
682
683         Add support for "Cache-Control: max-stale" request header:
684         https://tools.ietf.org/html/rfc7234#section-5.2.1.2
685
686         Test: http/tests/cache/disk-cache/disk-cache-request-max-stale.html
687
688         * platform/network/CacheValidation.cpp:
689         (WebCore::parseCacheControlDirectives):
690         * platform/network/CacheValidation.h:
691
692 2015-03-30  Simon Fraser  <simon.fraser@apple.com>
693
694         Fix iOS internal build after r182132.
695
696         * page/scrolling/ScrollingCoordinator.cpp:
697         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
698
699 2015-03-30  Jer Noble  <jer.noble@apple.com>
700
701         [iOS] When Web Audio is interrupted by a phone call, it cannot be restarted.
702         https://bugs.webkit.org/show_bug.cgi?id=143190
703
704         Reviewed by Darin Adler.
705
706         Tests: webaudio/audiocontext-state-interrupted.html
707                webaudio/audiocontext-state.html
708
709         Implement the following methods and properties from the Web Audio spec:
710         close(), suspend(), resume(), onstatechange.
711
712         AudioContext will take more responsibility for tracking state and interruptions (and
713         AudioDestination will give up that responsibility). This means AudioContext must be a
714         MediaSessionClient, and own its own MediaSession. In return, AudioDestinationIOS and 
715         AudioDestinationMac relinquish both.
716
717         * Modules/webaudio/AudioContext.cpp:
718         (WebCore::AudioContext::AudioContext): Set default values in header.
719         (WebCore::AudioContext::uninitialize): Call setState() instead of setting m_state.
720         (WebCore::AudioContext::addReaction): Added. Append the callback to the appropriate vector for the state.
721         (WebCore::AudioContext::setState): Added. Fire events and resolve the appropriate reaction callbacks for the new state.
722         (WebCore::AudioContext::state): Return a string representing the context's state.
723         (WebCore::AudioContext::stop): Close the event queue.
724         (WebCore::AudioContext::startRendering): Call setState().
725         (WebCore::AudioContext::fireCompletionEvent): Call setState().
726         (WebCore::AudioContext::suspendContext): Added. Add reaction callback and call suspend() on the destination node.
727         (WebCore::AudioContext::resumeContext): Added. Add reaction callback and call resume() on the destination node.
728         (WebCore::AudioContext::closeContext): Added. Add reaction callback and call close() on the destination node.
729         (WebCore::AudioContext::suspendPlayback): Added. Suspend playback and set state to interrupted.
730         (WebCore::AudioContext::mayResumePlayback): Added. Conditionally resume playback.
731         * bindings/js/JSAudioContextCustom.cpp:
732         (WebCore::JSAudioContext::suspend): Added. Create and return a new Promise object.
733         (WebCore::JSAudioContext::resume): Ditto.
734         (WebCore::JSAudioContext::close): Ditto.
735         * Modules/webaudio/AudioContext.idl: Add new methods and properties.
736
737         Extensive organizational changes were made to AudioContext.h to group instance
738         variables together and add C++11 initializers in their declarations:
739
740         * Modules/webaudio/AudioContext.h:
741         (WebCore::AudioContext::mediaType): Moved from AudioDestinationNode.
742         (WebCore::AudioContext::presentationType): Ditto.
743         (WebCore::AudioContext::canReceiveRemoteControlCommands): Ditto.
744         (WebCore::AudioContext::didReceiveRemoteControlCommand): Ditto.
745         (WebCore::AudioContext::overrideBackgroundPlaybackRestriction): Ditto.
746         
747         Other changes to support the new AudioContext methods:
748
749         * Modules/webaudio/AudioDestinationNode.h:
750         (WebCore::AudioDestinationNode::resume): Add empty default virtual method.
751         (WebCore::AudioDestinationNode::suspend): Ditto.
752         (WebCore::AudioDestinationNode::close): Ditto.
753         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
754         (WebCore::DefaultAudioDestinationNode::resume): Added. Pass to AudioDestination.
755         (WebCore::DefaultAudioDestinationNode::suspend): Ditto.
756         (WebCore::DefaultAudioDestinationNode::close): Ditto.
757         * Modules/webaudio/DefaultAudioDestinationNode.h:
758         * bindings/js/JSDOMPromise.h:
759         (WebCore::DeferredWrapper::resolve): Add an overload for a nullptr resolve value.
760         * dom/EventNames.h: Added 'statechange'.
761         * dom/ScriptExecutionContext.h:
762         (WebCore::ScriptExecutionContext::Task::Task): Add a constructor which takes a void() callback.
763
764         Modify MediaSession, AudioSession, and MediaSessionManager to support the new
765         interruption behavior.
766
767         * html/HTMLMediaElement.cpp:
768         (WebCore::HTMLMediaElement::suspendPlayback): Renamed from pausePlayback().
769         (WebCore::HTMLMediaElement::mayResumePlayback): Renamed from resumePlayback().
770         * html/HTMLMediaElement.h:
771         * platform/audio/AudioSession.cpp:
772         (WebCore::AudioSession::tryToSetActive): Renamed from setActive. Return true by default.
773         (WebCore::AudioSession::setActive): Deleted.
774         * platform/audio/AudioSession.h:
775         * platform/audio/MediaSession.cpp:
776         (WebCore::MediaSession::beginInterruption): pausePlayback() was renamed to suspendPlayback().
777         (WebCore::MediaSession::endInterruption): Always notify the client, telling it whether to resume.
778         (WebCore::MediaSession::clientWillBeginPlayback): Bail early if reentrant.  Check the (new) 
779             return value of sessionWillBeginPlayback() and remember to resume once the interruption ends.
780         (WebCore::MediaSession::clientWillPausePlayback): Bail early if reentrant.
781         (WebCore::MediaSession::pauseSession): pausePlayback() was renamed to suspendPlayback().
782         * platform/audio/MediaSession.h:
783         * platform/audio/MediaSessionManager.cpp:
784         (WebCore::MediaSessionManager::sessionWillBeginPlayback): Return false if not allowed to break interruption or 
785             if activating the audio session failed. Otherwise, end the interruption.
786         * platform/audio/MediaSessionManager.h:
787         * platform/audio/ios/AudioDestinationIOS.cpp:
788         (WebCore::AudioDestinationIOS::AudioDestinationIOS): m_mediaSession was removed.
789         (WebCore::AudioDestinationIOS::start): Ditto.
790         * platform/audio/ios/AudioDestinationIOS.h:
791         * platform/audio/ios/AudioSessionIOS.mm:
792         (WebCore::AudioSession::tryToSetActive): Renamed from setActive. Return false if the AVAudioSession could not be activated.
793         (WebCore::AudioSession::setActive): Deleted.
794         * platform/audio/ios/MediaSessionManagerIOS.h:
795         * platform/audio/ios/MediaSessionManagerIOS.mm:
796         (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Do not update the now playing info if session playback was blocked.
797         * platform/audio/mac/AudioDestinationMac.cpp:
798         (WebCore::AudioDestinationMac::AudioDestinationMac): m_mediaSession was removed.
799         * platform/audio/mac/AudioDestinationMac.h:
800         * platform/audio/mac/AudioSessionMac.cpp:
801         (WebCore::AudioSession::tryToSetActive): Renamed from setActive(). Return true by default.
802         (WebCore::AudioSession::setActive): Deleted.
803         * platform/audio/mac/MediaSessionManagerMac.cpp:
804         (MediaSessionManager::updateSessionState): No longer attempt to activate the session, as this is done
805             MediaSessionManager::sessionWillBeginPlayback().
806         * testing/Internals.cpp:
807         (WebCore::Internals::setMediaSessionRestrictions): Add "InterruptedPlaybackNotPermitted".
808
809 2015-03-25 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
810
811         [Streams API] Error storage should be moved from source to stream/reader
812         https://bugs.webkit.org/show_bug.cgi?id=143048
813
814         Reviewed by Benjamin Poulain.
815
816         This patch removes error storage from the source as it should be stored at the stream level as error access goes through the reader.
817         It removes abstract ReadableStreamSource::isErrored and the storage of JavaScript errors from ReadableStreamJSSource.
818
819         Existing tests cover most of the changes.
820         Added test case for creating readable stream from empty JS object.
821
822         * Modules/streams/ReadableStreamSource.h: Removing isErrored().
823         * bindings/js/JSReadableStreamCustom.cpp:
824         (WebCore::constructJSReadableStream): Added JS stream constructor parameters checking.
825         * bindings/js/ReadableStreamJSSource.cpp:
826         (WebCore::ReadableStreamJSSource::ReadableStreamJSSource): Removed JS stream constructor parameters checking.
827         (WebCore::ReadableStreamJSSource::start): Changed prototype of start so that start can throw errors directly.
828         (WebCore::ReadableStreamJSSource::setInternalError): Deleted.
829         * bindings/js/ReadableStreamJSSource.h: Removed m_error, setInternalError and updated start declaration.
830
831 2015-03-30  Philippe Normand  <pnormand@igalia.com>
832
833         [GStreamer] More GL shared context fixes
834         https://bugs.webkit.org/show_bug.cgi?id=143216
835
836         Reviewed by Carlos Garcia Campos.
837
838         Moved the GLX/EGL context tests to be done at runtime rather than
839         using build-time macros because in the GTK port at least, both EGL
840         and GLX support are mutually exclusive. Also fixed a couple wrong
841         defines (USE(GLES2) doesn't exist).
842
843         * platform/graphics/GLContext.h: Simple utility method to check if
844         the platform context is compatible with EGL APIs or not.
845         * platform/graphics/egl/GLContextEGL.h:
846         (WebCore::GLContextEGL::isEGLContext):
847         * platform/graphics/glx/GLContextGLX.h:
848         (WebCore::GLContextGLX::isEGLContext):
849         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
850         (WebCore::MediaPlayerPrivateGStreamer::ensureGstGLContext): Do
851         runtime checks and properly ensure GLES2/GL API usage.
852
853 2015-03-30  Marcos Chavarría Teijeiro  <chavarria1991@gmail.com>
854
855         Add support for deleting emoji on GTK
856         https://bugs.webkit.org/show_bug.cgi?id=141419
857
858         Reviewed by Gustavo Noronha Silva.
859
860         The code for deleting special group of characters was specific for
861         COCOA and EFL platforms. The fix consists on add GTK to the #if
862         preprocessor directive.
863
864         * rendering/RenderText.cpp:
865         (WebCore::RenderText::previousOffsetForBackwardDeletion):
866
867 2015-03-30  Benjamin Poulain  <benjamin@webkit.org>
868
869         Start the features.json files
870         https://bugs.webkit.org/show_bug.cgi?id=143207
871
872         Reviewed by Darin Adler.
873
874         * features.json: Added.
875
876 2015-03-29  Simon Fraser  <simon.fraser@apple.com>
877
878         Convert arguments to ScrollingCoordinator functions to references
879         https://bugs.webkit.org/show_bug.cgi?id=143198
880
881         Reviewed by Darin Adler.
882
883         Convert all the FrameView* and ScrollableArea* arguments to ScrollingCoordinator functions to
884         references, and use references in a few other places.
885
886         * dom/Document.cpp:
887         (WebCore::wheelEventHandlerCountChanged):
888         * loader/HistoryController.cpp:
889         (WebCore::HistoryController::restoreScrollPositionAndViewState):
890         * page/DebugPageOverlays.cpp:
891         (WebCore::NonFastScrollableRegionOverlay::updateRegion):
892         * page/Frame.cpp:
893         (WebCore::Frame::willDetachPage):
894         * page/FrameView.cpp:
895         (WebCore::FrameView::prepareForDetach):
896         (WebCore::FrameView::addSlowRepaintObject):
897         (WebCore::FrameView::removeSlowRepaintObject):
898         (WebCore::FrameView::addViewportConstrainedObject):
899         (WebCore::FrameView::removeViewportConstrainedObject):
900         (WebCore::FrameView::requestScrollPositionUpdate):
901         (WebCore::FrameView::performPostLayoutTasks):
902         (WebCore::FrameView::scrollableAreaSetChanged):
903         (WebCore::FrameView::wheelEvent):
904         * page/Page.cpp:
905         (WebCore::Page::nonFastScrollableRects):
906         * page/Page.h:
907         * page/scrolling/AsyncScrollingCoordinator.cpp:
908         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
909         (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
910         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
911         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
912         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
913         (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
914         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
915         (WebCore::AsyncScrollingCoordinator::updateMainFrameScrollLayerPosition):
916         (WebCore::AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView):
917         * page/scrolling/AsyncScrollingCoordinator.h:
918         * page/scrolling/ScrollingCoordinator.cpp:
919         (WebCore::ScrollingCoordinator::pageDestroyed):
920         (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView):
921         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
922         (WebCore::ScrollingCoordinator::frameViewWheelEventHandlerCountChanged):
923         (WebCore::ScrollingCoordinator::frameViewHasSlowRepaintObjectsDidChange):
924         (WebCore::ScrollingCoordinator::frameViewFixedObjectsDidChange):
925         (WebCore::ScrollingCoordinator::scrollLayerForScrollableArea):
926         (WebCore::ScrollingCoordinator::scrollLayerForFrameView):
927         (WebCore::ScrollingCoordinator::headerLayerForFrameView):
928         (WebCore::ScrollingCoordinator::footerLayerForFrameView):
929         (WebCore::ScrollingCoordinator::counterScrollingLayerForFrameView):
930         (WebCore::ScrollingCoordinator::insetClipLayerForFrameView):
931         (WebCore::ScrollingCoordinator::contentShadowLayerForFrameView):
932         (WebCore::ScrollingCoordinator::rootContentLayerForFrameView):
933         (WebCore::ScrollingCoordinator::frameViewRootLayerDidChange):
934         (WebCore::ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects):
935         (WebCore::ScrollingCoordinator::synchronousScrollingReasons):
936         (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons):
937         (WebCore::ScrollingCoordinator::setForceSynchronousScrollLayerPositionUpdates):
938         (WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously):
939         (WebCore::ScrollingCoordinator::replaySessionStateDidChange):
940         (WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText):
941         * page/scrolling/ScrollingCoordinator.h: Align the bitmask enums to make mistakes easier to spot.
942         (WebCore::ScrollingCoordinator::frameViewLayoutUpdated):
943         (WebCore::ScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
944         (WebCore::ScrollingCoordinator::requestScrollPositionUpdate):
945         (WebCore::ScrollingCoordinator::handleWheelEvent):
946         (WebCore::ScrollingCoordinator::willDestroyScrollableArea):
947         (WebCore::ScrollingCoordinator::scrollableAreaScrollLayerDidChange):
948         (WebCore::ScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
949         (WebCore::ScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView):
950         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
951         (WebCore::ScrollingCoordinatorCoordinatedGraphics::scrollableAreaScrollLayerDidChange):
952         (WebCore::ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea):
953         (WebCore::ScrollingCoordinatorCoordinatedGraphics::requestScrollPositionUpdate):
954         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h:
955         * page/scrolling/ios/ScrollingCoordinatorIOS.h:
956         * page/scrolling/mac/ScrollingCoordinatorMac.h:
957         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
958         (WebCore::ScrollingCoordinatorMac::handleWheelEvent):
959         * rendering/RenderLayer.cpp:
960         (WebCore::RenderLayer::~RenderLayer):
961         * rendering/RenderLayerBacking.cpp:
962         (WebCore::RenderLayerBacking::updateOverflowControlsLayers):
963         * rendering/RenderLayerCompositor.cpp:
964         (WebCore::RenderLayerCompositor::updateBacking):
965         (WebCore::RenderLayerCompositor::hasCoordinatedScrolling):
966         (WebCore::RenderLayerCompositor::scrollingLayerDidChange):
967         (WebCore::RenderLayerCompositor::updateLayerForHeader):
968         (WebCore::RenderLayerCompositor::updateLayerForFooter):
969         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
970         (WebCore::RenderLayerCompositor::destroyRootLayer):
971         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
972         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
973         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
974         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
975         * testing/Internals.cpp:
976         (WebCore::Internals::nonFastScrollableRects):
977
978 2015-03-29  Benjamin Poulain  <benjamin@webkit.org>
979
980         Use :matches() instead of :-webkit-any() for the sections and headings default style
981         https://bugs.webkit.org/show_bug.cgi?id=143197
982
983         Reviewed by Darin Adler.
984
985         We no longer need to use the :-webkit-any() hack in the default stylesheet.
986
987         The pseudo class :matches() also support correct specificity. This is not observable
988         since those selector do not conflict with any other rule in the default stylesheet.
989
990         * css/CSSSelector.h:
991         * css/SelectorChecker.cpp:
992         (WebCore::SelectorChecker::determineLinkMatchType):
993         * css/html.css:
994         (:matches(article, aside, nav, section) h1):
995         (:matches(article, aside, nav, section) :matches(article, aside, nav, section) h1):
996         (:matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) h1):
997         (:matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) h1):
998         (:matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) h1):
999         (:-webkit-any(article,aside,nav,section) h1): Deleted.
1000         (:-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) h1): Deleted.
1001         (:-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) h1): Deleted.
1002         (:-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) h1): Deleted.
1003         (:-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) h1): Deleted.
1004
1005 2015-03-29  Benjamin Poulain  <benjamin@webkit.org>
1006
1007         `currentColor` computes to the same colour on all elements, even if 'color' is inherited differently
1008         https://bugs.webkit.org/show_bug.cgi?id=133420
1009
1010         Reviewed by Darin Adler.
1011
1012         When resolving a style with the help of the property cache, we were
1013         completely ignoring currentColor.
1014
1015         Since you can set currentColor on properties that are not inherited,
1016         those properties would just be copied from the cached style, which
1017         may have a completely different inherited color.
1018
1019         This pacth fixes the issue by preventing any MatchResult from hitting
1020         the cache if it contains any non-inherited property that would require
1021         resolution by the cache:
1022         -Using the inherit value.
1023         -Using the currentColor value.
1024
1025         Tests: fast/css/currentColor-on-before-after-pseudo-elements.html
1026                fast/css/currentColor-style-update-reftest.html
1027                fast/css/currentColor-value-style-update.html
1028
1029         * css/ElementRuleCollector.cpp:
1030         (WebCore::ElementRuleCollector::addElementStyleProperties):
1031         (WebCore::ElementRuleCollector::matchAuthorRules):
1032         (WebCore::ElementRuleCollector::matchUserRules):
1033         (WebCore::ElementRuleCollector::matchUARules):
1034         * css/StyleResolver.cpp:
1035         (WebCore::StyleResolver::MatchResult::addMatchedProperties):
1036         (WebCore::StyleResolver::styleForKeyframe):
1037         (WebCore::StyleResolver::pseudoStyleForElement):
1038         (WebCore::StyleResolver::styleForPage):
1039         (WebCore::StyleResolver::findFromMatchedPropertiesCache):
1040         (WebCore::StyleResolver::addToMatchedPropertiesCache):
1041         (WebCore::extractDirectionAndWritingMode):
1042         (WebCore::StyleResolver::applyMatchedProperties):
1043         (WebCore::StyleResolver::CascadedProperties::addStyleProperties):
1044         (WebCore::StyleResolver::CascadedProperties::addMatches):
1045         * css/StyleResolver.h:
1046         (WebCore::StyleResolver::MatchResult::matchedProperties):
1047
1048 2015-03-29  Benjamin Poulain  <benjamin@webkit.org>
1049
1050         Enable :any-link by default
1051         https://bugs.webkit.org/show_bug.cgi?id=143201
1052
1053         Reviewed by Sam Weinig.
1054
1055         The pseudo class :any-link has been stable for a while. This patch enables
1056         it by default and remove the -webkit- prefix on the default style.
1057
1058         * css/CSSDefaultStyleSheets.cpp:
1059         * css/CSSSelector.cpp:
1060         (WebCore::CSSSelector::selectorText):
1061         * css/CSSSelector.h:
1062         * css/RuleSet.cpp:
1063         (WebCore::RuleSet::addRule):
1064         * css/SelectorChecker.cpp:
1065         (WebCore::SelectorChecker::checkOne):
1066         * css/SelectorChecker.h:
1067         (WebCore::SelectorChecker::isCommonPseudoClassSelector):
1068         * css/SelectorPseudoClassAndCompatibilityElementMap.in:
1069         * css/html.css:
1070         (a:any-link):
1071         (a:any-link:active):
1072         (:any-link img):
1073         (a:-webkit-any-link): Deleted.
1074         (a:-webkit-any-link:active): Deleted.
1075         (:-webkit-any-link img): Deleted.
1076         * cssjit/SelectorCompiler.cpp:
1077         (WebCore::SelectorCompiler::addPseudoClassType):
1078         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementLinkMatching):
1079
1080 2015-03-29  Joonghun Park  <jh718.park@samsung.com>
1081
1082         nullptr cleanup in RenderFooBox classes
1083         https://bugs.webkit.org/show_bug.cgi?id=143182
1084
1085         Reviewed by Ryosuke Niwa.
1086
1087         No new tests, no behavior changes
1088
1089         Replace 0 with nullptr in RenderFooBox classes.
1090
1091         * rendering/RenderBox.cpp:
1092         (WebCore::RenderBox::RenderBox):
1093         (WebCore::RenderBox::paintFillLayer):
1094         (WebCore::RenderBox::shrinkLogicalWidthToAvoidFloats):
1095         (WebCore::RenderBox::containingBlockAvailableLineWidthInRegion):
1096         (WebCore::RenderBox::renderBoxRegionInfo):
1097         (WebCore::RenderBox::computePositionedLogicalWidthUsing):
1098         (WebCore::RenderBox::computePositionedLogicalHeightUsing):
1099         (WebCore::RenderBox::computePositionedLogicalWidthReplaced):
1100         (WebCore::RenderBox::positionForPoint):
1101         (WebCore::RenderBox::layoutOverflowRectForPropagation):
1102         * rendering/RenderBox.h:
1103         (WebCore::RenderBox::setMarginBefore):
1104         (WebCore::RenderBox::setMarginAfter):
1105         (WebCore::RenderBox::setMarginStart):
1106         (WebCore::RenderBox::setMarginEnd):
1107         (WebCore::RenderBox::createAnonymousBoxWithSameTypeAs):
1108         (WebCore::RenderBox::setInlineBoxWrapper):
1109         * rendering/RenderBoxModelObject.cpp:
1110         (WebCore::RenderBoxModelObject::willBeDestroyed):
1111         (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
1112         (WebCore::RenderBoxModelObject::paintBorderSides):
1113         (WebCore::RenderBoxModelObject::firstLetterRemainingText):
1114         * rendering/RenderBoxModelObject.h:
1115         (WebCore::RenderBoxModelObject::moveChildTo):
1116         (WebCore::RenderBoxModelObject::moveAllChildrenTo):
1117         (WebCore::RenderBoxModelObject::moveChildrenTo):
1118         * rendering/RenderDeprecatedFlexibleBox.cpp:
1119         (WebCore::FlexBoxIterator::reset):
1120         (WebCore::FlexBoxIterator::next):
1121         * rendering/RenderDeprecatedFlexibleBox.h:
1122         * rendering/RenderFlexibleBox.cpp:
1123         (WebCore::RenderFlexibleBox::firstLineBaseline):
1124         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
1125         * rendering/RenderLineBoxList.cpp:
1126         (WebCore::RenderLineBoxList::deleteLineBoxTree):
1127         (WebCore::RenderLineBoxList::extractLineBox):
1128         (WebCore::RenderLineBoxList::deleteLineBoxes):
1129         (WebCore::RenderLineBoxList::checkConsistency):
1130         * rendering/RenderLineBoxList.h:
1131         (WebCore::RenderLineBoxList::RenderLineBoxList):
1132         * rendering/RenderListBox.cpp:
1133         (WebCore::RenderListBox::enclosingScrollableArea):
1134         (WebCore::RenderListBox::setHasVerticalScrollbar):
1135         * rendering/RenderListBox.h:
1136
1137 2015-03-29  Darin Adler  <darin@apple.com>
1138
1139         HTMLCollection caches incorrect length if item(0) is called before length on an empty collection
1140         https://bugs.webkit.org/show_bug.cgi?id=143203
1141         rdar://problem/18460462
1142
1143         Reviewed by Antti Koivisto.
1144
1145         Test: fast/dom/htmlcollection-length-after-item-2.html
1146
1147         * dom/CollectionIndexCache.h:
1148         (CollectionIndexCache::nodeAt): If we hit the end looking for index 0, cache a length
1149         of 0, not a length of 1.
1150
1151 2015-03-29  Darin Adler  <darin@apple.com>
1152
1153         Remove unneeded SVG code, including most isSupportedAttribute functions
1154         https://bugs.webkit.org/show_bug.cgi?id=143194
1155
1156         Reviewed by Antti Koivisto.
1157
1158         - Removed most implementations of isSupportedAttribute. Others can be removed in
1159           future patches. The ones left behind are now all private static member functions.
1160           It's dangerous for them to be public because they tend to indicate which attributes
1161           are supported at a particular level in the class hierarchy and they are not virtual
1162           functions; might want to rethink the function name if we keep any of these long term.
1163
1164         - Removed unneeded includes, especially of Attr.h and Attribute.h.
1165
1166         - Changed most parseAttribute and svgAttributeChanged functions so they no longer
1167           rely on checking attribute names against a set. Also removed lots of unneeded calls
1168           to SVGLangSpace::parseAttribute, which is called by SVGElement::parseAttribute and
1169           need not be called by derived classes.
1170
1171         - Removed return values from parseAttribute functions. Skipping other parseAttribute
1172           logic is not an important optimization and makes functions needlessly complex.
1173
1174         - Moved use of InstanceInvalidationGuard closer to where they are needed. Eventually
1175           we may be able to remove many of these.
1176
1177         - Used auto in a few places where the same type is repeated twice on the same line of
1178           code, and auto makes it a bit smaller.
1179
1180         - Got rid of protected sections in some final classes; doesn't make sense to combine
1181           these two. Also moved a few functions from protected to private in other classes.
1182
1183         - Made a number of functions into static member functions in the base classes such
1184           as SVGLangSpace; they were not making any use of the object, and so it was wasteful
1185           to compile them as non-static member functions.
1186
1187         * rendering/svg/RenderSVGImage.cpp: Removed unneeded includes.
1188         * svg/SVGAElement.cpp: Removed unneeded includes.
1189         (WebCore::SVGAElement::isSupportedAttribute): Deleted.
1190         (WebCore::SVGAElement::parseAttribute): Don't use isSupportedAttribute.
1191         (WebCore::SVGAElement::svgAttributeChanged): Don't use isSupportedAttribute.
1192         * svg/SVGAElement.h: Removed isSupportedAttribute.
1193         * svg/SVGAnimateMotionElement.cpp: Removed unneeded includes.
1194         (WebCore::SVGAnimateMotionElement::isSupportedAttribute): Deleted.
1195         (WebCore::SVGAnimateMotionElement::parseAttribute): Don't use isSupportedAttribute.
1196         * svg/SVGAnimateMotionElement.h: Removed isSupportedAttribute.
1197         * svg/SVGAnimateTransformElement.cpp:
1198         (WebCore::SVGAnimateTransformElement::isSupportedAttribute): Deleted.
1199         (WebCore::SVGAnimateTransformElement::parseAttribute): Don't use isSupportedAttribute.
1200         * svg/SVGAnimateTransformElement.h: Removed isSupportedAttribute.
1201         * svg/SVGAnimationElement.cpp:
1202         (WebCore::SVGAnimationElement::parseAttribute): Don't use isSupportedAttribute.
1203         * svg/SVGCircleElement.cpp:
1204         (WebCore::SVGCircleElement::isSupportedAttribute): Deleted.
1205         (WebCore::SVGCircleElement::parseAttribute): Don't use isSupportedAttribute.
1206         (WebCore::SVGCircleElement::svgAttributeChanged): Don't use isSupportedAttribute.
1207         * svg/SVGCircleElement.h: Removed isSupportedAttribute.
1208         * svg/SVGClipPathElement.cpp: Removed unneeded includes.
1209         (WebCore::SVGClipPathElement::parseAttribute): Don't use isSupportedAttribute.
1210         * svg/SVGComponentTransferFunctionElement.cpp:
1211         (WebCore::SVGComponentTransferFunctionElement::parseAttribute): Don't use isSupportedAttribute.
1212         * svg/SVGCursorElement.cpp: Removed unneeded includes.
1213         (WebCore::SVGCursorElement::parseAttribute): Don't use isSupportedAttribute.
1214         (WebCore::SVGCursorElement::svgAttributeChanged): Don't use isSupportedAttribute.
1215         * svg/SVGElement.cpp: Removed unneeded includes.
1216         * svg/SVGEllipseElement.cpp: Removed unneeded includes.
1217         (WebCore::SVGEllipseElement::isSupportedAttribute): Deleted.
1218         (WebCore::SVGEllipseElement::parseAttribute): Don't use isSupportedAttribute.
1219         (WebCore::SVGEllipseElement::svgAttributeChanged): Don't use isSupportedAttribute.
1220         * svg/SVGEllipseElement.h: Removed isSupportedAttribute.
1221         * svg/SVGExternalResourcesRequired.cpp: Removed unneeded includes.
1222         (WebCore::SVGExternalResourcesRequired::parseAttribute): Don't return a boolean.
1223         * svg/SVGExternalResourcesRequired.h: Don't return a boolean.
1224         * svg/SVGFEBlendElement.cpp: Removed unneeded includes.
1225         (WebCore::SVGFEBlendElement::isSupportedAttribute): Deleted.
1226         (WebCore::SVGFEBlendElement::parseAttribute): Don't use isSupportedAttribute.
1227         (WebCore::SVGFEBlendElement::svgAttributeChanged): Don't use isSupportedAttribute.
1228         * svg/SVGFEBlendElement.h: Removed isSupportedAttribute.
1229         * svg/SVGFEColorMatrixElement.cpp: Removed unneeded includes.
1230         (WebCore::SVGFEColorMatrixElement::isSupportedAttribute): Deleted.
1231         (WebCore::SVGFEColorMatrixElement::parseAttribute): Don't use isSupportedAttribute.
1232         (WebCore::SVGFEColorMatrixElement::svgAttributeChanged): Don't use isSupportedAttribute.
1233         * svg/SVGFEColorMatrixElement.h: Removed isSupportedAttribute.
1234         * svg/SVGFEComponentTransferElement.cpp: Removed unneeded includes.
1235         (WebCore::SVGFEComponentTransferElement::isSupportedAttribute): Deleted.
1236         (WebCore::SVGFEComponentTransferElement::parseAttribute): Don't use isSupportedAttribute.
1237         * svg/SVGFEComponentTransferElement.h: Removed unneeded includes.
1238         * svg/SVGFECompositeElement.cpp: Removed unneeded includes.
1239         (WebCore::SVGFECompositeElement::isSupportedAttribute): Deleted.
1240         (WebCore::SVGFECompositeElement::parseAttribute): Don't use isSupportedAttribute.
1241         (WebCore::SVGFECompositeElement::svgAttributeChanged): Don't use isSupportedAttribute.
1242         * svg/SVGFECompositeElement.h:
1243         * svg/SVGFEConvolveMatrixElement.cpp: Removed unneeded includes.
1244         (WebCore::SVGFEConvolveMatrixElement::isSupportedAttribute): Deleted.
1245         (WebCore::SVGFEConvolveMatrixElement::parseAttribute): Don't use isSupportedAttribute.
1246         (WebCore::SVGFEConvolveMatrixElement::svgAttributeChanged): Don't use isSupportedAttribute.
1247         * svg/SVGFEConvolveMatrixElement.h:
1248         * svg/SVGFEDiffuseLightingElement.cpp: Removed unneeded includes.
1249         (WebCore::SVGFEDiffuseLightingElement::isSupportedAttribute): Deleted.
1250         (WebCore::SVGFEDiffuseLightingElement::parseAttribute): Don't use isSupportedAttribute.
1251         (WebCore::SVGFEDiffuseLightingElement::svgAttributeChanged): Don't use isSupportedAttribute.
1252         * svg/SVGFEDiffuseLightingElement.h:
1253         * svg/SVGFEDisplacementMapElement.cpp: Removed unneeded includes.
1254         (WebCore::SVGFEDisplacementMapElement::isSupportedAttribute): Deleted.
1255         (WebCore::SVGFEDisplacementMapElement::parseAttribute): Don't use isSupportedAttribute.
1256         (WebCore::SVGFEDisplacementMapElement::svgAttributeChanged): Don't use isSupportedAttribute.
1257         * svg/SVGFEDisplacementMapElement.h:
1258         * svg/SVGFEDropShadowElement.cpp: Removed unneeded includes.
1259         (WebCore::SVGFEDropShadowElement::isSupportedAttribute): Deleted.
1260         (WebCore::SVGFEDropShadowElement::parseAttribute): Don't use isSupportedAttribute.
1261         (WebCore::SVGFEDropShadowElement::svgAttributeChanged): Don't use isSupportedAttribute.
1262         * svg/SVGFEDropShadowElement.h:
1263         * svg/SVGFEFloodElement.cpp: Removed unneeded includes.
1264         * svg/SVGFEGaussianBlurElement.cpp: Removed unneeded includes.
1265         (WebCore::SVGFEGaussianBlurElement::isSupportedAttribute): Deleted.
1266         (WebCore::SVGFEGaussianBlurElement::parseAttribute): Don't use isSupportedAttribute.
1267         (WebCore::SVGFEGaussianBlurElement::svgAttributeChanged): Don't use isSupportedAttribute.
1268         * svg/SVGFEGaussianBlurElement.h:
1269         * svg/SVGFEImageElement.cpp: Removed unneeded includes.
1270         (WebCore::SVGFEImageElement::isSupportedAttribute): Deleted.
1271         (WebCore::SVGFEImageElement::parseAttribute): Don't use isSupportedAttribute.
1272         (WebCore::SVGFEImageElement::svgAttributeChanged): Don't use isSupportedAttribute.
1273         * svg/SVGFEImageElement.h:
1274         * svg/SVGFELightElement.cpp: Removed unneeded includes.
1275         (WebCore::SVGFELightElement::isSupportedAttribute): Deleted.
1276         (WebCore::SVGFELightElement::parseAttribute): Don't use isSupportedAttribute.
1277         (WebCore::SVGFELightElement::svgAttributeChanged): Don't use isSupportedAttribute.
1278         * svg/SVGFELightElement.h:
1279         * svg/SVGFEMergeNodeElement.cpp: Removed unneeded includes.
1280         (WebCore::SVGFEMergeNodeElement::isSupportedAttribute): Deleted.
1281         (WebCore::SVGFEMergeNodeElement::parseAttribute): Don't use isSupportedAttribute.
1282         (WebCore::SVGFEMergeNodeElement::svgAttributeChanged): Don't use isSupportedAttribute.
1283         * svg/SVGFEMergeNodeElement.h:
1284         * svg/SVGFEMorphologyElement.cpp: Removed unneeded includes.
1285         (WebCore::SVGFEMorphologyElement::isSupportedAttribute): Deleted.
1286         (WebCore::SVGFEMorphologyElement::parseAttribute): Don't use isSupportedAttribute.
1287         (WebCore::SVGFEMorphologyElement::svgAttributeChanged): Don't use isSupportedAttribute.
1288         * svg/SVGFEMorphologyElement.h:
1289         * svg/SVGFEOffsetElement.cpp: Removed unneeded includes.
1290         (WebCore::SVGFEOffsetElement::isSupportedAttribute): Deleted.
1291         (WebCore::SVGFEOffsetElement::parseAttribute): Don't use isSupportedAttribute.
1292         (WebCore::SVGFEOffsetElement::svgAttributeChanged): Don't use isSupportedAttribute.
1293         * svg/SVGFEOffsetElement.h:
1294         * svg/SVGFESpecularLightingElement.cpp: Removed unneeded includes.
1295         (WebCore::SVGFESpecularLightingElement::isSupportedAttribute): Deleted.
1296         (WebCore::SVGFESpecularLightingElement::parseAttribute): Don't use isSupportedAttribute.
1297         (WebCore::SVGFESpecularLightingElement::svgAttributeChanged): Don't use isSupportedAttribute.
1298         * svg/SVGFESpecularLightingElement.h:
1299         * svg/SVGFETileElement.cpp: Removed unneeded includes.
1300         (WebCore::SVGFETileElement::isSupportedAttribute): Deleted.
1301         (WebCore::SVGFETileElement::parseAttribute): Don't use isSupportedAttribute.
1302         (WebCore::SVGFETileElement::svgAttributeChanged): Don't use isSupportedAttribute.
1303         * svg/SVGFETileElement.h:
1304         * svg/SVGFETurbulenceElement.cpp: Removed unneeded includes.
1305         (WebCore::SVGFETurbulenceElement::isSupportedAttribute): Deleted.
1306         (WebCore::SVGFETurbulenceElement::parseAttribute): Don't use isSupportedAttribute.
1307         (WebCore::SVGFETurbulenceElement::svgAttributeChanged): Don't use isSupportedAttribute.
1308         * svg/SVGFETurbulenceElement.h:
1309         * svg/SVGFilterElement.cpp: Removed unneeded includes.
1310         (WebCore::SVGFilterElement::parseAttribute): Don't use isSupportedAttribute.
1311         * svg/SVGFilterPrimitiveStandardAttributes.cpp: Removed unneeded includes.
1312         (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute): Don't use isSupportedAttribute.
1313         * svg/SVGFilterPrimitiveStandardAttributes.h: Removed isSupportedAttribute and also moved a
1314         couple functions out of the class definition.
1315         * svg/SVGFitToViewBox.cpp: Removed unneeded includes.
1316         * svg/SVGFontFaceElement.cpp: Removed unneeded includes.
1317         * svg/SVGFontFaceUriElement.cpp: Removed unneeded includes.
1318         * svg/SVGForeignObjectElement.cpp: Removed unneeded includes.
1319         (WebCore::SVGForeignObjectElement::parseAttribute): Don't use isSupportedAttribute.
1320         * svg/SVGGElement.cpp: Removed unneeded includes.
1321         (WebCore::SVGGElement::parseAttribute): Don't use isSupportedAttribute.
1322         * svg/SVGGlyphElement.cpp: Removed unneeded includes.
1323         * svg/SVGGlyphRefElement.cpp: Removed unneeded includes.
1324         (WebCore::SVGGlyphRefElement::hasValidGlyphElement): Rewrote to use is<> instead of hasTagName.
1325         (WebCore::SVGGlyphRefElement::parseAttribute): Don't use return value from SVGURIReference::parseAttribute.
1326         * svg/SVGGradientElement.cpp: Removed unneeded includes.
1327         (WebCore::SVGGradientElement::parseAttribute): Don't use isSupportedAttribute.
1328         * svg/SVGGraphicsElement.cpp: Removed unneeded includes.
1329         (WebCore::SVGGraphicsElement::parseAttribute): Don't use isSupportedAttribute.
1330         * svg/SVGImageElement.cpp: Removed unneeded includes.
1331         (WebCore::SVGImageElement::parseAttribute): Don't use isSupportedAttribute.
1332         * svg/SVGLangSpace.cpp: Removed unneeded includes.
1333         (WebCore::SVGLangSpace::parseAttribute): Removed the return value.
1334         * svg/SVGLangSpace.h: Converted functions to static member functions and removed the
1335         return value from parseAttribute.
1336         * svg/SVGLineElement.cpp: Removed unneeded includes.
1337         (WebCore::SVGLineElement::parseAttribute): Don't use isSupportedAttribute.
1338         * svg/SVGLinearGradientElement.cpp: Removed unneeded includes.
1339         (WebCore::SVGLinearGradientElement::parseAttribute): Don't use isSupportedAttribute.
1340         * svg/SVGMPathElement.cpp: Removed unneeded includes.
1341         (WebCore::SVGMPathElement::isSupportedAttribute): Deleted.
1342         (WebCore::SVGMPathElement::parseAttribute): Don't use isSupportedAttribute.
1343         (WebCore::SVGMPathElement::svgAttributeChanged): Don't use isSupportedAttribute.
1344         * svg/SVGMPathElement.h: Removed isSupportedAttribute and made didNotifySubtreeInsertions
1345         private instead of protected.
1346         * svg/SVGMarkerElement.cpp: Removed unneeded includes.
1347         (WebCore::SVGMarkerElement::parseAttribute): Don't use isSupportedAttribute.
1348         * svg/SVGMaskElement.cpp: Removed unneeded includes.
1349         (WebCore::SVGMaskElement::parseAttribute): Don't use isSupportedAttribute.
1350         * svg/SVGPathElement.cpp: Removed unneeded includes.
1351         (WebCore::SVGPathElement::parseAttribute): Don't use isSupportedAttribute.
1352         * svg/SVGPatternElement.cpp: Removed unneeded includes.
1353         (WebCore::SVGPatternElement::parseAttribute): Don't use isSupportedAttribute.
1354         * svg/SVGPolyElement.cpp: Removed unneeded includes.
1355         (WebCore::SVGPolyElement::isSupportedAttribute): Deleted.
1356         (WebCore::SVGPolyElement::parseAttribute): Don't use isSupportedAttribute.
1357         (WebCore::SVGPolyElement::svgAttributeChanged): Don't use isSupportedAttribute.
1358         * svg/SVGPolyElement.h:
1359         * svg/SVGRadialGradientElement.cpp: Removed unneeded includes.
1360         (WebCore::SVGRadialGradientElement::parseAttribute): Don't use isSupportedAttribute.
1361         * svg/SVGRectElement.cpp: Removed unneeded includes.
1362         (WebCore::SVGRectElement::isSupportedAttribute): Deleted.
1363         (WebCore::SVGRectElement::parseAttribute): Don't use isSupportedAttribute.
1364         (WebCore::SVGRectElement::svgAttributeChanged): Don't use isSupportedAttribute.
1365         * svg/SVGRectElement.h:
1366         * svg/SVGSVGElement.cpp: Removed unneeded includes.
1367         (WebCore::SVGSVGElement::parseAttribute): Don't use isSupportedAttribute.
1368         * svg/SVGScriptElement.cpp: Removed unneeded includes.
1369         * svg/SVGStopElement.cpp: Removed unneeded includes.
1370         (WebCore::SVGStopElement::isSupportedAttribute): Deleted.
1371         (WebCore::SVGStopElement::parseAttribute): Don't use isSupportedAttribute.
1372         (WebCore::SVGStopElement::svgAttributeChanged): Don't use isSupportedAttribute.
1373         * svg/SVGStopElement.h: Removed isSupportedAttribute.
1374         * svg/SVGStyleElement.cpp: Removed unneeded includes.
1375         (WebCore::SVGStyleElement::isSupportedAttribute): Deleted.
1376         (WebCore::SVGStyleElement::parseAttribute): Don't use isSupportedAttribute.
1377         * svg/SVGStyleElement.h: Removed isSupportedAttribute.
1378         * svg/SVGSymbolElement.cpp: Removed unneeded includes.
1379         (WebCore::SVGSymbolElement::isSupportedAttribute): Deleted.
1380         (WebCore::SVGSymbolElement::parseAttribute): Don't use isSupportedAttribute.
1381         (WebCore::SVGSymbolElement::svgAttributeChanged): Don't use isSupportedAttribute.
1382         * svg/SVGSymbolElement.h: Removed isSupportedAttribute.
1383         * svg/SVGTRefElement.cpp: Removed unneeded includes.
1384         (WebCore::SVGTRefElement::isSupportedAttribute): Deleted.
1385         (WebCore::SVGTRefElement::parseAttribute): Don't use isSupportedAttribute.
1386         (WebCore::SVGTRefElement::svgAttributeChanged): Don't use isSupportedAttribute.
1387         * svg/SVGTRefElement.h: Removed isSupportedAttribute and made didNotifySubtreeInsertions
1388         private instead of protected.
1389         * svg/SVGTests.cpp: Removed unneeded includes.
1390         (WebCore::SVGTests::parseAttribute): Removed return value.
1391         * svg/SVGTests.h: Removed return value of parseAttribute.
1392         * svg/SVGTextContentElement.cpp: Removed unneeded includes.
1393         (WebCore::SVGTextContentElement::collectStyleForPresentationAttribute): Don't use
1394         isSupportedAttribute. Also removed global to optimize comparing attribute value against
1395         the string "preserve".
1396         (WebCore::SVGTextContentElement::parseAttribute): Don't use isSupportedAttribute.
1397         (WebCore::SVGTextContentElement::svgAttributeChanged): Don't use isSupportedAttribute.
1398         * svg/SVGTextContentElement.h: Made isSupportedAttribute private instead of protected.
1399         * svg/SVGTextElement.cpp: Removed unneeded includes.
1400         * svg/SVGTextPathElement.cpp: Removed unneeded includes.
1401         (WebCore::SVGTextPathElement::parseAttribute): Don't use isSupportedAttribute.
1402         * svg/SVGTextPositioningElement.cpp: Removed unneeded includes.
1403         (WebCore::SVGTextPositioningElement::isSupportedAttribute): Deleted.
1404         (WebCore::SVGTextPositioningElement::parseAttribute): Don't use isSupportedAttribute.
1405         (WebCore::SVGTextPositioningElement::svgAttributeChanged): Don't use isSupportedAttribute.
1406         * svg/SVGTextPositioningElement.h: Removed isSupportedAttribute and made some functions
1407         private insetad of protected.
1408         * svg/SVGURIReference.cpp: Removed unneeded includes.
1409         (WebCore::SVGURIReference::parseAttribute): Don't use isSupportedAttribute.
1410         * svg/SVGURIReference.h:
1411         (WebCore::SVGURIReference::isExternalURIReference):
1412         * svg/SVGUseElement.cpp: Removed unneeded includes.
1413         (WebCore::SVGUseElement::parseAttribute): Don't use isSupportedAttribute.
1414         * svg/SVGViewElement.h: Removed isSupportedAttribute.
1415         * svg/animation/SVGSMILElement.cpp: Removed unneeded includes.
1416
1417 2015-03-29  Darin Adler  <darin@apple.com>
1418
1419         Remove unneeded includes of "Attribute.h"
1420         https://bugs.webkit.org/show_bug.cgi?id=143195
1421
1422         Reviewed by Antti Koivisto.
1423
1424         * css/StyleResolver.cpp:
1425         * html/HTMLAnchorElement.cpp:
1426         * html/HTMLAreaElement.cpp:
1427         * html/HTMLBRElement.cpp:
1428         * html/HTMLBaseElement.cpp:
1429         * html/HTMLBodyElement.cpp:
1430         * html/HTMLButtonElement.cpp:
1431         * html/HTMLCanvasElement.cpp:
1432         * html/HTMLDivElement.cpp:
1433         * html/HTMLElement.cpp:
1434         * html/HTMLEmbedElement.cpp:
1435         * html/HTMLFontElement.cpp:
1436         * html/HTMLFormControlElement.cpp:
1437         * html/HTMLFormElement.cpp:
1438         * html/HTMLFrameElement.cpp:
1439         * html/HTMLFrameElementBase.cpp:
1440         * html/HTMLFrameSetElement.cpp:
1441         * html/HTMLHRElement.cpp:
1442         * html/HTMLIFrameElement.cpp:
1443         * html/HTMLImageElement.cpp:
1444         * html/HTMLOListElement.cpp:
1445         * html/HTMLOptionElement.cpp:
1446         * html/HTMLParagraphElement.cpp:
1447         * html/HTMLParamElement.cpp:
1448         * html/HTMLPlugInElement.cpp:
1449         * html/HTMLPreElement.cpp:
1450         * html/HTMLProgressElement.cpp:
1451         * html/HTMLScriptElement.cpp:
1452         * html/HTMLSelectElement.cpp:
1453         * html/HTMLStyleElement.cpp:
1454         * html/HTMLTableCaptionElement.cpp:
1455         * html/HTMLTableCellElement.cpp:
1456         * html/HTMLTableColElement.cpp:
1457         * html/HTMLTableElement.cpp:
1458         * html/HTMLTablePartElement.cpp:
1459         * html/HTMLTextAreaElement.cpp:
1460         * html/HTMLTextFormControlElement.cpp:
1461         * html/HTMLUListElement.cpp:
1462         * html/HTMLVideoElement.cpp:
1463         * html/parser/HTMLScriptRunner.cpp:
1464         * inspector/InspectorNodeFinder.cpp:
1465         Removed includes of "Attribute.h".
1466
1467 2015-03-28  Eric Carlson  <eric.carlson@apple.com>
1468
1469         [Mac] Update for output device API change
1470         https://bugs.webkit.org/show_bug.cgi?id=143187
1471
1472         Reviewed by Zalan Bujtas.
1473
1474         The API used for output device is being deprecated, update to the replacement.
1475
1476         * WebCore.xcodeproj/project.pbxproj: Add SPI headers.
1477
1478         * platform/graphics/MediaPlaybackTarget.h:
1479         (WebCore::MediaPlaybackTarget::MediaPlaybackTarget): Update for API change.
1480         (WebCore::MediaPlaybackTarget::setDevicePickerContext):
1481         (WebCore::MediaPlaybackTarget::devicePickerContext):
1482
1483         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
1484         (WebCore::MediaPlaybackTarget::encode):
1485         (WebCore::MediaPlaybackTarget::decode):
1486
1487         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
1488         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
1489         (WebCore::MediaPlaybackTargetPickerMac::MediaPlaybackTargetPickerMac):
1490         (WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac):
1491         (WebCore::MediaPlaybackTargetPickerMac::outputeDeviceAvailabilityChangedTimerFired):
1492         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
1493         (WebCore::MediaPlaybackTargetPickerMac::currentDeviceDidChange):
1494         (WebCore::MediaPlaybackTargetPickerMac::stopMonitoringPlaybackTargets):
1495         (-[WebAVOutputDeviceMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]):
1496         (-[WebAVOutputDevicePickerMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]): Deleted.
1497
1498         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1499         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1500         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
1501         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
1502         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
1503         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1504
1505         * platform/spi/cocoa/AVKitSPI.h: Copied from Source/WebCore/platform/spi/ios/AVKitSPI.h. Moved
1506             from ios directory, added Mac includes and prototypes.
1507         * platform/spi/ios/AVKitSPI.h: Removed.
1508
1509         * platform/spi/mac/AVFoundationSPI.h: Added.
1510
1511 2015-03-28  Simon Fraser  <simon.fraser@apple.com>
1512
1513         Optimize RenderLayer::intersectsDamageRect() slightly
1514         https://bugs.webkit.org/show_bug.cgi?id=143186
1515
1516         Reviewed by Zalan Bujtas.
1517
1518         We can early return from RenderLayer::intersectsDamageRect() if the
1519         damageRect is empty, since nothing will intersect with the empty rect.
1520         
1521         Slight performance gain when scrolling overflow-scroll with lots of nested,
1522         clipping layers.
1523
1524         * rendering/RenderLayer.cpp:
1525         (WebCore::RenderLayer::calculateClipRects):
1526
1527 2015-03-28  Anders Carlsson  <andersca@apple.com>
1528
1529         Remove an unused SPI method from WebKitLegacy
1530         https://bugs.webkit.org/show_bug.cgi?id=143185
1531
1532         Reviewed by Sam Weinig.
1533
1534         * loader/appcache/ApplicationCacheStorage.cpp:
1535         (WebCore::ApplicationCacheStorage::storeCopyOfCache): Deleted.
1536         * loader/appcache/ApplicationCacheStorage.h:
1537
1538 2015-03-28  Joonghun Park  <jh718.park@samsung.com>
1539
1540         nullptr cleanup in InlineFooBox classes
1541         https://bugs.webkit.org/show_bug.cgi?id=143178
1542
1543         Reviewed by Csaba Osztrogonác.
1544
1545         No new tests, no behavior changes
1546
1547         Replace 0 with nullptr in InlineFooBox classes.
1548
1549         * rendering/InlineBox.cpp:
1550         (WebCore::InlineBox::prevLeafChildIgnoringLineBreak):
1551         * rendering/InlineFlowBox.cpp:
1552         (WebCore::InlineFlowBox::removeChild):
1553         (WebCore::InlineFlowBox::deleteLine):
1554         (WebCore::InlineFlowBox::placeBoxesInInlineDirection):
1555         (WebCore::InlineFlowBox::addTextBoxVisualOverflow):
1556         * rendering/InlineFlowBox.h:
1557         (WebCore::InlineFlowBox::InlineFlowBox):
1558         * rendering/InlineTextBox.h:
1559         (WebCore::InlineTextBox::InlineTextBox):
1560         * rendering/RootInlineBox.cpp:
1561         (WebCore::RootInlineBox::getLogicalStartBoxWithNode):
1562         (WebCore::RootInlineBox::getLogicalEndBoxWithNode):
1563         * rendering/RootInlineBox.h:
1564         * rendering/svg/SVGInlineTextBox.cpp:
1565         (WebCore::SVGInlineTextBox::SVGInlineTextBox):
1566         (WebCore::SVGInlineTextBox::releasePaintingResource):
1567         (WebCore::SVGInlineTextBox::restoreGraphicsContextAfterTextPainting):
1568         * rendering/svg/SVGRootInlineBox.cpp:
1569         (WebCore::SVGRootInlineBox::closestLeafChildForPosition):
1570         (WebCore::findFirstAndLastAttributesInVector):
1571         * rendering/svg/SVGRootInlineBox.h:
1572
1573 2015-03-27  Simon Fraser  <simon.fraser@apple.com>
1574
1575         More modern loops in RenderLayer.cpp
1576         https://bugs.webkit.org/show_bug.cgi?id=143175
1577
1578         Reviewed by Ryosuke Niwa.
1579
1580         Use modern loops in more places in RenderLayer.app.
1581
1582         * rendering/RenderLayer.cpp:
1583         (WebCore::RenderLayer::update3DTransformedDescendantStatus):
1584         (WebCore::RenderLayer::paint):
1585         (WebCore::performOverlapTests):
1586         (WebCore::RenderLayer::paintFixedLayersInNamedFlows):
1587         (WebCore::RenderLayer::paintList):
1588         (WebCore::RenderLayer::collectFragments):
1589         (WebCore::RenderLayer::updatePaintingInfoForFragments):
1590         (WebCore::RenderLayer::paintTransformedLayerIntoFragments):
1591         (WebCore::RenderLayer::calculateClipRects):
1592
1593 2015-03-27  Simon Fraser  <simon.fraser@apple.com>
1594
1595         nullptr cleanup in RenderLayer
1596         https://bugs.webkit.org/show_bug.cgi?id=143174
1597
1598         Reviewed by Ryosuke Niwa.
1599
1600         Replace 0 with nullptr in RenderLayer.cpp.
1601
1602         * rendering/RenderLayer.cpp:
1603         (WebCore::RenderLayer::filterRenderer):
1604         (WebCore::RenderLayer::updateLayerPositionsAfterLayout):
1605         (WebCore::RenderLayer::updateLayerPositionsAfterOverflowScroll):
1606         (WebCore::RenderLayer::positionNewlyCreatedOverflowControls):
1607         (WebCore::RenderLayer::enclosingOverflowClipLayer):
1608         (WebCore::RenderLayer::enclosingCompositingLayer):
1609         (WebCore::RenderLayer::enclosingCompositingLayerForRepaint):
1610         (WebCore::RenderLayer::enclosingFilterLayer):
1611         (WebCore::RenderLayer::enclosingFilterRepaintLayer):
1612         (WebCore::RenderLayer::clippingRootForPainting):
1613         (WebCore::RenderLayer::transparentPaintingAncestor):
1614         (WebCore::transparencyClipBox):
1615         (WebCore::RenderLayer::removeChild):
1616         (WebCore::RenderLayer::removeOnlyThisLayer):
1617         (WebCore::RenderLayer::insertOnlyThisLayer):
1618         (WebCore::accumulateOffsetTowardsAncestor):
1619         (WebCore::RenderLayer::enclosingScrollableArea):
1620         (WebCore::RenderLayer::enclosingPaginationLayerInSubtree):
1621         (WebCore::RenderLayer::enclosingElement):
1622         (WebCore::RenderLayer::enclosingFlowThreadAncestor):
1623         (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
1624         (WebCore::RenderLayer::hitTestLayer):
1625         (WebCore::RenderLayer::hitTestTransformedLayerInFragments):
1626         (WebCore::RenderLayer::hitTestLayerByApplyingTransform):
1627         (WebCore::RenderLayer::hitTestList):
1628         (WebCore::RenderLayer::updateClipRects):
1629         (WebCore::RenderLayer::clipRects):
1630         (WebCore::RenderLayer::calculateClipRects):
1631
1632 2015-03-27  Gwang Yoon Hwang  <yoon@igalia.com>
1633
1634         [TexMap] Seperate BitmapTexture related classes implementations from TextureMapper
1635         https://bugs.webkit.org/show_bug.cgi?id=142386
1636
1637         Reviewed by Žan Doberšek.
1638
1639         TextureMapper and TextureMapperGL are bloated and tightly coupled with
1640         BitmapTexture. We should move these classes to seperated file of their own.
1641         Also, this patch removes friend relationship from TextureMapperGL and  its
1642         subsidiary classes.
1643
1644         The main purpose of this refactoring is to expose BitmapTexturePool to
1645         renderers of platformlayers like Video and Canvas. By doing this, each
1646         renderer can acquire textures from the global texture pool to paint
1647         their contents directly.
1648
1649         No new tests needed.
1650
1651         * PlatformEfl.cmake:
1652         * PlatformGTK.cmake:
1653         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1654         Include BitmapTextureGL and BitmapTexturePool explicitly
1655
1656         * platform/graphics/texmap/BitmapTexture.cpp: Added.
1657         * platform/graphics/texmap/BitmapTexture.h: Added.
1658         (WebCore::BitmapTexture::updateContents):
1659         Exclude BitmapTexture class from TextureMapper
1660
1661         * platform/graphics/texmap/BitmapTextureGL.cpp: Added.
1662         * platform/graphics/texmap/BitmapTextureGL.h: Added.
1663         Exclude BitmapTextureGL class from TextureMapperGL
1664         (WebCore::BitmapTextureGL::clipStack): Added.
1665         Add the getter for clipStack for TextureMapperGL
1666         (WebCore::BitmapTextureGL::Bind): Deleted.
1667         (WebCore::BitmapTextureGL::BindAsSurface): Added.
1668         Bind used TextureMapperGL's internal data directly to compute projection matrix as a friend class,
1669         However, TextureMapperGL can compute projection matrix itself after binding job, so this
1670         friend ship is not needed. Also, this patch renames Bind to BindAsSurface to remove ambiguity.
1671
1672         * platform/graphics/texmap/BitmapTextureImageBuffer.cpp: Added.
1673         * platform/graphics/texmap/BitmapTextureImageBuffer.h: Added.
1674         Exclude BitmapTextureImageBuffer class from TextureMapperImageBuffer
1675
1676         * platform/graphics/texmap/BitmapTexturePool.cpp: Added.
1677         * platform/graphics/texmap/BitmapTexturePool.h: Added.
1678         Exclude BitmapTexturePool class from TextureMapperGL
1679         (WebCore::BitmapTexturePool::acquireTexture):
1680         Modified to use passed GraphicsContext3D instead of TextureMapperGL to remove redundant coupling
1681
1682         * platform/graphics/texmap/TextureMapper.cpp:
1683         * platform/graphics/texmap/TextureMapper.h:
1684         Remove BitmapTexturePool and BitmapTexture from its implementation.
1685
1686         * platform/graphics/texmap/TextureMapperGL.cpp:
1687         * platform/graphics/texmap/TextureMapperGL.h:
1688         Remove BitmapTextureGL from its implementation.
1689         (WebCore::TextureMapperGL::TextureMapperGL):
1690         (WebCore::TextureMapperGL::clipStack):
1691         (WebCore::TextureMapperGL::bindSurface):
1692         (WebCore::TextureMapperGL::currentSurface):
1693         Add a getter of the current surface for filtering operation in BitmapTextureGL.
1694         It would be clear to move filtering operation from BitmapTextureGL to TextureMapperGL later.
1695
1696         (WebCore::TextureMapperGL::ClipStack):
1697         Move inner class declaration to public.
1698
1699         * platform/graphics/texmap/TextureMapperImageBuffer.cpp:
1700         * platform/graphics/texmap/TextureMapperImageBuffer.h:
1701         Remove BitmapTextureImageBuffer from its implementation.
1702
1703 2015-03-27  Tim Horton  <timothy_horton@apple.com>
1704
1705         WebProcess started by editable WKWebView spends 15% of its initialization time loading DataDetectors
1706         https://bugs.webkit.org/show_bug.cgi?id=143142
1707         <rdar://problem/20324495>
1708
1709         Reviewed by Anders Carlsson.
1710
1711         Calling DataDetectorsLibrary() is expensive; we should avoid doing it
1712         until actually necessary. When loading a page that makes a caret selection,
1713         ServicesOverlayController was calling DataDetectorsLibrary() (ignoring the fact
1714         that a caret selection can't have any services associated with it) to avoid
1715         crashing on systems where DataDetectors is not available. Instead, we should
1716         first check if there's anything to do, and then check for the existence
1717         of DataDetectors.
1718
1719         * page/mac/ServicesOverlayController.mm:
1720         (WebCore::ServicesOverlayController::buildPhoneNumberHighlights):
1721         Build the list of phone number ranges, and bail (clearing the potential highlights)
1722         if it is empty, before calling DataDetectorsLibrary().
1723
1724         (WebCore::ServicesOverlayController::buildSelectionHighlight):
1725         Check the list of selection rects, and bail (clearing the potential highlights)
1726         if it is empty, before calling DataDetectorsLibrary().
1727
1728 2015-03-27  Jer Noble  <jer.noble@apple.com>
1729
1730         [Mac] Safari fails to fire page "load" event with video[preload=none]
1731         https://bugs.webkit.org/show_bug.cgi?id=143147
1732
1733         Reviewed by Simon Fraser.
1734
1735         Test: media/video-page-load-preload-none.html
1736
1737         When told to load() when preload == None, set the networkState to Idle.
1738         This causes HTMLMediaElement to set the shouldDelayLoadEvent flag to
1739         false, and allows the page's 'load' event to fire.
1740
1741         Drive-by fix: add setNetworkState() and setReadyState() methods to
1742         MediaPlayerPrivateAVFoundation, reducing a bunch of code duplication.
1743
1744         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1745         (WebCore::MediaPlayerPrivateAVFoundation::load):
1746         (WebCore::MediaPlayerPrivateAVFoundation::setNetworkState):
1747         (WebCore::MediaPlayerPrivateAVFoundation::setReadyState):
1748         (WebCore::MediaPlayerPrivateAVFoundation::updateStates):
1749         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1750
1751 2015-03-27  Alexey Proskuryakov  <ap@apple.com>
1752
1753         Calling crypto.webkitSubtle.generateKey causes page memory to never be released
1754         https://bugs.webkit.org/show_bug.cgi?id=143151
1755         rdar://problem/18940687
1756
1757         Reviewed by Tim Horton.
1758
1759         * crypto/mac/CryptoKeyRSAMac.cpp: (WebCore::CryptoKeyRSA::generatePair): Don't.
1760
1761 2015-03-27  Brent Fulgham  <bfulgham@apple.com>
1762
1763         Null dereference in InbandMetadataTextTrack handling
1764         https://bugs.webkit.org/show_bug.cgi?id=143144
1765         <rdar://problem/18983250>
1766
1767         Reviewed by Eric Carlson.
1768
1769         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
1770         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): Check for null return value from
1771         'client()', just like we do in all other methods.
1772
1773 2015-03-27  Oliver Hunt  <oliver@apple.com>
1774
1775         Forward additional CFNetwork ATS information to child processes
1776         https://bugs.webkit.org/show_bug.cgi?id=143136
1777
1778         Reviewed by Anders Carlsson.
1779
1780         Declare SPI.
1781
1782         * platform/spi/cf/CFNetworkSPI.h:
1783
1784 2015-03-27  Chris Dumez  <cdumez@apple.com>
1785
1786         [WK2][NetworkCache] We only cache responses with status codes that are cacheable by default
1787         https://bugs.webkit.org/show_bug.cgi?id=143125
1788         <rdar://problem/20321172>
1789
1790         Reviewed by Antti Koivisto.
1791
1792         Export a couple of extra symbols.
1793
1794         * platform/network/ResourceResponseBase.h:
1795
1796 2015-03-27  Jer Noble  <jer.noble@apple.com>
1797
1798         HTMLMediaElement will fire 'seeked' before seek completes, leading to currentTime discontinuities.
1799         https://bugs.webkit.org/show_bug.cgi?id=143132
1800
1801         Reviewed by Eric Carlson.
1802
1803         When seeking, if the ready state rises to >= HAVE_CURRENT_DATA, we will fire the 'seeked'
1804         event and continue playback. However, if a media engine updates the ready state before its
1805         seek operation actually completes, the currentTime it returns may still be the time before
1806         the seek.
1807
1808         Wait until both the ready state rises to HAVE_CURRENT_DATA and m_player->seeking() returns
1809         false before firing the 'seeked' event.
1810
1811         * html/HTMLMediaElement.cpp:
1812         (WebCore::HTMLMediaElement::parseAttribute):
1813
1814 2015-03-26  Geoffrey Garen  <ggaren@apple.com>
1815
1816         Make some more objects use FastMalloc
1817         https://bugs.webkit.org/show_bug.cgi?id=143122
1818
1819         Reviewed by Csaba Osztrogonác.
1820
1821         * Modules/geolocation/GeolocationController.h:
1822         * Modules/geolocation/NavigatorGeolocation.h:
1823         * Modules/indexeddb/DOMWindowIndexedDatabase.h:
1824         * Modules/notifications/NotificationController.h:
1825         * Modules/webdatabase/DatabaseServer.h:
1826         * css/CSSFontFaceSource.h:
1827         * html/HTMLMediaSession.h:
1828         * inspector/InspectorIndexedDBAgent.h:
1829         * inspector/InspectorReplayAgent.h:
1830         * page/CaptionUserPreferencesMediaAF.h:
1831         * page/PageConsoleClient.h:
1832         * page/PageDebuggable.h:
1833         * page/animation/CSSPropertyAnimation.cpp:
1834         * page/mac/ServicesOverlayController.h:
1835         * platform/RemoteCommandListener.h:
1836         * platform/Timer.h:
1837         * platform/audio/MediaSessionManager.h:
1838         * platform/mac/SystemSleepListenerMac.h:
1839         * platform/mac/ThemeMac.h:
1840         * rendering/svg/RenderSVGResourceSolidColor.h:
1841         * replay/ReplayController.h:
1842
1843 2015-03-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
1844
1845         FEMorphology::platformApplyGeneric() should bail out if the radius is less than or equal to zero.
1846         https://bugs.webkit.org/show_bug.cgi?id=142885.
1847
1848         Reviewed by Dean Jackson.
1849
1850         FEMorphology class implementation code clean up.
1851         
1852         Tests: svg/filters/feMorphology-radius-cases.svg
1853
1854         * platform/graphics/filters/FEMorphology.cpp:
1855         (WebCore::shouldSupersedeExtremum): Reuse code instead of repeating it and
1856         use < and > instead of =< and >=.
1857         
1858         (WebCore::pixelArrayIndex): Returns the array index of a pixel in an image
1859         buffer, given: position(x, y), image width and the color channel.
1860         
1861         (WebCore::columnExtremum): Returns the extremum of a column of pixels.
1862         
1863         (WebCore::kernelExtremum): Returns the extremum of a filter kernel.
1864         
1865         (WebCore::FEMorphology::platformApplyGeneric): Apply some code clean-up.
1866         The kernel size should be equal to radius of the filter. The extra pixel
1867         was causing the resulted image to be asymmetric in some cases.
1868         
1869         (WebCore::FEMorphology::platformApplyDegenerate):
1870         (WebCore::FEMorphology::platformApplySoftware): After applying scaling, we
1871         still need to check the resulted radius is negative (overflow case) or less
1872         than one (zero radius case) and treat these cases differently.
1873         
1874         (WebCore::FEMorphology::morphologyOperator): Deleted.
1875         (WebCore::FEMorphology::radiusX): Deleted.
1876         (WebCore::FEMorphology::radiusY): Deleted.
1877         * platform/graphics/filters/FEMorphology.h:
1878         (WebCore::FEMorphology::morphologyOperator):
1879         (WebCore::FEMorphology::radiusX):
1880         (WebCore::FEMorphology::radiusY):
1881         Move a single line functions from the source file to the header file.
1882
1883 2015-03-27  Antti Koivisto  <antti@apple.com>
1884
1885         Move CacheValidation to platform
1886         https://bugs.webkit.org/show_bug.cgi?id=143133
1887
1888         Reviewed by Chris Dumez.
1889
1890         It deals with platform types only and is currently violating layering.
1891
1892         * WebCore.xcodeproj/project.pbxproj:
1893         * loader/cache/CacheValidation.cpp: Removed.
1894         * loader/cache/CacheValidation.h: Removed.
1895         * platform/network/CacheValidation.cpp: Copied from Source/WebCore/loader/cache/CacheValidation.cpp.
1896         * platform/network/CacheValidation.h: Copied from Source/WebCore/loader/cache/CacheValidation.h.
1897
1898 2015-03-27  Commit Queue  <commit-queue@webkit.org>
1899
1900         Unreviewed, rolling out r177896.
1901         https://bugs.webkit.org/show_bug.cgi?id=142978
1902
1903         Loading libgstclutter.so in-process hangs web process
1904         (Requested by mcatanzaro on #webkit).
1905
1906         Reverted changeset:
1907
1908         "[GStreamer] Disable gst-plugin-scanner if seccomp filters are
1909         enabled"
1910         https://bugs.webkit.org/show_bug.cgi?id=140069
1911         http://trac.webkit.org/changeset/177896
1912
1913 2015-03-26  Antti Koivisto  <antti@apple.com>
1914
1915         Respect cache-control directives in request
1916         https://bugs.webkit.org/show_bug.cgi?id=143121
1917         rdar://problem/19714040
1918
1919         Reviewed by Chris Dumez.
1920
1921         Test: http/tests/cache/disk-cache/disk-cache-request-headers.html
1922
1923         * loader/cache/CacheValidation.cpp:
1924         (WebCore::isCacheHeaderSeparator):
1925         (WebCore::isControlCharacter):
1926         (WebCore::trimToNextSeparator):
1927         (WebCore::parseCacheHeader):
1928         (WebCore::parseCacheControlDirectives):
1929
1930             Factor Cache-control parsing here so it can be used for both requests and responses.
1931
1932         * loader/cache/CacheValidation.h:
1933         * platform/network/ResourceRequestBase.h:
1934         * platform/network/ResourceResponseBase.cpp:
1935         (WebCore::ResourceResponseBase::ResourceResponseBase):
1936         (WebCore::ResourceResponseBase::parseCacheControlDirectives):
1937         (WebCore::ResourceResponseBase::cacheControlContainsNoCache):
1938         (WebCore::ResourceResponseBase::cacheControlContainsNoStore):
1939         (WebCore::ResourceResponseBase::cacheControlContainsMustRevalidate):
1940         (WebCore::ResourceResponseBase::cacheControlMaxAge):
1941         (WebCore::isCacheHeaderSeparator): Deleted.
1942         (WebCore::isControlCharacter): Deleted.
1943         (WebCore::trimToNextSeparator): Deleted.
1944         (WebCore::parseCacheHeader): Deleted.
1945         * platform/network/ResourceResponseBase.h:
1946
1947 2015-03-27  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
1948
1949         [GStreamer] share GL context in pipeline, part 2
1950         https://bugs.webkit.org/show_bug.cgi?id=143049
1951
1952         Reviewed by Carlos Garcia Campos.
1953
1954         This patch, instead of cluttering the GstGL attributes creation in
1955         ::handleSyncMessage(), creates a new method ::ensureGstGLContext(),
1956         where those attributes are defined. This method is guarded by
1957         USE(GSTREAMER_GL)
1958
1959         ::handlSyncMessage() shall return nothing, according to GStreamer
1960         documentation, not a boolean.
1961
1962         The GstGL attributes are now GRefPtr<> to avoid memory leaks.
1963
1964         The GstGLAPI and GstGLPlatform are now set given by the pre-processor
1965         directives, and the code in ::ensureGstGLContext() is simpler.
1966
1967         No new tests because this is platform specific and it depends in the
1968         run-time availability and configurations of GstGL elements.
1969
1970         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1971         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
1972         Don't initialise the GstGL attributes since are GRefPtr<>
1973         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): Changed the
1974         signature to use void instead of gboolean.
1975         (WebCore::MediaPlayerPrivateGStreamer::ensureGstGLContext): New method.
1976         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1977
1978 2015-03-26  Jeremy Jones  <jeremyj@apple.com>
1979
1980         Optimized Fullscreen fails to cleanup because of no longer necessary release of m_playerController in exitFullscreen()
1981         https://bugs.webkit.org/show_bug.cgi?id=143120
1982
1983         Reviewed by Eric Carlson.
1984
1985         We used to release m_playerController in WebVideoFullscreenInterfaceAVKit::exitFullscreen() in order to make sure 
1986         media state was reset. This is no longer necessary as we now have a way the model can explicitly request resetting the
1987         media state via resetMediaState(). m_playerController is already released in 
1988         WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal(). Releasing it prematurely can actually prevent the exit
1989         fullscreen process from completing successfully.
1990
1991         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1992         (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
1993
1994 2015-03-26  Zalan Bujtas  <zalan@apple.com>
1995
1996         Inline continuation code should not take anonymous containing wrapper granted.
1997         https://bugs.webkit.org/show_bug.cgi?id=133312
1998
1999         Reviewed by Dave Hyatt.
2000
2001         It's wrong to assume that when RenderInline is part of an inline continuation, its containing block
2002         is an anonymous wrapper and its sibling might be a block level renderer.
2003         When the inline continuation is no longer needed, for example when the block level renderer that initiated the continuation
2004         is detached from the render tree, the inline renderes still continue to form continuation.(however they no longer require
2005         anonymous wrappers)
2006
2007         Test: fast/inline/crash-when-position-property-is-changed-and-no-longer-in-continuation.html
2008
2009         * rendering/RenderInline.cpp:
2010         (WebCore::updateStyleOfAnonymousBlockContinuations):
2011         (WebCore::RenderInline::styleDidChange):
2012
2013 2015-03-26  Tim Horton  <timothy_horton@apple.com>
2014
2015         REGRESSION (r181358 and r181507): Lots of sites think that we support touch events on OS X
2016         https://bugs.webkit.org/show_bug.cgi?id=142888
2017         <rdar://problem/20227304>
2018
2019         Reviewed by Beth Dakin.
2020
2021         * dom/Document.idl:
2022         * dom/Element.idl:
2023         * html/HTMLBodyElement.idl:
2024         * html/HTMLFrameSetElement.idl:
2025         * page/DOMWindow.idl:
2026         Re-conditionalize a lot of event listeners; sites test ("ontouchstart" in window), which
2027         is not covered by NotEnumerable, and so r181358 and r181507 broke a bunch of sites
2028         (apple.com, blaze.com, anything using nicescroll.js, etc.) by causing them to think
2029         that (Mac) Safari was touch-enabled.
2030
2031 2015-03-26  Geoffrey Garen  <ggaren@apple.com>
2032
2033         "lineNo" does not match WebKit coding style guidelines
2034         https://bugs.webkit.org/show_bug.cgi?id=143119
2035
2036         Reviewed by Michael Saboff.
2037
2038         We can afford to use whole words.
2039
2040         * bindings/js/JSLazyEventListener.cpp:
2041         (WebCore::JSLazyEventListener::initializeJSFunction):
2042         * bindings/js/JSMainThreadExecStateInstrumentation.h:
2043         (WebCore::JSMainThreadExecState::instrumentFunctionCall):
2044         * inspector/InspectorDOMAgent.cpp:
2045         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
2046         * testing/Internals.cpp:
2047         (WebCore::Internals::parserMetaData):
2048
2049 2015-03-26  Roger Fong  <roger_fong@apple.com>
2050
2051         Apply blur effect to media control background.
2052         https://bugs.webkit.org/show_bug.cgi?id=143116.
2053         <rdar://problem/20316964>.
2054
2055         Reviewed by Brent Fulgham.
2056
2057         There are still a few issues, like the borders of the controls being blurred with black,
2058         and the volume slider background not showing the blur effect. Will fix those separately.
2059
2060         Add CSS for new divs to create blur effect using back drop filters and blend modes.
2061         * Modules/mediacontrols/mediaControlsApple.css:
2062         (audio::-webkit-media-controls-panel):
2063         (audio::-webkit-media-controls-panel-tint):
2064         (audio::-webkit-media-controls-panel-background):
2065         (audio::-webkit-media-controls-panel .volume-box):
2066         (audio::-webkit-media-controls-volume-slider-container-background):
2067         (audio::-webkit-media-controls-volume-slider-container-tint):
2068         (audio::-webkit-media-controls-toggle-closed-captions-button): Adjust fill.
2069         (audio::-webkit-media-controls-fullscreen-button): Adjust fill.
2070         (audio::-webkit-media-controls-fullscreen-button.exit): Adjust fill.
2071         (video:-webkit-full-screen::-webkit-media-controls-panel):
2072         (audio:-webkit-full-screen::-webkit-media-controls-panel-tint):
2073         (audio:-webkit-full-screen::-webkit-media-controls-panel-background):
2074         (video:-webkit-full-screen::-webkit-media-controls-panel .volume-box):
2075         (video:-webkit-full-screen::-webkit-media-controls-play-button):
2076         (video:-webkit-full-screen::-webkit-media-controls-seek-back-button):
2077         (video:-webkit-full-screen::-webkit-media-controls-seek-forward-button):
2078         (video:-webkit-full-screen::-webkit-media-controls-timeline-container):
2079         (video:-webkit-full-screen::-webkit-media-controls-status-display):
2080         (audio::-webkit-media-controls-panel .volume-box:active): Deleted.
2081         * Modules/mediacontrols/mediaControlsApple.js:
2082         (Controller.prototype.createControls):
2083         (Controller.prototype.configureInlineControls): Add new divs for blurred background effect.
2084         (Controller.prototype.configureFullScreenControls): Ditto.
2085         (Controller.prototype.handlePanelMouseDown): The tint div is now in front.
2086         (Controller.prototype.drawTimelineBackground): Adjust colors to make border look better with new background.
2087         (Controller.prototype.drawVolumeBackground): Ditto.
2088
2089 2015-03-26  Geoffrey Garen  <ggaren@apple.com>
2090
2091         Assertion firing in JavaScriptCore/parser/parser.h for statesman.com site
2092         https://bugs.webkit.org/show_bug.cgi?id=142974
2093
2094         Reviewed by Joseph Pecoraro.
2095
2096         * bindings/js/JSLazyEventListener.cpp:
2097         (WebCore::JSLazyEventListener::initializeJSFunction): Use the new override
2098         line number API to guarantee that errors will map to the .html file locations
2099         that we like.
2100
2101         * bindings/js/ScriptController.cpp:
2102         (WebCore::ScriptController::eventHandlerPosition): Added a FIXME to cover
2103         some cases where our line and column numbers are still nonsense.
2104
2105 2015-03-26  Beth Dakin  <bdakin@apple.com>
2106
2107         Relevant repainted objects callback is inaccurate and inconsistent for PDF 
2108         documents
2109         https://bugs.webkit.org/show_bug.cgi?id=143118
2110         -and corresponding-
2111         rdar://problem/13371582
2112
2113         Reviewed by Tim Horton.
2114
2115         Investigating this bug resulted in finding two things that should change for the 
2116         relevant repainted objects heuristic. First, we should not count any objects 
2117         painted while updating control tints. And secondly, we should not use it at all 
2118         for plugin documents. In other documents, we count the plugin area as “painted” 
2119         when we get to paint whether or not the plugin has actually loaded. This is 
2120         intentional because it allows us to account for chunks of the page that will be 
2121         filled in by possibly slow-loading ads. However, if the plugin is the whole 
2122         document, then the heuristic just doesn’t make any sense and it leads to 
2123         inconsistent behavior at different window sizes. So we’ll only count plugins when 
2124         the document is not a plugin document. 
2125
2126         Don’t count objects during this paint!
2127         * page/FrameView.cpp:
2128         (WebCore::FrameView::updateControlTints):
2129         * page/Page.h:
2130         (WebCore::Page::setIsCountingRelevantRepaintedObjects):
2131
2132         Make sure the document is not a plugin document.
2133         * rendering/RenderEmbeddedObject.cpp:
2134         (WebCore::RenderEmbeddedObject::paint):
2135
2136 2015-03-26  Alex Christensen  <achristensen@webkit.org>
2137
2138         Progress towards CMake on Mac.
2139         https://bugs.webkit.org/show_bug.cgi?id=143112
2140
2141         Reviewed by Chris Dumez.
2142
2143         * CMakeLists.txt:
2144         * PlatformEfl.cmake:
2145         * PlatformGTK.cmake:
2146         * PlatformMac.cmake:
2147         * platform/graphics/mac/IconMac.mm:
2148
2149 2015-03-26  Jer Noble  <jer.noble@apple.com>
2150
2151         [iOS] Accessibility crashing because MediaPlayer is laying out UI off the main thread
2152         https://bugs.webkit.org/show_bug.cgi?id=142970
2153
2154         Reviewed by Eric Carlson.
2155
2156         isMainThread() will (ironically) return true if called from the web thread. Rather than dispatch
2157         synchronously to the main thread to allocate the _volumeView, dispatch asynchronously and handle
2158         the case where the MPVolumeView has not yet been created.
2159
2160         * platform/audio/ios/MediaSessionManagerIOS.mm:
2161         (-[WebMediaSessionHelper allocateVolumeView]): Dispatch to the main thread to allocate. Move notification
2162             registration to -setVolumeView:.
2163         (-[WebMediaSessionHelper setVolumeView:]): Added. Register/Unregister for route availablitiy notifications.
2164         (-[WebMediaSessionHelper hasWirelessTargetsAvailable]): Handle the possibility of a nil _volumeView.
2165
2166 2015-03-26  Benjamin Poulain  <bpoulain@apple.com>
2167
2168         Fix state maching debugging after r181964
2169         https://bugs.webkit.org/show_bug.cgi?id=143082
2170
2171         Reviewed by Alex Christensen.
2172
2173         * contentextensions/ContentExtensionCompiler.cpp:
2174         (WebCore::ContentExtensions::compileRuleList):
2175
2176 2015-03-25  David Hyatt  <hyatt@apple.com>
2177
2178         Improve the offsetWidth/Height layout optimization
2179         https://bugs.webkit.org/show_bug.cgi?id=143008
2180
2181         Reviewed by Zalan Bujtas.
2182
2183         * dom/Document.cpp:
2184         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
2185         * dom/Document.h:
2186         Change Element* to Element&. Clean up the dimension bits to use shifting. Remove both the inline and
2187         the positioning restrictions on the optimization check.
2188
2189         * dom/Element.cpp:
2190         (WebCore::Element::offsetWidth):
2191         (WebCore::Element::offsetHeight):
2192         Change to use Element& instead of Element*.
2193
2194         (WebCore::Element::clientWidth):
2195         (WebCore::Element::clientHeight):
2196         (WebCore::Element::scrollWidth):
2197         (WebCore::Element::scrollHeight):
2198         Turn on the optimization for clientWidth/Height and scrollWidth/Height.
2199
2200 2015-03-26  Brady Eidson  <beidson@apple.com>
2201
2202         Apply ContentExtension actions after redirects.
2203         <rdar://problem/20062613> and https://bugs.webkit.org/show_bug.cgi?id=143055
2204
2205         Reviewed by Alex Christensen.
2206
2207         Tests: http/tests/contentextensions/loading/main-resource-redirect-blocked.php
2208                http/tests/contentextensions/subresource-redirect-blocked.html
2209
2210         This patch moves the "run a URL against the content extension" code from CachedResourceLoader to
2211         the ContentExtensionsBackend.
2212
2213         That allows it to be shared between the CachedResourceLoader where loads are initiated and 
2214         ResourceLoader where redirects are handled.
2215
2216         * contentextensions/ContentExtension.cpp:
2217         (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
2218
2219         * contentextensions/ContentExtensionsBackend.cpp:
2220         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
2221         (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
2222         * contentextensions/ContentExtensionsBackend.h:
2223
2224         * loader/NetscapePlugInStreamLoader.cpp:
2225         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
2226
2227         * loader/ResourceLoadInfo.h:
2228
2229         * loader/ResourceLoader.cpp:
2230         (WebCore::ResourceLoader::ResourceLoader):
2231         (WebCore::ResourceLoader::willSendRequest):
2232         * loader/ResourceLoader.h:
2233
2234         * loader/SubresourceLoader.cpp:
2235         (WebCore::SubresourceLoader::SubresourceLoader):
2236
2237         * loader/cache/CachedResourceLoader.cpp:
2238         (WebCore::CachedResourceLoader::requestResource):
2239
2240         * page/UserContentController.cpp:
2241         (WebCore::UserContentController::processContentExtensionRulesForLoad):
2242         (WebCore::UserContentController::actionsForResourceLoad): Deleted.
2243         (WebCore::UserContentController::globalDisplayNoneStyleSheet): Deleted.
2244         (WebCore::UserContentController::displayNoneCSSRule): Deleted.
2245         * page/UserContentController.h:
2246
2247 2015-03-26  Myles C. Maxfield  <mmaxfield@apple.com>
2248
2249         Crash when laying out (char)0
2250         https://bugs.webkit.org/show_bug.cgi?id=143103
2251
2252         Reviewed by Dean Jackson.
2253
2254         We currently cache a character -> Font mapping in a HashMap.
2255         However, keys in Hashmaps can't be 0. This patch simply skips
2256         the cache in this case.
2257
2258         No new tests, for now. I'm having trouble creating a test because
2259         the site that causes this bug generates their page using script,
2260         and the script is all minified, and difficult to understand. I
2261         will contact the owner of the site and ask for and unminified
2262         version of their sources. However, I don't want to that to block
2263         this tiny fix from going in.
2264
2265         * platform/graphics/Font.cpp:
2266         (WebCore::Font::systemFallbackFontForCharacter):
2267
2268 2015-03-26  Jer Noble  <jer.noble@apple.com>
2269
2270         [Mac][EME] Crash at com.apple.WebCore: WebCore::CDMSessionMediaSourceAVFObjC::releaseKeys + 177
2271         https://bugs.webkit.org/show_bug.cgi?id=143080
2272
2273         Reviewed by Eric Carlson.
2274
2275         Null-check m_certificate before dereferencing.
2276
2277         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
2278         (WebCore::CDMSessionMediaSourceAVFObjC::releaseKeys):
2279
2280 2015-03-26  Chris Fleizach  <cfleizach@apple.com>
2281
2282         AX: [role="button"][aria-pressed] should be exposed as AXCheckbox:AXToggleButton, with role description of "toggle button"
2283         https://bugs.webkit.org/show_bug.cgi?id=115298
2284
2285         Reviewed by Mario Sanchez Prada.
2286
2287         A role=button + aria-pressed object should be exposed as AXCheckbox on Mac now. It should also convert the
2288         aria-pressed state into a 0, 1, 2 number value for the Mac.
2289
2290         Test: platform/mac/accessibility/aria-pressed-button-attributes.html
2291
2292         * accessibility/AccessibilityObject.cpp:
2293         (WebCore::AccessibilityObject::checkboxOrRadioValue):
2294         * accessibility/AccessibilityObject.h:
2295         (WebCore::AccessibilityObject::isToggleButton):
2296         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2297         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
2298         (createAccessibilityRoleMap):
2299         (-[WebAccessibilityObjectWrapper subrole]):
2300         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2301
2302 2015-03-25  Dean Jackson  <dino@apple.com>
2303
2304         CSS blend modes do not parse when in the shadow tree
2305         https://bugs.webkit.org/show_bug.cgi?id=143067
2306         <rdar://problem/20302662>
2307
2308         Reviewed by Anders Carlson.
2309
2310         The media controls style sheets are injected as UA stylesheets
2311         when we come across a <video> or <audio> element. These stylesheets
2312         have a different parsing context than the document stylesheets -
2313         one that uses the default constructor, which initializes some
2314         features like cssCompositingEnabled to false without checking
2315         the runtime state.
2316
2317         The easy fix is to use the global state to initialize the context.
2318
2319         Unfortunately we can't test this since it only occurs in the shadow
2320         tree.
2321
2322         * css/CSSParser.cpp:
2323         (WebCore::CSSParserContext::CSSParserContext): Check the state
2324         of RuntimeEnabledFeatures to initialize CSS Regions and
2325         CSS Compositing (Blending).
2326
2327 2015-03-25  Chris Fleizach  <cfleizach@apple.com>
2328
2329         AX: table cells that use display:block render the table inaccessible to VoiceOver
2330         https://bugs.webkit.org/show_bug.cgi?id=143007
2331
2332         Reviewed by Mario Sanchez Prada.
2333
2334         When display:block is used on a table cell, it was being ignored because it was anonymous.
2335         This is still a valid scenario however if it's still inside of a valid table.
2336
2337         Test: accessibility/table-cell-display-block.html
2338
2339         * accessibility/AccessibilityTableCell.cpp:
2340         (WebCore::AccessibilityTableCell::computeAccessibilityIsIgnored):
2341
2342 2015-03-25  Tim Horton  <timothy_horton@apple.com>
2343
2344         Add a preference to prevent "user-scalable=no" from having any effect
2345         https://bugs.webkit.org/show_bug.cgi?id=143032
2346
2347         Reviewed by Sam Weinig.
2348
2349         * page/ViewportConfiguration.cpp:
2350         (WebCore::ViewportConfiguration::ViewportConfiguration):
2351         (WebCore::ViewportConfiguration::allowsUserScaling):
2352         * page/ViewportConfiguration.h:
2353         (WebCore::ViewportConfiguration::setForceAlwaysUserScalable):
2354         If forceAlwaysUserScalable is set to true, force "user-scalable=yes".
2355
2356 2015-03-25  Dan Bernstein  <mitz@apple.com>
2357
2358         Another attempt to get the iOS EWS building again.
2359
2360         * WebCore.xcodeproj/project.pbxproj:
2361
2362 2015-03-25  Alex Christensen  <achristensen@webkit.org>
2363
2364         Add case-insensitive checks to DFA bytecode.
2365         https://bugs.webkit.org/show_bug.cgi?id=142977
2366
2367         Reviewed by Benjamin Poulain.
2368
2369         * contentextensions/DFABytecode.h:
2370         (WebCore::ContentExtensions::instructionSizeWithArguments):
2371         * contentextensions/DFABytecodeCompiler.cpp:
2372         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValue):
2373         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValueRange):
2374         Add case-insensitive bytecode.
2375         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
2376         Check to see if case-insensitive bytecodes can be used.
2377         (WebCore::ContentExtensions::DFABytecodeCompiler::compileCheckForRange):
2378         * contentextensions/DFABytecodeCompiler.h:
2379         (WebCore::ContentExtensions::DFABytecodeCompiler::Range::Range):
2380         Added Range structure to be able to count the ranges in a future patch deciding if we want to use jump tables.
2381         * contentextensions/DFABytecodeInterpreter.cpp:
2382         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
2383         Interpret case-insensitive bytecodes.
2384
2385 2015-03-25  Sam Weinig  <sam@webkit.org>
2386
2387         Address additional review feedback from https://bugs.webkit.org/show_bug.cgi?id=143059.
2388
2389         * contentextensions/ContentExtensionCompiler.cpp:
2390         (WebCore::ContentExtensions::compileRuleList):
2391         * contentextensions/ContentExtensionCompiler.h:
2392         * contentextensions/ContentExtensionParser.cpp:
2393         (WebCore::ContentExtensions::getTypeFlags):
2394
2395 2015-03-25  Sam Weinig  <sam@webkit.org>
2396
2397         [Content Extensions] Convert content extension compiling to return error codes and write its output using a client
2398         https://bugs.webkit.org/show_bug.cgi?id=143059
2399
2400         Reviewed by Alex Christensen.
2401
2402         * WebCore.xcodeproj/project.pbxproj:
2403         Add ContentExtensionError.h/cpp.
2404
2405         * contentextensions/ContentExtensionError.cpp: Added.
2406         (WebCore::ContentExtensions::contentExtensionErrorCategory):
2407         * contentextensions/ContentExtensionError.h: Added.
2408         (WebCore::ContentExtensions::make_error_code):
2409         Add ContentExtensionError enum and std::error_code adaptor.
2410
2411         * contentextensions/ContentExtensionCompiler.h:
2412         Instead of returning CompiledContentExtensionData, use a client interface
2413         to pass data. Eventually, this should be turned into a direct streaming 
2414         interface so we can write directly to a file.
2415
2416         * contentextensions/ContentExtensionCompiler.cpp:
2417         (WebCore::ContentExtensions::compileRuleList):
2418         * contentextensions/ContentExtensionParser.cpp:
2419         (WebCore::ContentExtensions::getTypeFlags):
2420         (WebCore::ContentExtensions::loadTrigger):
2421         (WebCore::ContentExtensions::loadAction):
2422         (WebCore::ContentExtensions::loadRule):
2423         (WebCore::ContentExtensions::loadEncodedRules):
2424         (WebCore::ContentExtensions::parseRuleList):
2425         * contentextensions/ContentExtensionParser.h:
2426         Convert to return an error.
2427
2428 2015-03-25  Beth Dakin  <bdakin@apple.com>
2429
2430         REGRESSION (r181660): Safari navigates to link after a starting and canceling a 
2431         force preview
2432         https://bugs.webkit.org/show_bug.cgi?id=143057
2433         -and corresponding-
2434         rdar://problem/20251436
2435
2436         Reviewed by Tim Horton.
2437
2438         This patch adds a value for ActionUpdated to the ImmediateActionStage enum. Now if 
2439         m_immediateActionStage indicates that an immediate action has either begun or 
2440         completed then we can have the same behavior.
2441         * page/EventHandler.cpp:
2442         (WebCore::EventHandler::handleMouseReleaseEvent):
2443         * page/EventHandler.h:
2444
2445 2015-03-25  Dean Jackson  <dino@apple.com>
2446
2447         MediaControls: Use font with fixed number width
2448         https://bugs.webkit.org/show_bug.cgi?id=143018
2449         <rdar://problem/20245415>
2450
2451         Reviewed by Eric Carlson.
2452
2453         Add a new font-family, specific to Apple platforms,
2454         called -apple-system-font-monospaced-numbers. This is
2455         a special variant of the system font which uses monospaced
2456         forms for the number glyphs - allowing a time reading that
2457         doesn't bounce around as the time changes.
2458
2459         * Modules/mediacontrols/mediaControlsApple.css: Media controls should
2460         use the new font.
2461         (audio::-webkit-media-controls-time-remaining-display):
2462         * Modules/mediacontrols/mediaControlsiOS.css:
2463         (audio::-webkit-media-controls-time-remaining-display):
2464
2465         * platform/graphics/ios/FontCacheIOS.mm: Request a new CTFontRef with
2466         the appropriate attributes.
2467         (WebCore::createCTFontWithFamilyNameAndWeight):
2468         * platform/graphics/mac/FontCacheMac.mm: Ditto, but NSFont.
2469         (WebCore::fontWithFamily):
2470         * platform/spi/cocoa/CoreTextSPI.h: Expose the constants for
2471         the new form so that the public SDK can build.
2472
2473 2015-03-25  Alex Christensen  <achristensen@webkit.org>
2474
2475         [Content Extensions] Add multi-DFA compiling and interpreting.
2476         https://bugs.webkit.org/show_bug.cgi?id=143010
2477
2478         Reviewed by Benjamin Poulain.
2479
2480         * contentextensions/ContentExtensionCompiler.cpp:
2481         (WebCore::ContentExtensions::compileRuleList):
2482         Compile multiple NFAs to DFAs.
2483         * contentextensions/ContentExtensionsBackend.cpp:
2484         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
2485         Fixed a bug when there are no non-universal actions.
2486         We still need to report that no ignore-previous-rules was hit to apply the
2487         universal actions which are now accessed through DFABytecodeInterpreter::actionsFromDFARoot
2488         and skipped in DFABytecodeInterpreter::interpret.
2489         * contentextensions/DFABytecodeCompiler.cpp:
2490         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
2491         Add a header for each DFA.
2492         * contentextensions/DFABytecodeInterpreter.cpp:
2493         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
2494         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
2495         Interpret as many DFAs as there are in the bytecode.
2496
2497 2015-03-25  Per Arne Vollan  <peavo@outlook.com>
2498
2499         [Win] Illegal character in project file.
2500         https://bugs.webkit.org/show_bug.cgi?id=143051
2501
2502         Reviewed by Brent Fulgham.
2503
2504         There is an illegal character in the WebCore project filter.
2505         WebCore files are shown unfiltered.
2506
2507         * WebCore.vcxproj/WebCore.vcxproj.filters:
2508
2509 2015-03-25  David Hyatt  <hyatt@apple.com>
2510
2511         Add a pref to enable the new block-inside-inline model
2512         https://bugs.webkit.org/show_bug.cgi?id=143050
2513
2514         Reviewed by Sam Weinig.
2515
2516         * page/Settings.in:
2517
2518 2015-03-25  Dan Bernstein  <mitz@apple.com>
2519
2520         iOS Simulator build fix.
2521
2522         * platform/spi/cocoa/IOSurfaceSPI.h:
2523
2524 2015-03-25  Commit Queue  <commit-queue@webkit.org>
2525
2526         Unreviewed, rolling out r181932.
2527         https://bugs.webkit.org/show_bug.cgi?id=143041
2528
2529         The test fails most of the time on bots (Requested by ap on
2530         #webkit).
2531
2532         Reverted changeset:
2533
2534         "[Content Extensions] Add multi-DFA compiling and
2535         interpreting."
2536         https://bugs.webkit.org/show_bug.cgi?id=143010
2537         http://trac.webkit.org/changeset/181932
2538
2539 2015-03-24  Dean Jackson  <dino@apple.com>
2540
2541         Source/WebCore/rendering/RenderThemeMac.mm:2181:118: error: null passed to a callee that requires a non-null argument [-Werror,-Wnonnull]
2542         https://bugs.webkit.org/show_bug.cgi?id=143039
2543
2544         Unreviewed build fix for newer versions of OS X.
2545
2546         * rendering/RenderThemeMac.mm: Define a null language parameter. This
2547         seemed better than turning the clang warning off for just that
2548         function.
2549         (WebCore::AttachmentLayout::layOutTitle):
2550         (WebCore::AttachmentLayout::layOutSubtitle):
2551
2552 2015-03-24  Dan Bernstein  <mitz@apple.com>
2553
2554         Another attempt to fix the build.
2555
2556         * WebCore.xcodeproj/project.pbxproj:
2557         * platform/spi/cocoa/QuartzCoreSPI.h:
2558
2559 2015-03-24  Alex Christensen  <achristensen@webkit.org>
2560
2561         [Content Extensions] Add multi-DFA compiling and interpreting.
2562         https://bugs.webkit.org/show_bug.cgi?id=143010
2563
2564         Reviewed by Benjamin Poulain.
2565
2566         * contentextensions/ContentExtensionCompiler.cpp:
2567         (WebCore::ContentExtensions::compileRuleList):
2568         Compile multiple NFAs to DFAs.
2569         * contentextensions/ContentExtensionsBackend.cpp:
2570         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
2571         Fixed a bug when there are no non-universal actions.
2572         We still need to report that no ignore-previous-rules was hit to apply the
2573         universal actions which are now accessed through DFABytecodeInterpreter::actionsFromDFARoot
2574         and skipped in DFABytecodeInterpreter::interpret.
2575         * contentextensions/DFABytecodeCompiler.cpp:
2576         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
2577         Add a header for each DFA.
2578         * contentextensions/DFABytecodeInterpreter.cpp:
2579         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
2580         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
2581         Interpret as many DFAs as there are in the bytecode.
2582
2583 2015-03-24  Dan Bernstein  <mitz@apple.com>
2584
2585         Tried to fix the EWS build.
2586
2587         * platform/spi/cocoa/QuartzCoreSPI.h:
2588
2589 2015-03-24  Commit Queue  <commit-queue@webkit.org>
2590
2591         Unreviewed, rolling out r181898 and r181909.
2592         https://bugs.webkit.org/show_bug.cgi?id=143034
2593
2594         Broke fast/regions/auto-size/autoheight-two-pass-layout-
2595         complex-002.html (Requested by ap on #webkit).
2596
2597         Reverted changesets:
2598
2599         "Improve the offsetWidth/Height layout optimization"
2600         https://bugs.webkit.org/show_bug.cgi?id=143008
2601         http://trac.webkit.org/changeset/181898
2602
2603         "Disable layout dimensions optimization for RenderRegions"
2604         https://bugs.webkit.org/show_bug.cgi?id=143017
2605         http://trac.webkit.org/changeset/181909
2606
2607 2015-03-24  Zhuo Li  <zachli@apple.com>
2608
2609         Scripts running in isolated world should not subject to a page's CSP about 'eval'.
2610         https://bugs.webkit.org/show_bug.cgi?id=141316.
2611
2612         Reviewed by Geoffrey Garen.
2613
2614         * bindings/js/ScriptController.cpp:
2615         (WebCore::ScriptController::initScript):
2616         We should not impose the main world Content Security Policy onto the isolated world.
2617
2618 2015-03-24  Chris Dumez  <cdumez@apple.com>
2619
2620         [Mac] Use .cpp file extension instead of .mm for SharedTimerCF and PowerObserverMac
2621         https://bugs.webkit.org/show_bug.cgi?id=143026
2622
2623         Reviewed by Andy Estes.
2624
2625         Use .cpp file extension instead of .mm for SharedTimerCF and
2626         PowerObserverMac.
2627
2628         * WebCore.xcodeproj/project.pbxproj:
2629         * platform/cf/SharedTimerCF.cpp: Renamed from Source/WebCore/platform/cf/SharedTimerCF.mm.
2630         (WebCore::timerFired):
2631         Use WTF::AutodrainedPool instead of @autoreleasepool {}.
2632
2633         * platform/mac/PowerObserverMac.cpp: Renamed from Source/WebCore/platform/mac/PowerObserverMac.mm.
2634
2635 2015-03-24  Yusuke Suzuki  <utatane.tea@gmail.com>
2636
2637         REGRESSION (r181458): Heap use-after-free in JSSetIterator destructor
2638         https://bugs.webkit.org/show_bug.cgi?id=142696
2639
2640         Reviewed and tweaked by Geoffrey Garen.
2641
2642         Use JSSetIterator/JSMapIterator to iterate over JSSet and JSMap.
2643
2644         * ForwardingHeaders/runtime/JSMapIterator.h: Added.
2645         * ForwardingHeaders/runtime/JSSetIterator.h: Added.
2646         * bindings/js/SerializedScriptValue.cpp:
2647         (WebCore::CloneSerializer::serialize):
2648
2649 2015-03-24  Dan Bernstein  <mitz@apple.com>
2650
2651         Tried to fix the iOS Simulator build.
2652
2653         * platform/spi/cocoa/QuartzCoreSPI.h:
2654
2655 2015-03-24  Benjamin Poulain  <bpoulain@apple.com>
2656
2657         Make URL filter patterns matching consistent and add a simple canonicalization step
2658         https://bugs.webkit.org/show_bug.cgi?id=142998
2659
2660         Reviewed by Alex Christensen.
2661
2662         This patch makes two changes to the url filter input:
2663         -Make the matching "Search" by default, the pattern can now appear anywhere
2664          in the URL by default.
2665         -Make the input a little less fragile: do not explode on valid input
2666          that is not formatted in a certain way.
2667
2668         To implement the search behavior, I simply add an implict ".*" in front of the patterns
2669         when that make sense.
2670
2671         To make the input more solid, we do some little modification on the input:
2672         -Remove duplicated ".*".
2673         -Remove matching suffixes that do not bring new information.
2674         -Unify all the ".*" in the same format.
2675
2676         Why do that here? That should be done through a graph analysis on the machine.
2677
2678         The reason is this is incredibly cheap compared to the graph analysis. Any state
2679         removed upfront will save the handling of several hundred nodes in the deterministic
2680         graph.
2681
2682         * contentextensions/URLFilterParser.cpp:
2683         (WebCore::ContentExtensions::Term::isKnownToMatchAnyString):
2684         (WebCore::ContentExtensions::Term::isUniversalTransition):
2685         (WebCore::ContentExtensions::GraphBuilder::finalize):
2686         (WebCore::ContentExtensions::GraphBuilder::assertionBOL):
2687         (WebCore::ContentExtensions::GraphBuilder::fail):
2688         (WebCore::ContentExtensions::GraphBuilder::simplifySunkTerms):
2689
2690 2015-03-24  Chris Dumez  <cdumez@apple.com>
2691
2692         Regression(r181671): Caused Timer-related crashes on iOS / WK1
2693         https://bugs.webkit.org/show_bug.cgi?id=143025
2694
2695         Reviewed by Andy Estes.
2696
2697         Call CFRunLoopAddTimer() on WebThreadRunLoop() instead of
2698         CFRunLoopGetCurrent() for iOS, as we did before r181671.
2699
2700         I inadvertently changed this in r181671 when merging the Mac
2701         and iOS implementations.
2702
2703         No new tests, already covered by existing tests.
2704
2705         * platform/cf/SharedTimerCF.mm:
2706         (WebCore::setSharedTimerFireInterval):
2707
2708 2015-03-24  Dan Bernstein  <mitz@apple.com>
2709
2710         WebCore part of <rdar://problem/20282863> Transforms are flattened in snapshots of on-screen WKWebViews
2711         https://bugs.webkit.org/show_bug.cgi?id=143023
2712
2713         Reviewed by Tim Horton.
2714
2715         * platform/spi/cocoa/QuartzCoreSPI.h: Added the declaration of
2716         CARenderServerRenderLayerWithTransform.
2717
2718 2015-03-24  David Hyatt  <hyatt@apple.com>
2719
2720         Disable layout dimensions optimization for RenderRegions
2721         https://bugs.webkit.org/show_bug.cgi?id=143017
2722
2723         Reviewed by Dean Jackson.
2724
2725         * dom/Document.cpp:
2726         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
2727         Turn off the optimization for regions, since auto height regions can change size
2728         without needing a layout.
2729
2730 2015-03-24  Beth Dakin  <bdakin@apple.com>
2731
2732         Add events related to force click gesture
2733         https://bugs.webkit.org/show_bug.cgi?id=142836
2734         -and corresponding-
2735         rdar://problem/20210239
2736
2737         Reviewed by Dean Jackson.
2738
2739         This patch adds six new events for the force click gesture:
2740
2741         webkitmouseforcewillbegin -> Event is sent just before mousedown to indicate that 
2742         force can be perceived if the user presses any harder. The author should prevent 
2743         default on this event to both prevent the user agent’s default force click 
2744         features and to receive the other 5 events.
2745
2746         webkitmouseforcechanged -> This event fires whenever force changes between the 
2747         mousedown and mouseup. It is a new type of mouse event that includes a force 
2748         variable which is a normalized number between 0 (corresponds to click) and 1 
2749         (corresponds to force click). In this patch, I have only added code to send this 
2750         event between mousedown and mouseforcedown, but as a followup patch, we plan to 
2751         send it through mouseup.
2752
2753         webkitmouseforcecancelled -> If the user releases their finger from the trackpad 
2754         after pressing hard enough to send webkitmouseforcewillbegin events but not hard 
2755         enough to force click, this event will be sent to indicate that the user bailed 
2756         out on the gesture.
2757
2758         webkitmouseforcedown -> The down part of the force click.
2759
2760         webkitmouseforceup -> The up part of the force click. This event is added in this 
2761         patch, but does not yet fire. That is work for a follow-up patch.
2762
2763         webkitmouseforceclick -> The equivalent of the click event for the force click. 
2764         Should fire just after webkitmouseforceup. This event is added in this patch, but 
2765         does not yet fire. That is work for a follow-up patch.
2766
2767         Add new files for WebKitMouseForceEvent to build systems.
2768         * DerivedSources.cpp:
2769         * DerivedSources.make:
2770         * WebCore.vcxproj/WebCore.vcxproj:
2771         * WebCore.vcxproj/WebCore.vcxproj.filters:
2772         * WebCore.xcodeproj/project.pbxproj:
2773         * WebCore.xcodeproj/project.pbxproj:
2774
2775         Plumbing for new events.
2776         * dom/Document.idl:
2777
2778         Code to dispatch the new events. Currently the code that calls these functions is 
2779         in WebKit2.
2780         * dom/Element.cpp:
2781         (WebCore::Element::dispatchMouseForceWillBegin):
2782         (WebCore::Element::dispatchMouseForceChanged):
2783         (WebCore::Element::dispatchMouseForceDown):
2784         (WebCore::Element::dispatchMouseForceUp):
2785         (WebCore::Element::dispatchMouseForceClick):
2786         (WebCore::Element::dispatchMouseForceCancelled):
2787         * dom/Element.h:
2788
2789         More plumbing.
2790         * dom/Element.idl:
2791         * dom/EventNames.h:
2792         * dom/EventNames.in:
2793
2794         Our new type of mouse event that includes force.
2795         * dom/WebKitMouseForceEvent.cpp: Added.
2796         (WebCore::WebKitMouseForceEventInit::WebKitMouseForceEventInit):
2797         (WebCore::WebKitMouseForceEvent::WebKitMouseForceEvent):
2798         (WebCore::WebKitMouseForceEvent::~WebKitMouseForceEvent):
2799         (WebCore::WebKitMouseForceEvent::eventInterface):
2800         * dom/WebKitMouseForceEvent.h: Added.
2801         * dom/WebKitMouseForceEvent.idl: Added.
2802
2803         More plumbing.
2804         * html/HTMLAttributeNames.in:
2805         * html/HTMLBodyElement.cpp:
2806         (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
2807         * html/HTMLBodyElement.idl:
2808         * html/HTMLElement.cpp:
2809         (WebCore::HTMLElement::createEventHandlerNameMap):
2810         * page/DOMWindow.idl:
2811         * page/EventHandler.h:
2812         (WebCore::EventHandler::lastMouseDownEvent):
2813
2814 2015-03-24  Anders Carlsson  <andersca@apple.com>
2815
2816         Fix designated initializer violations
2817         https://bugs.webkit.org/show_bug.cgi?id=143016
2818         rdar://problem/20268858
2819
2820         Reviewed by Dan Bernstein.
2821
2822         Mark -[DOMObject init] as unavailable.
2823
2824         * bindings/objc/DOMObject.h:
2825         * bindings/objc/DOMObject.mm:
2826         (-[DOMObject init]):
2827
2828 2015-03-24  Benjamin Poulain  <benjamin@webkit.org>
2829
2830         CSS Selectors Level 4: enable case-insensitive attribute matching by default
2831         https://bugs.webkit.org/show_bug.cgi?id=142960
2832
2833         Reviewed by Andreas Kling.
2834
2835         All open issues have been resolved, enable the feature by default.
2836
2837         Test: fast/css/attribute-selector-case-insensitive.html
2838
2839         * css/CSSGrammar.y.in:
2840
2841 2015-03-24  Dean Jackson  <dino@apple.com>
2842
2843         MediaControls: Scrubber and Time displays have the incorrect blending
2844         https://bugs.webkit.org/show_bug.cgi?id=143011
2845         <rdar://problem/20245251>
2846
2847         Reviewed by Eric Carlson.
2848
2849         The scrubber in media controls should use plus-darker blending. Then
2850         the scrubber itself should use a slightly transparent black (55% opacity)
2851         when drawing.
2852
2853         * Modules/mediacontrols/mediaControlsiOS.css:
2854         (audio::-webkit-media-controls-timeline): Add the blend mode.
2855         * Modules/mediacontrols/mediaControlsiOS.js:
2856         (ControllerIOS.prototype.drawTimelineBackground): Start drawing with
2857         transparency. I changed the order of rendering to make it
2858         more clear we draw the three parts in left to right order.
2859
2860 2015-03-24  David Hyatt  <hyatt@apple.com>
2861
2862         Improve the offsetWidth/Height layout optimization
2863         https://bugs.webkit.org/show_bug.cgi?id=143008
2864
2865         Reviewed by Dean Jackson.
2866
2867         * dom/Document.cpp:
2868         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
2869         * dom/Document.h:
2870         Change Element* to Element&. Clean up the dimension bits to use shifting. Remove both the inline and
2871         the positioning restrictions on the optimization check.
2872
2873         * dom/Element.cpp:
2874         (WebCore::Element::offsetWidth):
2875         (WebCore::Element::offsetHeight):
2876         Change to use Element& instead of Element*.
2877
2878         (WebCore::Element::clientWidth):
2879         (WebCore::Element::clientHeight):
2880         (WebCore::Element::scrollWidth):
2881         (WebCore::Element::scrollHeight):
2882         Turn on the optimization for clientWidth/Height and scrollWidth/Height.
2883
2884 2015-03-24  Yoav Weiss  <yoav@yoav.ws>
2885
2886         Stop image from displaying when src attribute is removed or emptied
2887         https://bugs.webkit.org/show_bug.cgi?id=142677
2888
2889         Reviewed by Chris Dumez.
2890
2891         Previously, we ignored empty attribute as failed URL, and didn't update the
2892         renderer when an image was removed. This patch fixes that.
2893
2894         Tests: fast/dom/HTMLImageElement/image-empty-src.html
2895                fast/dom/HTMLImageElement/image-remove-src.html
2896
2897         * loader/ImageLoader.cpp:
2898         (WebCore::ImageLoader::updateFromElement):
2899
2900 2015-03-17  Philippe Normand  <pnormand@igalia.com>
2901
2902         [OpenWebRTC] RealtimeMediaSourceCenter implementation
2903         https://bugs.webkit.org/show_bug.cgi?id=142476
2904
2905         Reviewed by Eric Carlson.
2906
2907         The old GStreamer MediaStreamCenter is replaced by the OpenWebRTC
2908         RealtimeMediaSourceCenter. It is not yet able to correctly assess
2909         MediaConstraints so it selects the first audio/video sources
2910         available through OpenWebRTC.
2911
2912         * PlatformEfl.cmake: Add new files to the build.
2913         * PlatformGTK.cmake: Ditto.
2914         * platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp: Removed.
2915         * platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp: Added.
2916         (WebCore::initializeOpenWebRTC): Simple function to initialize the
2917         framework, it is going to be used by the PeerConnection backend as well.
2918         * platform/mediastream/openwebrtc/OpenWebRTCUtilities.h: Added.
2919         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp: Added.
2920         (WebCore::mediaSourcesAvailableCallback): Function invoked once
2921         the media sources discovery succeeded within OpenWebRTC.
2922         (WebCore::RealtimeMediaSourceCenter::platformCenter): Instantiate
2923         the OpenWebRTC RealtimeMediaSourceCenter.
2924         (WebCore::RealtimeMediaSourceCenterOwr::RealtimeMediaSourceCenterOwr):
2925         (WebCore::RealtimeMediaSourceCenterOwr::~RealtimeMediaSourceCenterOwr):
2926         (WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints):
2927         Schedule a discovery process for the capture sources.
2928         (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Pick
2929         the first audio/video sources and create a MediaStream accordingly.
2930         (WebCore::RealtimeMediaSourceCenterOwr::getMediaStreamTrackSources):
2931         Not yet implemented.
2932         (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
2933         Method invoked once the capture sources process succeeded. Parse
2934         them and create an internal cache of RealtimeMediaSources accordingly.
2935         (WebCore::RealtimeMediaSourceCenterOwr::firstSource): Utility
2936         function to fetch the first source of the given type from the
2937         RealtimeMediaSources cache.
2938         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h: Renamed from Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h.
2939         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h: Added.
2940
2941 2015-03-24  Csaba Osztrogonác  <ossy@webkit.org>
2942
2943         [EFL] Add OpenWebRTC in jhbuild
2944         https://bugs.webkit.org/show_bug.cgi?id=142778
2945
2946         Reviewed by Gyuyoung Kim.
2947
2948         Original patch by Philippe Normand <pnormand@igalia.com>
2949
2950         * PlatformEfl.cmake: Add OpenWebRTC CFLAGS and LDFLAGS.
2951
2952 2015-03-23 Yoav Weiss  <yoav@yoav.ws>
2953
2954         Update empty image canvas tests and fix a related bug
2955         https://bugs.webkit.org/show_bug.cgi?id=142694
2956
2957         Reviewed by Chris Dumez.
2958
2959         During the work on https://bugs.webkit.org/show_bug.cgi?id=142677
2960         we encountered an issue with canvas tests related to empty image handling
2961         when drawn or used as a pattern. After updating these tests, an issue with
2962         pattern handling was encountered.
2963
2964         The spec, as well as Chrome's implementation, say that when an empty image
2965         is used as a pattern, createPattern should return null. See
2966         https://html.spec.whatwg.org/multipage/scripting.html#fill-and-stroke-styles:check-the-usability-of-the-image-argument
2967         Instead, createPattern returned an exception in this case.
2968         This patch fixes that and makes sure that it returns a null when image loading hasn't started.
2969
2970         Tests: canvas/philip/tests/2d.drawImage.incomplete.emptysrc.html
2971                canvas/philip/tests/2d.drawImage.incomplete.nosrc.html
2972                canvas/philip/tests/2d.drawImage.incomplete.removedsrc.html
2973                canvas/philip/tests/2d.pattern.image.incomplete.emptysrc.html
2974                canvas/philip/tests/2d.pattern.image.incomplete.removedsrc.html
2975
2976         * html/canvas/CanvasRenderingContext2D.cpp:
2977         (WebCore::CanvasRenderingContext2D::createPattern): Return "null" if image is not fully decodeable.
2978
2979 2015-03-23  Alex Christensen  <achristensen@webkit.org>
2980
2981         Fix api tests after r181876.
2982
2983         * contentextensions/ContentExtensionsBackend.cpp:
2984         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
2985         Always append a CSSDisplayNoneStyleSheet action if no ignore-previous-rules is seen.
2986         * loader/cache/CachedResourceLoader.cpp:
2987         (WebCore::CachedResourceLoader::requestResource):
2988         Changed an assertion to a null check.
2989
2990 2015-03-23  Dean Jackson  <dino@apple.com>
2991
2992         Timelines are sharing the same canvas background
2993         https://bugs.webkit.org/show_bug.cgi?id=142994
2994         <rdar://problem/20209466>
2995
2996         Reviewed by Brent Fulgham.
2997
2998         Since each MediaControl lives in an isolated world, we
2999         can't rely on a global variable to provide a unique
3000         identifier for a named canvas. The fix is to expose
3001         WebCore's UUID generator, and have each canvas use
3002         that for a name.
3003
3004         * Modules/mediacontrols/MediaControlsHost.cpp:
3005         (WebCore::MediaControlsHost::generateUUID): New method on the
3006         MediaControlsHost that generates a UUID.
3007         * Modules/mediacontrols/MediaControlsHost.h:
3008         * Modules/mediacontrols/MediaControlsHost.idl:
3009
3010         * Modules/mediacontrols/mediaControlsApple.js: Remove the global
3011         variable unique ID that wasn't working, and instead get
3012         an ID from the MediaControlsHost.
3013         (Controller.prototype.createControls):
3014         * Modules/mediacontrols/mediaControlsiOS.js:
3015         (ControllerIOS):
3016
3017 2015-03-23  Brent Fulgham  <bfulgham@apple.com>
3018
3019         Scroll latching logic can get stuck in 'scrollable="no"' iframes
3020         https://bugs.webkit.org/show_bug.cgi?id=142789
3021         <rdar://problem/20129494>
3022
3023         Reviewed by Dean Jackson.
3024
3025         Clean up the EventHandler and latching code as follows:
3026         (1) Do not handle iframe elements as part of the normal latching logic. Instead, iframes should
3027             be evaluated during the 'platformCompleteWheelEvent' phase of processing as top-level scrolling
3028             frames.
3029         (2) Get rid of the ill-conceived notation that we should process non-mainframe and main-frame frames
3030             different.
3031         (3) Modify code to reflect that the scroll latching code really deals with overflow scrolling. Consequently,
3032             the 'findEnclosingScrollableContainer' was renamed to 'findEnclosingOverflowScroll' and does not
3033             treat iframe as a suitable target.
3034         (4) Do not create a latching state object when the container being evaluated is already scrolled to the
3035             extreme position in the direction of the mouse gesture. In this case, we want the enclosing frame
3036             to be the latching target.
3037         (5) Do not treat the state where the mouse wheel gesture has ended manual scrolling, but has not ended
3038             momentum scrolling, as an appropriate time to select a latching target.
3039
3040         * page/EventHandler.cpp:
3041         (WebCore::EventHandler::platformCompleteWheelEvent): Modify signature to remove unneeded argument.
3042         (WebCore::EventHandler::handleWheelEvent): Modify call to 'platformCompleteWheelEvent' to remove unused argument.
3043         * page/EventHandler.h:
3044         * page/mac/EventHandlerMac.mm:
3045         (WebCore::findEnclosingOverflowScroll): Renamed from 'findEnclosingScrollableContainer' and revised per the
3046         notes above.
3047         (WebCore::EventHandler::platformPrepareForWheelEvents): Remove mainFrame vs. non-mainFrame code paths and
3048         consolidate logic.
3049         (WebCore::EventHandler::platformCompleteWheelEvent): Remove unused argument. The wheel event target is no
3050         longer needed here, now that iframes are not processed by this code.
3051         (WebCore::findEnclosingScrollableContainer): Deleted.
3052         * page/scrolling/ScrollLatchingState.cpp:
3053         (WebCore::ScrollLatchingState::setPreviousWheelScrolledElement:) Switch to move operator for passing
3054         a temporary RefPtr to the the function.
3055         * page/scrolling/ScrollLatchingState.h:
3056         * platform/PlatformWheelEvent.h:
3057         (WebCore::PlatformWheelEvent::useLatchedEventElement): Recognize 'phase=ended, momentum=none' as a state
3058         that should not cause latching state to be revised.
3059
3060 2015-03-23  Anders Carlsson  <andersca@apple.com>
3061
3062         Try to fix the iOS build.
3063
3064         * platform/network/mac/CookieJarMac.mm:
3065
3066 2015-03-23  Brady Eidson  <beidson@apple.com>
3067
3068         Content extensions should apply css selectors
3069         https://bugs.webkit.org/show_bug.cgi?id=142604
3070
3071         Reviewed by Alex Christensen.
3072
3073         Tests: http/tests/contentextensions/css-display-none.html
3074
3075         * WebCore.xcodeproj/project.pbxproj:
3076
3077         * contentextensions/ContentExtension.cpp:
3078         (WebCore::ContentExtensions::ContentExtension::create):
3079         (WebCore::ContentExtensions::ContentExtension::ContentExtension):
3080         (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
3081         * contentextensions/ContentExtension.h:
3082         (WebCore::ContentExtensions::ContentExtension::identifier):
3083         (WebCore::ContentExtensions::ContentExtension::compiledExtension):
3084
3085         * contentextensions/ContentExtensionsBackend.cpp:
3086         (WebCore::ContentExtensions::ContentExtensionsBackend::addContentExtension):
3087         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
3088         (WebCore::ContentExtensions::ContentExtensionsBackend::globalDisplayNoneStyleSheet):
3089         * contentextensions/ContentExtensionsBackend.h:
3090
3091         * contentextensions/DFABytecodeInterpreter.cpp:
3092         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
3093
3094         * dom/DocumentStyleSheetCollection.cpp:
3095         (WebCore::DocumentStyleSheetCollection::maybeAddContentExtensionSheet):
3096         * dom/DocumentStyleSheetCollection.h:
3097
3098         * loader/DocumentLoader.cpp:
3099         (WebCore::DocumentLoader::commitData):
3100         (WebCore::DocumentLoader::startLoadingMainResource):
3101         (WebCore::DocumentLoader::addPendingContentExtensionSheet):
3102         * loader/DocumentLoader.h:
3103
3104         * loader/cache/CachedResourceLoader.cpp:
3105         (WebCore::CachedResourceLoader::requestResource):
3106
3107         * loader/cache/CachedResourceRequest.cpp:
3108         (WebCore::CachedResourceRequest::setInitiator):
3109         * loader/cache/CachedResourceRequest.h:
3110         (WebCore::CachedResourceRequest::initiatingDocumentLoader):
3111
3112         * page/UserContentController.cpp:
3113         (WebCore::UserContentController::globalDisplayNoneStyleSheet):
3114         (WebCore::UserContentController::displayNoneCSSRule):
3115         * page/UserContentController.h:
3116
3117 2015-03-23  Anders Carlsson  <andersca@apple.com>
3118
3119         -[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:] doesn't remove cookies
3120         https://bugs.webkit.org/show_bug.cgi?id=142990
3121         rdar://problem/20241645
3122
3123         Reviewed by Andreas Kling.
3124
3125         Use the Mac version of deleteAllCookiesModifiedSince on iOS as well.
3126
3127         * platform/network/cf/CookieJarCFNet.cpp:
3128         * platform/network/mac/CookieJarMac.mm:
3129
3130 2015-03-23  Conrad Shultz  <conrad_shultz@apple.com>
3131
3132         Replace uses of kCTFontSystemFontType
3133         https://bugs.webkit.org/show_bug.cgi?id=142984
3134
3135         Reviewed by Tim Horton.
3136
3137         * rendering/RenderThemeMac.mm:
3138         (WebCore::AttachmentLayout::layOutTitle):
3139         (WebCore::AttachmentLayout::layOutSubtitle):
3140
3141 2015-03-23  Dean Jackson  <dino@apple.com>
3142
3143         kCTFontSystemFontType is deprecated in CoreText
3144         https://bugs.webkit.org/show_bug.cgi?id=142981
3145         <rdar://problem/20261171>
3146
3147         Reviewed by Beth Dakin.
3148
3149         Update to the non-deprecated version.
3150
3151         * rendering/RenderThemeIOS.mm: kCTFontSystemFontType -> kCTFontUIFontSystem
3152         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
3153
3154 2015-03-23  Eric Carlson  <eric.carlson@apple.com>
3155
3156         [Mac] Enable fullscreen for MSE-based videos
3157         https://bugs.webkit.org/show_bug.cgi?id=142971
3158
3159         Reviewed by Jer Noble.
3160
3161         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3162         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsFullscreen): Return true;
3163
3164 2015-03-23  Alex Christensen  <achristensen@webkit.org>
3165
3166         [MediaFoundation] Implement seek.
3167         https://bugs.webkit.org/show_bug.cgi?id=142594
3168
3169         Reviewed by Darin Adler.
3170
3171         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3172         (WebCore::MediaPlayerPrivateMediaFoundation::seeking):
3173         (WebCore::MediaPlayerPrivateMediaFoundation::seekDouble):
3174         (WebCore::MediaPlayerPrivateMediaFoundation::durationDouble):
3175         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
3176
3177 2015-03-23  Dan Bernstein  <mitz@apple.com>
3178
3179         Fixed the build.
3180
3181         * platform/graphics/cocoa/FontCocoa.mm:
3182         (WebCore::Font::platformBoundsForGlyph): Switched to non-deprecated CTFontOrientation values.
3183         (WebCore::Font::platformWidthForGlyph): Ditto.
3184
3185 2015-03-23  Jer Noble  <jer.noble@apple.com>
3186
3187         [iOS] Accessibility crashing because MediaPlayer is laying out UI off the main thread
3188         https://bugs.webkit.org/show_bug.cgi?id=142970
3189
3190         Reviewed by Eric Carlson.
3191
3192         Return early after synchronously calling to the main thread to allocate the volume
3193         view, to avoid re-allocating the volume view again on the web thread.
3194
3195         * platform/audio/ios/MediaSessionManagerIOS.mm:
3196         (-[WebMediaSessionHelper allocateVolumeView]):
3197
3198 2015-03-23  Tim Horton  <timothy_horton@apple.com>
3199
3200         Add a share item to the link action menu
3201         https://bugs.webkit.org/show_bug.cgi?id=142961
3202         <rdar://problem/19198374>
3203
3204         Reviewed by Beth Dakin.
3205
3206         * English.lproj/Localizable.strings:
3207         Remove some now-unused strings.
3208
3209         * platform/spi/mac/NSMenuSPI.h:
3210         Add some SPI.
3211
3212 2015-03-23  David Kilzer  <ddkilzer@apple.com>
3213
3214         [iOS] Build fix: CoreText deprecated kCTFontSystemFontType
3215
3216         Fix tracked by:  <rdar://problem/20261171>
3217
3218         * rendering/RenderThemeIOS.mm:
3219         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
3220         Add clang pragmas.
3221
3222 2015-03-23  Brent Fulgham  <bfulgham@apple.com>
3223
3224         Unreviewed test fix.
3225
3226         * css/CSSParser.cpp:
3227         (WebCore::CSSParser::parseScrollSnapDestination): Remove new assertion.
3228
3229 2015-03-23  Brent Fulgham  <bfulgham@apple.com>
3230
3231         scroll-snap-destination and scroll-snap-coordinate do not seem to work together properly
3232         https://bugs.webkit.org/show_bug.cgi?id=142552
3233         <rdar://problem/20114743>
3234
3235         Reviewed by Dean Jackson.
3236
3237         Revise the snap point logic as follows:
3238         (1) Put the snap point destination handling in a helper function to make the rest of the code
3239             easier to read.
3240         (2) Make sure we always have a left-hand snap point (i.e., position 0), but don't add multiple
3241             left-hand snap points.
3242         (3) Create a helper function to determine if we should be working with the scroll snap 'elements'
3243             behavior. We want to use this for scroll-snap-destination/scroll-snap-coordinate markup.
3244         (4) Create per-element snap point offsets when using scroll-snap-destination/scroll-snap-coordinate.
3245
3246         * css/CSSParser.cpp:
3247         (WebCore::CSSParser::parseScrollSnapDestination): Add assertion to try to catch bad parser state.
3248         * page/scrolling/AxisScrollSnapOffsets.cpp:
3249         (WebCore::destinationOffsetForViewSize): Added helper function to consolidate logic for handling
3250         destination coordinates.
3251         (WebCore::updateFromStyle): Make sure a left-hand snap point is always provided.
3252         (WebCore::styleUsesElements): Added helper function.
3253         (WebCore::updateSnapOffsetsForScrollableArea): Revise logic to generate 'per-element' snap point
3254         offsets.
3255
3256 2015-03-23  Yoav Weiss  <yoav@yoav.ws>
3257
3258         Refactor ImageLoader's setting of CachedImage
3259         https://bugs.webkit.org/show_bug.cgi?id=142825
3260
3261         Reviewed by Chris Dumez.
3262
3263         No new tests, since there's no functional change.
3264
3265         setImage and setImageWithoutConsideringPendingLoadEvent were not called with new
3266         CachedImages and were not used as originally intended. That resulted in some dead code,
3267         and confusion when going over the code.
3268         This patch renames these methods into equivalent clearImage* methods, and deletes resulting dead code.
3269
3270         * html/HTMLObjectElement.cpp:
3271         (WebCore::HTMLObjectElement::renderFallbackContent): Changed setImage call to clearImage.
3272         * loader/ImageLoader.cpp:
3273         (WebCore::ImageLoader::clearImage):
3274         (WebCore::ImageLoader::clearImageWithoutConsideringPendingLoadEvent):
3275         (WebCore::ImageLoader::notifyFinished):
3276         (WebCore::ImageLoader::elementDidMoveToNewDocument):
3277         (WebCore::ImageLoader::setImage): Deleted.
3278         (WebCore::ImageLoader::setImageWithoutConsideringPendingLoadEvent): Deleted.
3279         * loader/ImageLoader.h:
3280
3281 2015-03-22  Benjamin Poulain  <benjamin@webkit.org>
3282
3283         CSS Selectors: fix attribute case-insensitive matching of Contain and List
3284         https://bugs.webkit.org/show_bug.cgi?id=142932
3285
3286         Reviewed by Darin Adler.
3287
3288         Fix the last two attribute selectors that were using full case-insensitive
3289         match:
3290             -Contain ([foo*=bar]).
3291             -List (foo~=bar]).
3292
3293         Tests: fast/selectors/attribute-contains-value-matching-is-ascii-case-insensitive.html
3294                fast/selectors/attribute-list-value-matching-is-ascii-case-insensitive.html
3295
3296         * css/SelectorChecker.cpp:
3297         (WebCore::attributeValueMatches):
3298         * cssjit/SelectorCompiler.cpp:
3299         (WebCore::SelectorCompiler::attributeValueContains):
3300         (WebCore::SelectorCompiler::attributeValueSpaceSeparetedListContains):
3301
3302 2015-03-22  Benjamin Poulain  <bpoulain@apple.com>
3303
3304         Detect when url filter pattern with groups match the empty string
3305         https://bugs.webkit.org/show_bug.cgi?id=142930
3306
3307         Reviewed by Sam Weinig.
3308
3309         The previous test was only accounting for simple atoms. This patch extends
3310         it to groups.
3311
3312         * contentextensions/URLFilterParser.cpp:
3313         (WebCore::ContentExtensions::Term::quantify):
3314         (WebCore::ContentExtensions::Term::matchesAtLeastOneCharacter):
3315         (WebCore::ContentExtensions::GraphBuilder::finalize):
3316         (WebCore::ContentExtensions::Term::quantifier): Deleted.
3317
3318 2015-03-22  Eric Carlson  <eric.carlson@apple.com>
3319
3320         [Mac] Enable WIRELESS_PLAYBACK_TARGET for WK1
3321         https://bugs.webkit.org/show_bug.cgi?id=142940
3322
3323         Reviewed by Sam Weinig.
3324
3325         * dom/Document.cpp:
3326         (WebCore::Document::didChoosePlaybackTarget): const-ify the didChoosePlaybackTarget argument.
3327         * dom/Document.h:
3328
3329         * html/HTMLMediaSession.cpp:
3330         (WebCore::HTMLMediaSession::didChoosePlaybackTarget): Ditto.
3331         * html/HTMLMediaSession.h:
3332
3333         * page/Page.cpp:
3334         (WebCore::Page::didChoosePlaybackTarget):  Ditto.
3335         * page/Page.h:
3336
3337         * platform/audio/MediaSession.h:
3338         * platform/graphics/MediaPlaybackTargetPickerClient.h:
3339         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: 
3340         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):  Ditto.
3341
3342 2015-03-22  Anders Carlsson  <andersca@apple.com>
3343
3344         _WKWebsiteDataStore should clear WebSQL databases
3345         https://bugs.webkit.org/show_bug.cgi?id=142947
3346
3347         Reviewed by Sam Weinig.
3348
3349         * Modules/webdatabase/DatabaseTracker.cpp:
3350         (WebCore::DatabaseTracker::trackerWithDatabasePath):
3351         Add a hack so we can get at a tracker from the UI process.
3352
3353         (WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
3354         New function that deletes all databases modified after a given time.
3355
3356         * Modules/webdatabase/DatabaseTracker.h:
3357         Add new members and export the ones we want to call from WebKit2.
3358
3359         * Modules/webdatabase/OriginLock.h:
3360         Export the destructor.
3361
3362 2015-03-21  Dean Jackson  <dino@apple.com>
3363
3364         Remove the prefix for CSS Transforms
3365         https://bugs.webkit.org/show_bug.cgi?id=142927
3366         <rdar://problem/11568151>
3367
3368         Reviewed by Simon Fraser.
3369
3370         Support the bare form of:
3371         - transform
3372         - transform-style
3373         - transform-origin
3374         - perspective
3375         - perspective-origin
3376
3377         For transform-style, we also still differentiate the prefixed property
3378         because we may want to use that as an indicator of legacy content.
3379
3380         This is mostly a find and replace, but with some related naming
3381         changes. The DOM interface for WebKitCSSTransformValue remains
3382         unchanged.
3383
3384         Tests: transforms/2d/transform-2d-prefixed.html
3385                transforms/3d/general/prefixed-3dtransform-values.html
3386
3387         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3388         (WebCore::propertyChangeMayRepaintNonDescendants):
3389         * css/CSSComputedStyleDeclaration.cpp:
3390         (WebCore::isLayoutDependent):
3391         (WebCore::ComputedStyleExtractor::propertyValue):
3392         * css/CSSParser.cpp:
3393         (WebCore::isValidKeywordPropertyAndValue):
3394         (WebCore::isKeywordPropertyID):
3395         (WebCore::parseTranslateTransformValue):
3396         (WebCore::CSSParser::parseValue):
3397         (WebCore::CSSParser::parseTransformOrigin):
3398         (WebCore::CSSParser::parsePerspectiveOrigin):
3399         * css/CSSPropertyNames.in:
3400         * css/StyleProperties.cpp:
3401         (WebCore::StyleProperties::getPropertyValue):
3402         (WebCore::StyleProperties::asText):
3403         * css/WebKitCSSMatrix.cpp:
3404         (WebCore::WebKitCSSMatrix::setMatrixValue):
3405         * html/track/VTTCue.cpp:
3406         (WebCore::VTTCueBox::applyCSSProperties):
3407         * page/animation/AnimationController.cpp:
3408         (WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
3409         * page/animation/CSSPropertyAnimation.cpp:
3410         (WebCore::PropertyWrapperAcceleratedTransform::PropertyWrapperAcceleratedTransform):
3411         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
3412         * page/animation/CompositeAnimation.cpp:
3413         (WebCore::CompositeAnimation::computeExtentOfTransformAnimation):
3414         * page/animation/ImplicitAnimation.cpp:
3415         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation):
3416         * page/animation/KeyframeAnimation.cpp:
3417         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
3418         (WebCore::KeyframeAnimation::validateTransformFunctionList):
3419         * platform/graphics/GraphicsLayer.cpp:
3420         (WebCore::GraphicsLayer::validateTransformOperations):
3421         * platform/graphics/GraphicsLayerClient.h:
3422         * platform/graphics/ca/GraphicsLayerCA.cpp:
3423         (WebCore::propertyIdToString):
3424         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
3425         (WebCore::GraphicsLayerCA::addAnimation):
3426         (WebCore::GraphicsLayerCA::isRunningTransformAnimation):
3427         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
3428         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
3429         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
3430         (WebCore::GraphicsLayerTextureMapper::addAnimation):
3431         * platform/graphics/texmap/TextureMapperAnimation.cpp:
3432         (WebCore::TextureMapperAnimation::applyInternal):
3433         * platform/graphics/texmap/TextureMapperLayer.cpp:
3434         (WebCore::TextureMapperLayer::syncAnimations):
3435         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3436         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHasActiveTransformAnimation):
3437         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms):
3438         (WebCore::CoordinatedGraphicsLayer::addAnimation):
3439         * rendering/RenderLayerBacking.cpp:
3440         (WebCore::RenderLayerBacking::updateGeometry):
3441         (WebCore::RenderLayerBacking::startAnimation):
3442         (WebCore::RenderLayerBacking::startTransition):
3443         (WebCore::RenderLayerBacking::graphicsLayerToCSSProperty):
3444         (WebCore::RenderLayerBacking::cssToGraphicsLayerProperty):
3445         * rendering/RenderLayerCompositor.cpp:
3446         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
3447         (WebCore::RenderLayerCompositor::isRunningTransformAnimation):
3448         * svg/SVGElement.cpp:
3449         (WebCore::populateAttributeNameToCSSPropertyIDMap):
3450
3451 2015-03-21  Commit Queue  <commit-queue@webkit.org>
3452
3453         Unreviewed, rolling out r181824.
3454         https://bugs.webkit.org/show_bug.cgi?id=142935
3455
3456         Broke Windows build (Requested by ap on #webkit).
3457
3458         Reverted changeset:
3459
3460         "Remove the prefix for CSS Transforms"
3461         https://bugs.webkit.org/show_bug.cgi?id=142927
3462         http://trac.webkit.org/changeset/181824
3463
3464 2015-03-20  Dean Jackson  <dino@apple.com>
3465
3466         Remove the prefix for CSS Transforms
3467         https://bugs.webkit.org/show_bug.cgi?id=142927
3468         <rdar://problem/11568151>
3469
3470         Reviewed by Simon Fraser.
3471
3472         Support the bare form of:
3473         - transform
3474         - transform-style
3475         - transform-origin
3476         - perspective
3477         - perspective-origin
3478
3479         For transform-style, we also still differentiate the prefixed property
3480         because we may want to use that as an indicator of legacy content.
3481
3482         This is mostly a find and replace, but with some related naming
3483         changes. The DOM interface for WebKitCSSTransformValue remains
3484         unchanged.
3485
3486         Tests: transforms/2d/transform-2d-prefixed.html
3487                transforms/3d/general/prefixed-3dtransform-values.html
3488
3489         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3490         (WebCore::propertyChangeMayRepaintNonDescendants):
3491         * css/CSSComputedStyleDeclaration.cpp:
3492         (WebCore::isLayoutDependent):
3493         (WebCore::ComputedStyleExtractor::propertyValue):
3494         * css/CSSParser.cpp:
3495         (WebCore::isValidKeywordPropertyAndValue):
3496         (WebCore::isKeywordPropertyID):
3497         (WebCore::parseTranslateTransformValue):
3498         (WebCore::CSSParser::parseValue):
3499         (WebCore::CSSParser::parseTransformOrigin):
3500         (WebCore::CSSParser::parsePerspectiveOrigin):
3501         * css/CSSPropertyNames.in:
3502         * css/StyleProperties.cpp:
3503         (WebCore::StyleProperties::getPropertyValue):
3504         (WebCore::StyleProperties::asText):
3505         * css/WebKitCSSMatrix.cpp:
3506         (WebCore::WebKitCSSMatrix::setMatrixValue):
3507         * html/track/VTTCue.cpp:
3508         (WebCore::VTTCueBox::applyCSSProperties):
3509         * page/animation/AnimationController.cpp:
3510         (WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
3511         * page/animation/CSSPropertyAnimation.cpp:
3512         (WebCore::PropertyWrapperAcceleratedTransform::PropertyWrapperAcceleratedTransform):
3513         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
3514         * page/animation/CompositeAnimation.cpp:
3515         (WebCore::CompositeAnimation::computeExtentOfTransformAnimation):
3516         * page/animation/ImplicitAnimation.cpp:
3517         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation):
3518         * page/animation/KeyframeAnimation.cpp:
3519         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
3520         (WebCore::KeyframeAnimation::validateTransformFunctionList):
3521         * platform/graphics/GraphicsLayer.cpp:
3522         (WebCore::GraphicsLayer::validateTransformOperations):
3523         * platform/graphics/GraphicsLayerClient.h:
3524         * platform/graphics/ca/GraphicsLayerCA.cpp:
3525         (WebCore::propertyIdToString):
3526         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
3527         (WebCore::GraphicsLayerCA::addAnimation):
3528         (WebCore::GraphicsLayerCA::isRunningTransformAnimation):
3529         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
3530         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
3531         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
3532         (WebCore::GraphicsLayerTextureMapper::addAnimation):
3533         * platform/graphics/texmap/TextureMapperAnimation.cpp:
3534         (WebCore::TextureMapperAnimation::applyInternal):
3535         * platform/graphics/texmap/TextureMapperLayer.cpp:
3536         (WebCore::TextureMapperLayer::syncAnimations):
3537         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3538         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHasActiveTransformAnimation):
3539         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms):
3540         (WebCore::CoordinatedGraphicsLayer::addAnimation):
3541         * rendering/RenderLayerBacking.cpp:
3542         (WebCore::RenderLayerBacking::updateGeometry):
3543         (WebCore::RenderLayerBacking::startAnimation):
3544         (WebCore::RenderLayerBacking::startTransition):
3545         (WebCore::RenderLayerBacking::graphicsLayerToCSSProperty):
3546         (WebCore::RenderLayerBacking::cssToGraphicsLayerProperty):
3547         * rendering/RenderLayerCompositor.cpp:
3548         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
3549         (WebCore::RenderLayerCompositor::isRunningTransformAnimation):
3550         * svg/SVGElement.cpp:
3551         (WebCore::populateAttributeNameToCSSPropertyIDMap):
3552
3553 2015-03-20  Yusuke Suzuki  <utatane.tea@gmail.com>
3554
3555         REGRESSION (r179429): Potential Use after free in JavaScriptCore`WTF::StringImpl::ref + 83
3556         https://bugs.webkit.org/show_bug.cgi?id=142410
3557
3558         Reviewed by Geoffrey Garen.
3559
3560         The same issues are found in the existing code; PropertyName does not have ownership.
3561         This patch rewrite the point that should have ownership to Identifier.
3562
3563         * bindings/js/JSDOMWindowCustom.cpp:
3564         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
3565         (WebCore::JSDOMWindow::putByIndex):
3566         * bindings/js/ReadableStreamJSSource.cpp:
3567         (WebCore::getInternalSlotFromObject):
3568         * bindings/scripts/CodeGeneratorJS.pm:
3569         (GenerateImplementation):
3570         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3571         (WebCore::JSTestCustomNamedGetter::getOwnPropertySlotByIndex):
3572         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3573         (WebCore::JSTestEventTarget::getOwnPropertySlotByIndex):
3574         * bindings/scripts/test/JS/JSTestInterface.cpp:
3575         (WebCore::JSTestInterface::putByIndex):
3576
3577 2015-03-20  Simon Fraser  <simon.fraser@apple.com>
3578
3579         Log the slow-scrolling reasons (if any) on first commit of a ScrollingTreeFrameScrollingNodeMac
3580         https://bugs.webkit.org/show_bug.cgi?id=142917
3581
3582         Reviewed by Beth Dakin.
3583         
3584         The scrollperf test would fail to detect transitions between slow and fast scrolling
3585         for new pages, because there was no logging when slow-scrolling scrolling tree was
3586         torn down, and a new fast-scrolling tree constructed.
3587         
3588         Fix by always logging the slow-scrolling reasons in the first update of the
3589         ScrollingTreeFrameScrollingNodeMac, even when the slow-scrolling reasons haven't
3590         changed.
3591
3592         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
3593         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3594         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
3595         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
3596
3597 2015-03-19  Geoffrey Garen  <ggaren@apple.com>
3598
3599         Function.prototype.toString should not decompile the AST
3600         https://bugs.webkit.org/show_bug.cgi?id=142853
3601
3602         Reviewed by Sam Weinig.
3603
3604         * bindings/js/JSLazyEventListener.cpp:
3605         (WebCore::JSLazyEventListener::initializeJSFunction): Adjust the line
3606         number of attribute event listeners to account for the leading newline
3607         now added by JavaScriptCore.
3608
3609         This solution is not perfect, but there are a lot of pre-existing problems
3610         with line and column reporting for attribute event listeners, and this
3611         preserves existing behavior with reasonable reliability.
3612
3613 2015-03-20  Alex Christensen  <achristensen@webkit.org>
3614
3615         Progress towards CMake on Mac.
3616         https://bugs.webkit.org/show_bug.cgi?id=136003
3617
3618         Reviewed by Chris Dumez.
3619
3620         * PlatformMac.cmake:
3621         Added some directories to create forwarding headers from.
3622         Generate ObjC bindings.
3623
3624 2015-03-20  Per Arne Vollan  <peavo@outlook.com>
3625
3626         [WinCairo] Crash when leaving page while video is playing.
3627         https://bugs.webkit.org/show_bug.cgi?id=142578
3628
3629         Reviewed by Alex Christensen.
3630
3631         This can happen when there is an asynchronous event invoked from a video worker
3632         thread, accessing the media player object after it has been deleted.
3633         This is solved by resetting the media player pointer in the event object,
3634         when the media player is deleted.
3635
3636         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3637         (WebCore::MediaPlayerPrivateMediaFoundation::~MediaPlayerPrivateMediaFoundation):
3638         (WebCore::MediaPlayerPrivateMediaFoundation::addListener):
3639         (WebCore::MediaPlayerPrivateMediaFoundation::removeListener):
3640         (WebCore::MediaPlayerPrivateMediaFoundation::notifyDeleted):
3641         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::AsyncCallback):
3642         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::~AsyncCallback):
3643         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::Invoke):
3644         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::onMediaPlayerDeleted):
3645         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
3646         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerListener::MediaPlayerListener):
3647         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerListener::~MediaPlayerListener):
3648         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerListener::onMediaPlayerDeleted):
3649
3650 2015-03-20  Chris Dumez  <cdumez@apple.com>
3651
3652         Regression(r181782): Caused WebKit2.RestoreSessionStateContainingFormData API test to crash
3653         https://bugs.webkit.org/show_bug.cgi?id=142911
3654
3655         Reviewed by Antti Koivisto.
3656
3657         Drop the isBackForwardLoadType(m_loadType) assertion in
3658         FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad(). This assertion
3659         used to hold true when goToBackForwardItem() was only called with
3660         history navigation load types. However, after r181782, we use a Standard
3661         load in the cases where we do not wish to display stale content (e.g.
3662         restoring session state).
3663
3664         The assertion comment says "We only use cache-only loads to avoid
3665         resubmitting forms". However, we then call loadDifferentDocumentItem()
3666         which already takes care of using the ReturnCacheDataElseLoad cache
3667         policy as the HistoryItem has form data and we pass
3668         MayNotAttemptCacheOnlyLoadForFormSubmissionItem as parameter.
3669
3670         No new tests, covered by WebKit2.RestoreSessionStateContainingFormData
3671         API test.
3672
3673         * loader/FrameLoader.cpp:
3674         (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
3675
3676 2015-03-20  Andy Estes  <aestes@apple.com>
3677
3678         [Content Filtering] Adopt NEFilterSource unblock handling
3679         https://bugs.webkit.org/show_bug.cgi?id=142904
3680
3681         Reviewed by Andreas Kling.
3682
3683         * platform/cocoa/NetworkExtensionContentFilter.mm:
3684         (WebCore::NetworkExtensionContentFilter::unblockHandler):
3685         Returned an unblock handler that calls -[NEFilterSource remediateWithDecisionHandler:].
3686         * platform/cocoa/ParentalControlsContentFilter.mm:
3687         (WebCore::ParentalControlsContentFilter::unblockHandler): Used ASCIILiteral.
3688
3689 2015-03-19  Andy Estes  <aestes@apple.com>
3690
3691         [Content Filtering] Add tests for unblock requests
3692         https://bugs.webkit.org/show_bug.cgi?id=142900
3693
3694         Reviewed by Andreas Kling.
3695
3696         Currently the iOS Parental Controls content filter has a mechanism for requesting that a page be unblocked.
3697         WebKit implements this by listening for navigations originating from the filter's error page to a special URL,
3698         and requesting the page be unblocked via platform API, which might cause UI to be displayed. If the unblock is
3699         successful then we schedule a reload of the frame in order to display the unblocked document.
3700
3701         NetworkExtension also supports unblock requests, so in preparation for adopting its API, this patch allows
3702         content filters to specify their own unblock request method, teaches MockContentFilter to provide such a method,
3703         and writes tests to cover both allowed and denied unblock requests.
3704
3705         The content filter that blocks a load creates a ContentFilterUnblockHandler, passing it a lambda that is executed
3706         when a navigation matches the filter's special unblock URL. Filters can also specify that a script be executed in
3707         the context of its error page if the unblock is denied.
3708
3709         All platform content filters can handle unblock requests like this with the exception of iOS Parental Controls in WebKit2.
3710         Since UI can be displayed by the system in this case, the request must be made from within the UI process. Therefore the
3711         existing method is retained of serializing a WebFilterEvaluator and intercepting navigation policy calls in the UI process.
3712
3713         Tests: contentfiltering/allow-after-unblock-request.html
3714                contentfiltering/block-after-unblock-request.html
3715
3716         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
3717         (WebCore::JSMockContentFilterSettings::decisionPoint): Added some using statements for clarity.
3718         (WebCore::JSMockContentFilterSettings::setDecisionPoint): Ditto.
3719         (WebCore::toJSValue): Returns a JSValue from a Decision.
3720         (WebCore::toDecision): Returns a Decision from a JSValue.
3721         (WebCore::JSMockContentFilterSettings::decision): Used toJSValue.
3722         (WebCore::JSMockContentFilterSettings::setDecision): Used toDecision.
3723         (WebCore::JSMockContentFilterSettings::unblockRequestDecision): Used toJSValue.
3724         (WebCore::JSMockContentFilterSettings::setUnblockRequestDecision): Used toDecision.
3725         * loader/ContentFilter.cpp:
3726         (WebCore::ContentFilter::createIfNeeded): Passed a reference to the owning DocumentLoader.
3727         (WebCore::ContentFilter::ContentFilter): Ditto.
3728         (WebCore::ContentFilter::unblockHandler): If the unblockHandler requests that a script be executed when an
3729         unblock request is denied, create a wrapper unblockHandler that executes that script in m_documentLoader's frame.
3730         * loader/ContentFilter.h:
3731         * loader/DocumentLoader.cpp:
3732         (WebCore::DocumentLoader::responseReceived): Passed this to ContentFilter::createIfNeeded.
3733         * loader/FrameLoader.cpp:
3734         (WebCore::FrameLoader::prepareForLoadStart): Called PolicyChecker::prepareForLoadStart.
3735         * loader/PolicyChecker.cpp:
3736         (WebCore::PolicyChecker::prepareForLoadStart): Reset m_contentFilterUnblockHandler.
3737         (WebCore::PolicyChecker::checkNavigationPolicy): Moved logic to here from WebKit1's WebFrameLoaderClient.
3738         Placing it here allows it to be shared between WebKit1 and WebKit2 (when the unblock handler does not need to
3739         be called in the UI process).
3740         * loader/PolicyChecker.h:
3741         (WebCore::PolicyChecker::setContentFilterUnblockHandler): Added.
3742         * page/Frame.h: Made Frame ThreadSafeRefCounted, since RefPtr<Frames> are captured in lambdas that can be
3743         copied by background threads managed by the underlying platform.
3744         * platform/ContentFilterUnblockHandler.h:
3745         (WebCore::ContentFilterUnblockHandler::unblockURLScheme): Returned the Apple content filter scheme.
3746         (WebCore::ContentFilterUnblockHandler::unblockURLHost): Returned the unblock URL host.
3747         (WebCore::ContentFilterUnblockHandler::clear): Deleted.
3748         * platform/PlatformContentFilter.h:
3749         (WebCore::PlatformContentFilter::unblockRequestDeniedScript): Returned the unblock request denied script.
3750         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
3751         (WebCore::ContentFilterUnblockHandler::ContentFilterUnblockHandler): Added a constructor that takes an
3752         unblockURLHost and a UnblockRequesterFunction. Added an alternate constructor for iOS Parental Controls on
3753         WebKit2 that takes an unblockURLHost and a WebFilterEvaluator.
3754         (WebCore::ContentFilterUnblockHandler::needsUIProcess): Returned true if m_webFilterEvaluator is non-null.
3755         (WebCore::ContentFilterUnblockHandler::encode): Encoded m_unblockURLHost in addition to m_webFilterEvaluator.
3756         (WebCore::ContentFilterUnblockHandler::decode): Decoded m_unblockURLHost in addition to m_webFilterEvaluator.
3757         (WebCore::ContentFilterUnblockHandler::canHandleRequest): Returned true if there is a either a m_unblockRequester
3758         or a m_webFilterEvaluator and the request's host and scheme match those of the unblock request URL.
3759         (WebCore::dispatchToMainThread): Added a helper to dispatch a block to the main thread. Then if the web thread
3760         is enabled on iOS, dispatch it there.
3761         (WebCore::ContentFilterUnblockHandler::requestUnblockAsync): Renamed from handleUnblockRequestAndDispatchIfSuccessful.
3762         Requested an unblock using either m_unblockRequester or m_webFilterEvaluator, then called decisionHandler with the response.
3763         (WebCore::scheme): Moved to ContentFilterUnblockHandler::unblockURLScheme.
3764         (WebCore::ContentFilterUnblockHandler::handleUnblockRequestAndDispatchIfSuccessful): Renamed to requestUnblockAsync.
3765         * platform/cocoa/ParentalControlsContentFilter.mm:
3766         (WebCore::ParentalControlsContentFilter::unblockHandler): Returned an unblock handler using the WebFilterEvaluator constructor.
3767         * testing/MockContentFilter.cpp: Added using statments for clarity.
3768         (WebCore::settings): Added a helper to get MockContentFilterSettings::singleton().
3769         (WebCore::MockContentFilter::canHandleResponse): Used the helper.
3770         (WebCore::MockContentFilter::MockContentFilter): Took advantage of the using statements.
3771         (WebCore::MockContentFilter::addData): Ditto.
3772         (WebCore::MockContentFilter::finishedAddingData): Ditto.
3773         (WebCore::MockContentFilter::unblockHandler): Returned a ContentFilterUnblockHandler that checks settings() for its decision.
3774         (WebCore::MockContentFilter::unblockRequestDeniedScript): Returned the script to execute in MockContentFilter's
3775         error page when an unblock request is denied.
3776         (WebCore::MockContentFilter::maybeDetermineStatus): Took advantage of settings() and using statements.
3777         * testing/MockContentFilterSettings.cpp:
3778         (WebCore::MockContentFilterSettings::unblockRequestURL): Constructed a static unblock URL and returned it.
3779         * testing/MockContentFilterSettings.h:
3780         (WebCore::MockContentFilterSettings::unblockURLHost): Returned the filter's unblock URL host.
3781         (WebCore::MockContentFilterSettings::unblockRequestDecision): Returns the decision to make for an unblock request.
3782         (WebCore::MockContentFilterSettings::setUnblockRequestDecision): Sets the decision to make for an unblock request.
3783         * testing/MockContentFilterSettings.idl: Added the unblockRequestDecision and unblockRequestURL attributes.
3784
3785 2015-03-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3786
3787         [GTK] Crash due to empty drag image during drag-and-drop
3788         https://bugs.webkit.org/show_bug.cgi?id=142671
3789
3790         Reviewed by Philippe Normand.
3791
3792         Return early from ImageBuffer constructor if an empty size is
3793         given. This is a speculative fix for a crash while starting a drag
3794         and drop operation, that I haven't been able to reproduce.
3795
3796         * platform/graphics/cairo/ImageBufferCairo.cpp:
3797         (WebCore::ImageBuffer::ImageBuffer):
3798
3799 2015-03-19  Chris Dumez  <cdumez@apple.com>
3800
3801         [WK2] We should allow stale content when restoring a killed / crashed WebProcess
3802         https://bugs.webkit.org/show_bug.cgi?id=142893
3803         <rdar://problem/19633737>
3804         <rdar://problem/19869257>
3805
3806         Reviewed by Antti Koivisto.
3807
3808         Always use ReturnCacheDataElseLoad cache policy for history navigations.
3809         Previously, we would use the default protocol cache policy for history
3810         navigations if m_stateMachine.committedFirstRealDocumentLoad() returned
3811         false so that we do not display stale content when restoring the session
3812         state of Safari statup (rdar://problem/8131355). This is now handled
3813         before reaching this method by no longer using "IndexedBackForward"
3814         FrameLoadType when restoring session tabs, and using "Standard" load
3815         type instead.
3816
3817         * loader/FrameLoader.cpp:
3818         (WebCore::FrameLoader::loadDifferentDocumentItem):
3819
3820 2015-03-19  Andy Estes  <aestes@apple.com>
3821
3822         [Content Filtering] Move ContentFilter to from platform/ to loader/
3823         https://bugs.webkit.org/show_bug.cgi?id=142897
3824
3825         Reviewed by Dan Bernstein.
3826
3827         ContentFilterCollection never contained any platform code, so it doesn't make sense for it to be in platform.
3828         Move it to loader/, since ContentFilters are owned by DocumentLoaders, and just call it ContentFilter. Extract
3829         the abstract part of ContentFilter into a new base class called PlatformContentFilter that each of the
3830         individual filters inherit from.
3831
3832         * WebCore.xcodeproj/project.pbxproj:
3833         * loader/ContentFilter.cpp: Renamed from Source/WebCore/platform/ContentFilter.cpp.
3834         (WebCore::ContentFilter::types): Moved from ContentFilterCollection.
3835         (WebCore::ContentFilter::createIfNeeded): Ditto.
3836         (WebCore::ContentFilter::ContentFilter): Ditto.
3837         (WebCore::ContentFilter::addData): Ditto.
3838         (WebCore::ContentFilter::finishedAddingData): Ditto.
3839         (WebCore::ContentFilter::needsMoreData): Ditto.
3840         (WebCore::ContentFilter::didBlockData): Ditto.
3841         (WebCore::ContentFilter::getReplacementData): Ditto.
3842         (WebCore::ContentFilter::unblockHandler): Ditto.
3843         * loader/ContentFilter.h: Copied from Source/WebCore/platform/ContentFilter.h.
3844         (WebCore::ContentFilter::type): Replaced a use of ContentFilterCollection.
3845         * platform/PlatformContentFilter.h: Renamed from Source/WebCore/platform/ContentFilter.h.
3846         * platform/cocoa/NetworkExtensionContentFilter.h: Inherited from PlatformContentFilter.
3847         * platform/cocoa/ParentalControlsContentFilter.h: Ditto.
3848         * testing/MockContentFilter.h: Ditto.
3849
3850 2015-03-19  Dean Jackson  <dino@apple.com>
3851
3852         CSS Animations with triggers should map scroll position to duration
3853         https://bugs.webkit.org/show_bug.cgi?id=142870
3854         <rdar://problem/20227244>
3855
3856         Reviewed by Simon Fraser.
3857
3858         Expose a prototype implementation of what will eventually be called
3859         animation-timebase, mapping the scroll location to the duration of an
3860         animation. This only applies if the animation has a start and end
3861         trigger.
3862
3863         Test: animations/trigger-container-scroll-boundaries.html
3864
3865         * css/CSSComputedStyleDeclaration.cpp:
3866         (WebCore::createAnimationTriggerValue): Change to downcast.
3867
3868         * css/CSSToStyleMap.cpp:
3869         (WebCore::CSSToStyleMap::mapAnimationTrigger): Fix a bug where I wasn't
3870         telling the ScrollAnimationTrigger object whether or not it had
3871         an end value. This wasn't visible before because we were not using
3872         the end value.
3873
3874         * page/animation/AnimationBase.cpp:
3875         (WebCore::AnimationBase::fireAnimationEventsIfNeeded): Add a comment and
3876         change to using a downcast.
3877         (WebCore::AnimationBase::timeToNextService): Change to downcast.
3878         (WebCore::AnimationBase::freezeAtTime): Whitespace cleanup.
3879         (WebCore::AnimationBase::getElapsedTime): Calculate the elapsedTime based
3880         on the scroll position relative to the start and end trigger spots.
3881
3882         * page/animation/AnimationController.cpp:
3883         (WebCore::AnimationControllerPrivate::updateAnimations): Since this
3884         can potentially call into beginAnimationUpdateTime, it should have
3885         an update blocker. This fixes the assert we were seeing in tests.
3886         (WebCore::AnimationControllerPrivate::scrollWasUpdated): Keep track of the scroll
3887         position so we don't need to ask for it all the time.
3888         * page/animation/AnimationControllerPrivate.h:
3889         (WebCore::AnimationControllerPrivate::scrollPosition): New accessor.
3890
3891         * platform/animation/AnimationTrigger.h: Add downcast macros.
3892         (WebCore::ScrollAnimationTrigger::create): Calculate hasEndValue from the passed
3893         parameters rather than a separate value.
3894         (WebCore::ScrollAnimationTrigger::hasEndValue):
3895         (WebCore::ScrollAnimationTrigger::ScrollAnimationTrigger):
3896         (WebCore::ScrollAnimationTrigger::setHasEndValue): Deleted.
3897
3898         * platform/graphics/ca/GraphicsLayerCA.cpp:
3899         (WebCore::GraphicsLayerCA::animationCanBeAccelerated): If we have an
3900         animation of this sort, we can't use a CAAnimation.
3901
3902 2015-03-19  Eric Carlson  <eric.carlson@apple.com>
3903
3904         [Mac] Move MediaPlaybackTargetPicker
3905         https://bugs.webkit.org/show_bug.cgi?id=142889
3906
3907         Move WebMediaPlaybackTargetPickerProxy from WK2 and rename as MediaPlaybackTargetPicker so it
3908         can be used by both WK2 and WK1.
3909
3910         Reviewed by Tim Horton.
3911
3912         * WebCore.xcodeproj/project.pbxproj:
3913         * platform/graphics/MediaPlaybackTargetPicker.cpp: Copied from Source/WebKit2/UIProcess/WebMediaPlaybackTargetPickerProxy.cpp.
3914         * platform/graphics/MediaPlaybackTargetPicker.h: Copied from Source/WebKit2/UIProcess/WebMediaPlaybackTargetPickerProxy.h.
3915         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h: Copied from Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h.
3916         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: Copied from Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm.
3917
3918 2015-03-19  Enrica Casucci  <enrica@apple.com>
3919
3920         REGRESSION (r109593): Clicking after last inline element could cause a crash.
3921         https://bugs.webkit.org/show_bug.cgi?id=142880
3922         rdar://problem/17222294
3923
3924         Reviewed by Ryosuke Niwa.
3925
3926         Test: editing/selection/click-after-last-inline-crash.html
3927
3928         * rendering/RootInlineBox.cpp:
3929         (WebCore::RootInlineBox::closestLeafChildForLogicalLeftPosition):
3930
3931 2015-03-19  Enrica Casucci  <enrica@apple.com>
3932
3933         One more build fix after r181760.
3934
3935         * page/EventHandler.cpp:
3936         (WebCore::EventHandler::handleDrag):
3937
3938 2015-03-19  Jessie Berlin  <jberlin@webkit.org>