Update inline media control icons for OSX.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-03-05  Roger Fong  <roger_fong@apple.com>
2
3         Update inline media control icons for OSX.
4         https://bugs.webkit.org/show_bug.cgi?id=142305.
5         <rdar://problem/19997484>
6
7         Reviewed by Dean Jackson.
8
9         Changes include: new volume button, new full screen button, new play/pause button.
10         Repositioning of 30 second and play buttons.
11         * Modules/mediacontrols/mediaControlsApple.css:
12         (audio::-webkit-media-controls-panel button):
13         (audio::-webkit-media-controls-rewind-button):
14         (audio::-webkit-media-controls-play-button):
15         (audio::-webkit-media-controls-play-button.paused):
16         (audio::-webkit-media-controls-panel .mute-box):
17         (video::-webkit-media-controls-volume-max-button):
18         (video::-webkit-media-controls-volume-min-button):
19         (audio::-webkit-media-controls-toggle-closed-captions-button):
20         (audio::-webkit-media-controls-fullscreen-button):
21         (audio::-webkit-media-controls-current-time-display):
22         * Modules/mediacontrols/mediaControlsApple.js:
23         (Controller.prototype.configureInlineControls): Swap positions of rewind and play buttons.
24         (Controller.prototype.handleMuteButtonClicked): Remember to update volume slider when necessary.
25         (Controller.prototype.updateVolume): Ditto
26
27 2015-03-05  David Hyatt  <hyatt@apple.com>
28
29         Caps lock indicator in text fields is laying out in the wrong place.
30         https://bugs.webkit.org/show_bug.cgi?id=142352
31
32         Reviewed by Dean Jackson.
33
34         * css/html.css:
35         (input::-webkit-caps-lock-indicator):
36         Change the CSS to give the SVG image an intrinsic size, and to use align-self:stretch so that
37         the image always stretches to fill the height of the text box. Get rid of height:100%, as that
38         just resolves to auto in strict mode and was not ever going to work there.
39
40 2015-03-04  Dean Jackson  <dino@apple.com>
41
42         [iOS Media] Use a blurry background for media controls
43         https://bugs.webkit.org/show_bug.cgi?id=142316
44         <rdar://problem/14911098>
45
46         Reviewed by Eric Carlson.
47
48         Start using the -webkit-appearance media-controls-light-bar-background
49         in order to get the blurry background of media controls.
50
51         * Modules/mediacontrols/mediaControlsApple.js: Keep the panel and the
52         panel background in sync when it comes to hiding and showing. It would
53         be better if this could be done on a container element in the future.
54         (Controller.prototype.handlePanelTransitionEnd):
55         (Controller.prototype.setPlaying):
56         (Controller.prototype.showControls):
57         (Controller.prototype.hideControls):
58
59         * Modules/mediacontrols/mediaControlsiOS.css: New background container
60         with the special appearance. I also renamed "composited-parent" to
61         "container", which makes more sense.
62         (video::-webkit-media-controls-panel-container):
63         (audio::-webkit-media-controls-panel-container):
64         (video::-webkit-media-controls-panel-background):
65         (audio::-webkit-media-controls-panel-background):
66         (video::-webkit-media-controls-panel-background.paused):
67         (video::-webkit-media-controls-panel):
68         (audio::-webkit-media-controls-panel):
69         (video::-webkit-media-controls-panel.paused):
70         (audio::-webkit-media-controls-optimized-fullscreen-button):
71         (audio::-webkit-media-controls-timeline):
72         (audio::-webkit-media-controls-timeline::-webkit-slider-thumb):
73         (video::-webkit-media-controls-panel-composited-parent): Deleted.
74         (video::-webkit-media-controls-panel:hover): Deleted.
75
76         * Modules/mediacontrols/mediaControlsiOS.js:
77         (ControllerIOS.prototype.createControls): Create the new background element.
78         (ControllerIOS.prototype.addControls):
79         (ControllerIOS.prototype.set pageScaleFactor): Temporarily disable
80         this because the background disappears when the zoom factor
81         is too high - we start tiling the background. This will be addressed
82         by https://bugs.webkit.org/show_bug.cgi?id=142317.
83
84 2015-03-05  Myles C. Maxfield  <mmaxfield@apple.com>
85
86         Mechanical text-related cleanup
87         https://bugs.webkit.org/show_bug.cgi?id=142326
88
89         Reviewed by Andreas Kling.
90
91         Use nullptr instead of 0.
92         Use references instead of pointers.
93
94         No new tests because there is no behavior change.
95
96         * platform/graphics/cocoa/FontCascadeCocoa.mm:
97         (WebCore::FontCascade::adjustSelectionRectForComplexText):
98         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):
99         (WebCore::FontCascade::floatWidthForComplexText):
100         (WebCore::FontCascade::offsetForPositionForComplexText):
101         * platform/graphics/mac/ComplexTextController.cpp:
102         (WebCore::TextLayout::TextLayout):
103         (WebCore::ComplexTextController::ComplexTextController):
104         * platform/graphics/mac/ComplexTextController.h:
105         * rendering/InlineIterator.h:
106         (WebCore::InlineIterator::InlineIterator):
107         (WebCore::InlineIterator::clear):
108         (WebCore::bidiNextShared):
109         (WebCore::bidiNextSkippingEmptyInlines):
110         (WebCore::bidiNextIncludingEmptyInlines):
111         (WebCore::InlineWalker::InlineWalker):
112         (WebCore::InlineIterator::increment):
113         * rendering/RenderBlockLineLayout.cpp:
114         (WebCore::setLogicalWidthForTextRun):
115         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
116         * rendering/line/BreakingContextInlineHeaders.h:
117         (WebCore::measureHyphenWidth):
118         (WebCore::textWidth):
119         (WebCore::tryHyphenating):
120         (WebCore::BreakingContext::handleText):
121         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
122
123 2015-03-05  Brent Fulgham  <bfulgham@apple.com>
124
125         Move AxisScrollSnapAnimator logic to ScrollController
126         https://bugs.webkit.org/show_bug.cgi?id=142293
127         <rdar://problem/20039867>
128
129         Reviewed by Dean Jackson.
130
131         No change in function.
132
133         Move the animation logic out of 'AxisScrollSnapAnimator' into 'ScrollController'. Rename the remaining
134         bits of 'AxisScrollSnapAnimator' as 'ScrollSnapAnimatorState'. Remove a number of delegate methods required
135         by 'AxisScrollSnapAnimatorClient' that are no longer needed.
136
137         Also, break up some of the Scroll Snap Point math to be a little easier to understand.
138
139         * WebCore.xcodeproj/project.pbxproj: Rename 'platform/mac/AxisScrollSnapAnimator.{h,mm}' -> 'platform/cocoa/ScrollSnapAnimatorState.h'
140         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Mark 'scrollOffsetOnAxis' as const.
141         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
142         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Make 'const'
143         * platform/ScrollAnimator.cpp:
144         (WebCore::ScrollAnimator::scrollOffsetOnAxis): Make 'const'
145         * platform/ScrollAnimator.h:
146         * platform/cocoa/ScrollController.h: No longer subclass from AxisScrollSnapAnimatorClient.
147         * platform/cocoa/ScrollController.mm:
148         (WebCore::ScrollController::scrollSnapPointState): Added accessors (const and non-const) for the individual
149         Scroll Snap State of each axis.
150         (WebCore::toWheelEventStatus): Moved from AxisScrollSnapAnimator.
151         (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Added helper function containing the snap wheel handler code
152         from AxisScrollSnapAnimator.
153         (WebCore::ScrollController::shouldOverrideWheelEvent): Moved from AxisScrollSnapAnimator.
154         (WebCore::ScrollController::processWheelEventForScrollSnap): Update to use new methods moved from AxisScrollSnapAnimator.
155         (WebCore::ScrollController::updateScrollAnimatorsAndTimers): Update for new ScrollSnapAnimatorState class.
156         (WebCore::ScrollController::updateScrollSnapPoints): Ditto.
157         (WebCore::ScrollController::startScrollSnapTimer): Call client (delegate) method.
158         (WebCore::ScrollController::stopScrollSnapTimer): Ditto.
159         (WebCore::ScrollController::horizontalScrollSnapTimerFired): Call new 'scrollSnapAnimationUpdate' method passing the
160         correct axis to animate.
161         (WebCore::ScrollController::verticalScrollSnapTimerFired): Ditto.
162         (WebCore::ScrollController::scrollSnapAnimationUpdate): Moved from AxisScrollSnapAnimator.
163         (WebCore::projectedInertialScrollDistance): Moved from AxisScrollSnapAnimator.
164         (WebCore::ScrollController::initializeGlideParameters): Ditto.
165         (WebCore::ScrollController::beginScrollSnapAnimation): Ditto.
166         (WebCore::ScrollController::endScrollSnapAnimation): Ditto.
167         (WebCore::snapProgress): Created a new function for this calculation to make reasoning about the 'computeSnapDelta' and
168         'computeGlideDelta' easier.
169         (WebCore::clampedSnapMagnitude): Ditto.
170         (WebCore::ScrollController::computeSnapDelta): Moved from AxisScrollSnapAnimator.
171         (WebCore::snapGlide): Created a new function for this calculation to make reasoning about the 'computeGlideDelta' easier.
172         (WebCore::ScrollController::computeGlideDelta): Moved from AxisScrollSnapAnimator.
173         (WebCore::ScrollController::scrollOffsetOnAxis): Deleted.
174         (WebCore::ScrollController::immediateScrollOnAxis): Deleted.
175         * platform/cocoa/ScrollSnapAnimatorState.h: Copied from platform/mac/AxisScrollSnapAnimator.h.
176         (WebCore::AxisScrollSnapAnimatorClient::~AxisScrollSnapAnimatorClient): Deleted.
177         * platform/cocoa/ScrollSnapAnimatorState.mm: Copied from platform/mac/AxisScrollSnapAnimator.mm.
178         (WebCore::ScrollSnapAnimatorState::ScrollSnapAnimatorState):
179         (WebCore::ScrollSnapAnimatorState::pushInitialWheelDelta):
180         (WebCore::ScrollSnapAnimatorState::averageInitialWheelDelta):
181         (WebCore::ScrollSnapAnimatorState::clearInitialWheelDeltaWindow):
182         (WebCore::toWheelEventStatus): Deleted.
183         (WebCore::projectedInertialScrollDistance): Deleted.
184         (WebCore::AxisScrollSnapAnimator::AxisScrollSnapAnimator): Deleted.
185         (WebCore::AxisScrollSnapAnimator::handleWheelEvent): Deleted.
186         (WebCore::AxisScrollSnapAnimator::shouldOverrideWheelEvent): Deleted.
187         (WebCore::AxisScrollSnapAnimator::scrollSnapAnimationUpdate): Deleted.
188         (WebCore::AxisScrollSnapAnimator::beginScrollSnapAnimation): Deleted.
189         (WebCore::AxisScrollSnapAnimator::endScrollSnapAnimation): Deleted.
190         (WebCore::AxisScrollSnapAnimator::computeSnapDelta): Deleted.
191         (WebCore::AxisScrollSnapAnimator::computeGlideDelta): Deleted.
192         (WebCore::AxisScrollSnapAnimator::initializeGlideParameters): Deleted.
193         (WebCore::AxisScrollSnapAnimator::pushInitialWheelDelta): Deleted.
194         (WebCore::AxisScrollSnapAnimator::averageInitialWheelDelta): Deleted.
195         (WebCore::AxisScrollSnapAnimator::clearInitialWheelDeltaWindow): Deleted.
196         * platform/mac/AxisScrollSnapAnimator.h: Removed.
197         * platform/mac/AxisScrollSnapAnimator.mm: Removed.
198         * platform/mac/ScrollAnimatorMac.h:
199         * platform/mac/ScrollAnimatorMac.mm:
200         (WebCore::ScrollAnimatorMac::pinnedInDirection): Removed.
201
202 2015-03-04  Dean Jackson  <dino@apple.com>
203
204         [iOS Media] Small inline controls can clip the time widgets
205         https://bugs.webkit.org/show_bug.cgi?id=142319
206
207         Reviewed by Eric Carlson.
208
209         Start counting the number of digits in a duration so that
210         we can assign classes to the time widgets that specify
211         a minimum width.
212
213         * Modules/mediacontrols/mediaControlsApple.css: Replace the hour-long and ten-hour-long
214         classes with number of digits.
215         (audio::-webkit-media-controls-time-remaining-display.five-digit-time):
216         (audio::-webkit-media-controls-current-time-display.five-digit-time):
217         (audio::-webkit-media-controls-time-remaining-display.six-digit-time):
218         (audio::-webkit-media-controls-current-time-display.six-digit-time):
219         (audio::-webkit-media-controls-time-remaining-display.hour-long-time): Deleted.
220         (audio::-webkit-media-controls-current-time-display.hour-long-time): Deleted.
221         (audio::-webkit-media-controls-time-remaining-display.ten-hour-long-time): Deleted.
222         (audio::-webkit-media-controls-current-time-display.ten-hour-long-time): Deleted.
223
224         * Modules/mediacontrols/mediaControlsApple.js: Add some new class names.
225         (Controller.prototype.updateDuration): Set the class of the time
226         widgets when we know how long the media runs.
227
228         * Modules/mediacontrols/mediaControlsiOS.css: Values for iOS that
229         are big enough to avoid clipping.
230         (video::-webkit-media-controls-current-time-display):
231         (video::-webkit-media-controls-time-remaining-display):
232         (video::-webkit-media-controls-current-time-display.three-digit-time):
233         (video::-webkit-media-controls-time-remaining-display.three-digit-time):
234         (video::-webkit-media-controls-current-time-display.four-digit-time):
235         (video::-webkit-media-controls-time-remaining-display.four-digit-time):
236         (video::-webkit-media-controls-current-time-display.five-digit-time):
237         (video::-webkit-media-controls-time-remaining-display.five-digit-time):
238         (video::-webkit-media-controls-current-time-display.six-digit-time):
239         (video::-webkit-media-controls-time-remaining-display.six-digit-time):
240         (audio::-webkit-media-controls-timeline-container): Deleted.
241         (video::-webkit-media-text-track-container): Deleted.
242
243 2015-03-05  Csaba Osztrogonác  <ossy@webkit.org>
244
245         [cmake] Fix the web replay build
246         https://bugs.webkit.org/show_bug.cgi?id=142331
247
248         Reviewed by Gyuyoung Kim.
249
250         * CMakeLists.txt:
251         * inspector/InspectorReplayAgent.cpp:
252         (WebCore::buildInspectorObjectForSessionState):
253         (WebCore::buildInspectorObjectForSegmentState):
254
255 2015-03-05  Carlos Garcia Campos  <cgarcia@igalia.com>
256
257         [SOUP] Check TLS errors as soon as they are set in the SoupMessage
258         https://bugs.webkit.org/show_bug.cgi?id=142244
259
260         Reviewed by Sergio Villar Senin.
261
262         Connect to the notify::tls-errors signal of SoupMessage to cancel
263         the load earlier in case of TLS failure, preventing any private
264         data from being sent to the server before the TLS errors are checked.
265
266         * platform/network/soup/ResourceHandleSoup.cpp:
267         (WebCore::tlsErrorsChangedCallback):
268         (WebCore::gotHeadersCallback):
269         (WebCore::createSoupMessageForHandleAndRequest):
270
271 2015-03-05  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
272
273         TextCheckingParagraph::isEmpty() is sufficient to check whether paragraph is empty
274         https://bugs.webkit.org/show_bug.cgi?id=142276
275
276         Reviewed by Darin Adler.
277
278         TextCheckingParagraph::isEmpty() already calls TextCheckingParagraph::isRangeEmpty().
279         There is no need to call them both at the caller site.
280
281         No new tests. No behavior change.
282
283         * editing/Editor.cpp:
284         (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
285         Update caller site.
286
287         * editing/TextCheckingHelper.cpp:
288         (WebCore::TextCheckingParagraph::isEmpty):
289         Avoid using helepers here to get rid of them as they are
290         no longer needed outside TextCheckingParagraph.
291
292         * editing/TextCheckingHelper.h:
293         (WebCore::TextCheckingParagraph::isTextEmpty): Deleted.
294         (WebCore::TextCheckingParagraph::isRangeEmpty): Deleted.
295         Do not expose isTextEmpty() and isRangeEmpty().
296
297 2015-03-04  Simon Fraser  <simon.fraser@apple.com>
298
299         Clarify RenderElement::adjustStyleDifference()
300         https://bugs.webkit.org/show_bug.cgi?id=142256
301
302         Reviewed by David Hyatt.
303
304         Make RenderElement::adjustStyleDifference() clearer in two ways.
305         
306         First, replace lots of if (diff < X) diff = X with
307         diff = std::max(diff, X). I did this even in cases where diff was
308         being set unconditionally, because it's never correct to change the diff
309         to a lesser value.
310         
311         Second the "set at least SimplifiedLayout, but if we have PositionedMovementOnly
312         set it to SimplifiedLayoutAndPositionedMovement" was confusingly written.
313
314         * rendering/RenderElement.cpp:
315         (WebCore::RenderElement::adjustStyleDifference):
316
317 2015-03-04  David Kilzer  <ddkilzer@apple.com>
318
319         Switch new soft-linking debug asserts to release asserts
320         <http://webkit.org/b/142176>
321
322         Reviewed by Alex Christensen.
323
324         * platform/mac/SoftLinking.h:
325         (SOFT_LINK_CONSTANT_SOURCE): Switch to release assert.
326         (SOFT_LINK_FUNCTION_SOURCE): Ditto.
327         * platform/win/SoftLinking.h:
328         (SOFT_LINK_CONSTANT_SOURCE): Ditto.
329         (SOFT_LINK_FUNCTION_SOURCE): Ditto.  Note that this method is
330         effectively only called once because the function pointer is
331         replaced after the first time it's called.
332
333 2015-03-04  Alex Christensen  <achristensen@webkit.org>
334
335         Optimize content extensions.
336         https://bugs.webkit.org/show_bug.cgi?id=142295
337
338         Reviewed by Benjamin Poulain.
339
340         * contentextensions/ContentExtensionCompiler.cpp:
341         (WebCore::ContentExtensions::serializeActions):
342         There is no need to add duplicate sequential actions.
343         * contentextensions/ContentExtensionRule.h:
344         (WebCore::ContentExtensions::Action::operator==):
345         Added to compare actions.
346         * contentextensions/ContentExtensionsBackend.cpp:
347         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL):
348         Return early if a block action is found instead of moving to the next extension.
349
350 2015-03-04  Commit Queue  <commit-queue@webkit.org>
351
352         Unreviewed, rolling out r181046.
353         https://bugs.webkit.org/show_bug.cgi?id=142318
354
355         Broke two layout tests (Requested by sundiamonde on #webkit).
356
357         Reverted changeset:
358
359         "Update inline media control icons for OSX."
360         https://bugs.webkit.org/show_bug.cgi?id=142305
361         http://trac.webkit.org/changeset/181046
362
363 2015-03-04  Timothy Horton  <timothy_horton@apple.com>
364
365         <attachment> icons are low-resolution when transformed or under page scale
366         https://bugs.webkit.org/show_bug.cgi?id=142262
367         <rdar://problem/20035480>
368
369         Reviewed by Dean Jackson.
370
371         We should use Icon::createIconForFiles, just like <input type="file"> does,
372         instead of directly talking to IconServices. This results both in less code
373         and in NSImage's multiresolution magic making the icons sharp even under
374         the influence of transforms and page scale.
375
376         * WebCore.xcodeproj/project.pbxproj:
377         * platform/spi/mac/IconServicesSPI.h: Removed.
378         * platform/spi/mac/LaunchServicesSPI.h: Removed.
379         Get rid of IconServicesSPI.h and LaunchServicesSPI.h.
380
381         * platform/graphics/Icon.h:
382         Include RetainPtr just once.
383         paint() should take a GraphicsContext reference (null is not an option)
384         and a FloatRect (after all, it just turns around and converts to NSRect).
385
386         * platform/graphics/ios/IconIOS.mm:
387         (WebCore::Icon::paint):
388         * platform/graphics/mac/IconMac.mm:
389         (WebCore::Icon::createIconForFiles):
390         (WebCore::Icon::paint):
391         * platform/graphics/efl/IconEfl.cpp:
392         (WebCore::Icon::paint):
393         * platform/graphics/gtk/IconGtk.cpp:
394         (WebCore::Icon::paint):
395         * platform/graphics/win/IconWin.cpp:
396         (WebCore::Icon::paint):
397         Adapt to the paint() signature changes, fix some style, etc.
398
399         * rendering/RenderFileUploadControl.cpp:
400         (WebCore::RenderFileUploadControl::paintObject):
401         * rendering/RenderThemeIOS.mm:
402         (WebCore::RenderThemeIOS::paintFileUploadIconDecorations):
403         Adapt to the paint() signature changes.
404
405         * rendering/RenderThemeMac.mm:
406         (WebCore::paintAttachmentIcon):
407         Use Icon::createIconForFiles instead of IconServices.
408
409 2015-03-04  Tim Horton  <timothy_horton@apple.com>
410
411         <attachment> should not appear selected when the cursor is adjacent to it
412         https://bugs.webkit.org/show_bug.cgi?id=142311
413         <rdar://problem/20045862>
414
415         Reviewed by Dean Jackson.
416
417         * rendering/RenderAttachment.cpp:
418         (WebCore::RenderAttachment::isSelected): Deleted.
419         * rendering/RenderAttachment.h:
420         * rendering/RenderThemeMac.mm:
421         (WebCore::titleTextColorForAttachment):
422         (WebCore::RenderThemeMac::paintAttachment):
423         (WebCore::labelTextColorForAttachment): Deleted.
424         We were using the wrong (and far too complicated) mechanism to determine
425         if the attachment is selected (to decide which highlight color to use).
426         Instead, just check selectionState().
427
428 2015-03-04  Timothy Horton  <timothy_horton@apple.com>
429
430         <attachment> should show the file size as detail text below the icon
431         https://bugs.webkit.org/show_bug.cgi?id=142261
432         <rdar://problem/20009570>
433
434         Reviewed by Dean Jackson.
435
436         Test: fast/attachment/attachment-subtitle.html
437
438         * html/HTMLAttachmentElement.cpp:
439         (WebCore::HTMLAttachmentElement::setFile):
440         (WebCore::HTMLAttachmentElement::parseAttribute):
441         * html/HTMLAttachmentElement.h:
442         Let RenderAttachment know when the subtitle attribute changes.
443
444         * html/HTMLAttributeNames.in:
445         Add a subtitle attribute.
446
447         * rendering/RenderAttachment.cpp:
448         (WebCore::RenderAttachment::invalidate):
449         (WebCore::RenderAttachment::representedFileChanged): Deleted.
450         * rendering/RenderAttachment.h:
451         Rename representedFileChanged to invalidate; it will cause layout and
452         repaint of the attachment. Mostly for use from HTMLAttachmentElement,
453         when properties that affect the display and/or intrinsic size change.
454
455         * rendering/RenderThemeMac.mm:
456         (WebCore::attachmentTitleInactiveBackgroundColor):
457         (WebCore::attachmentTitleInactiveTextColor):
458         (WebCore::attachmentSubtitleTextColor):
459         (WebCore::titleTextColorForAttachment):
460         (WebCore::AttachmentLayout::addTitleLine):
461         (WebCore::AttachmentLayout::layOutTitle):
462         (WebCore::AttachmentLayout::layOutSubtitle):
463         (WebCore::AttachmentLayout::AttachmentLayout):
464         (WebCore::addAttachmentTitleBackgroundRightCorner):
465         (WebCore::addAttachmentTitleBackgroundLeftCorner):
466         (WebCore::paintAttachmentTitleBackground):
467         (WebCore::paintAttachmentTitle):
468         (WebCore::paintAttachmentSubtitle):
469         (WebCore::RenderThemeMac::paintAttachment):
470         (WebCore::attachmentLabelInactiveBackgroundColor): Deleted.
471         (WebCore::attachmentLabelInactiveTextColor): Deleted.
472         (WebCore::labelTextColorForAttachment): Deleted.
473         (WebCore::AttachmentLayout::addLine): Deleted.
474         (WebCore::AttachmentLayout::layOutLabel): Deleted.
475         (WebCore::addAttachmentLabelBackgroundRightCorner): Deleted.
476         (WebCore::addAttachmentLabelBackgroundLeftCorner): Deleted.
477         (WebCore::paintAttachmentLabelBackground): Deleted.
478         (WebCore::paintAttachmentLabel): Deleted.
479         Rename everything "label" to "title" (except LabelLine, which is not
480         specifically about the title). We're going to use "title" for the
481         main text below the icon, and "subtitle" for the secondary text below that.
482
483         Avoid keeping the CTFonts on the AttachmentLayout; there's no need for it.
484
485         Add layOutSubtitle and paintAttachmentSubtitle, which orient and paint
486         the subtitle (below the title, in blue, smaller than the label).
487
488 2015-03-04  David Kilzer  <ddkilzer@apple.com>
489
490         [Windows] Build fix: Make sure to include <CoreMedia/CoreMedia.h> before redefining CMSampleBuffer
491
492         More fallout from:
493
494         Switch remaining CoreMedia soft-linking in WebCore over to CoreMediaSoftLink.{cpp,h}
495         <http://webkit.org/b/141870>
496
497         * platform/cf/CoreMediaSoftLink.cpp:
498         * platform/cf/CoreMediaSoftLink.h:
499         - Remove include of <CoreMedia/CoreMedia.h> here.  These already
500           include CoreMediaSPI.h.
501         * platform/spi/cf/CoreMediaSPI.h:
502         - Add include of <CoreMedia/CoreMedia.h> here.
503         - Remove redundant include of <CoreMedia/CMTime.h> for Windows.
504
505 2015-03-04  David Kilzer  <ddkilzer@apple.com>
506
507         [iOS] Fix build with newer clang due to duplicate macro definition
508
509         Fallout from:
510
511         Switch remaining CoreMedia soft-linking in WebCore over to CoreMediaSoftLink.{cpp,h}
512         <http://webkit.org/b/141870>
513
514         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
515         Remove duplicate kCMTimeIndefinite macro.
516
517 2015-03-04  Roger Fong  <roger_fong@apple.com>
518
519         Update inline media control icons for OSX.
520         https://bugs.webkit.org/show_bug.cgi?id=142305.
521         <rdar://problem/19997484>
522
523         Reviewed by Dean Jackson.
524
525         Changes include: new volume button, new full screen button, new play/pause button.
526         Repositioning of 30 second and play buttons.
527         * Modules/mediacontrols/mediaControlsApple.css:
528         (audio::-webkit-media-controls-panel button):
529         (audio::-webkit-media-controls-rewind-button):
530         (audio::-webkit-media-controls-play-button):
531         (audio::-webkit-media-controls-play-button.paused):
532         (audio::-webkit-media-controls-panel .mute-box):
533         (video::-webkit-media-controls-volume-max-button):
534         (video::-webkit-media-controls-volume-min-button):
535         (audio::-webkit-media-controls-toggle-closed-captions-button):
536         (audio::-webkit-media-controls-fullscreen-button):
537         (audio::-webkit-media-controls-current-time-display):
538         * Modules/mediacontrols/mediaControlsApple.js:
539         (Controller.prototype.configureInlineControls): Swap positions of rewind and play buttons.
540         (Controller.prototype.handleMuteButtonClicked): Remember to update volume slider when necessary.
541         (Controller.prototype.updateVolume): Ditto
542
543 2015-03-04  Andy Estes  <aestes@apple.com>
544
545         [Content Filtering] Rename ContentFilterMac.mm to ContentFilter.cpp
546         https://bugs.webkit.org/show_bug.cgi?id=142313
547
548         Reviewed by Anders Carlsson.
549
550         ContentFilterMac.mm no longer contains any Objective-C code, so rename it to ContentFilter.cpp. It is also no longer Mac-specific, so move it up to platform/.
551
552         * WebCore.xcodeproj/project.pbxproj:
553         * platform/ContentFilter.cpp: Renamed from Source/WebCore/platform/mac/ContentFilterMac.mm.
554         * platform/cocoa/NetworkExtensionContentFilter.h: Replaced NSInteger with long.
555
556 2015-03-04  Dean Jackson  <dino@apple.com>
557
558         REGRESSION (r179597): Can't see power saver banner for plugins
559         https://bugs.webkit.org/show_bug.cgi?id=142312
560         <rdar://problem/20040517>
561
562         Reviewed by Brent Fulgham.
563
564         We were being a bit too restrictive when deciding a child
565         should not create a renderer. All shadow root children
566         of the snapshotted plugin need one.
567
568         * html/HTMLPlugInImageElement.cpp:
569         (WebCore::HTMLPlugInImageElement::childShouldCreateRenderer):
570         Test if we're part of the shadow tree.
571
572 2015-03-03  Andy Estes  <aestes@apple.com>
573
574         [Content Filtering] Make it easier to add new content filters
575         https://bugs.webkit.org/show_bug.cgi?id=142255
576
577         Reviewed by Sam Weinig.
578
579         ContentFilter was becoming a bit of a mess, with both the WebFilterEvaluator and NEFilterSource implementations
580         awkwardly living side-by-side. This patch cleans things up by moving these implementations into two separate
581         classes and turning ContentFilter itself into an abstract interface that each implements. A new class called
582         ContentFilterCollection, which also inherits from ContentFilter, manages the collection of individual content
583         filters and is vended to the rest of the system by ContentFilter::createIfNeeded().
584
585         This refactoring will make it easier to add a third type of content filter in a follow-on patch, namely a mock
586         content filter for testing purposes.
587
588         * WebCore.xcodeproj/project.pbxproj:
589         * loader/DocumentLoader.cpp:
590         (WebCore::DocumentLoader::responseReceived): Called ContentFilter::createIfNeeded() instead of instantiating a ContentFilter directly.
591         * platform/ContentFilter.h:
592         (WebCore::ContentFilter::~ContentFilter):
593         * platform/cocoa/NetworkExtensionContentFilter.h: Copied from Source/WebCore/platform/ContentFilter.h.
594         * platform/cocoa/NetworkExtensionContentFilter.mm: Added.
595         (WebCore::NetworkExtensionContentFilter::canHandleResponse): Moved NEFilterSource code from ContentFilterMac.mm to here.
596         (WebCore::NetworkExtensionContentFilter::create): Ditto.
597         (WebCore::NetworkExtensionContentFilter::NetworkExtensionContentFilter): Ditto.
598         (WebCore::NetworkExtensionContentFilter::~NetworkExtensionContentFilter): Ditto.
599         (WebCore::NetworkExtensionContentFilter::addData): Ditto.
600         (WebCore::NetworkExtensionContentFilter::finishedAddingData): Ditto.
601         (WebCore::NetworkExtensionContentFilter::needsMoreData): Ditto.
602         (WebCore::NetworkExtensionContentFilter::didBlockData): Ditto.
603         (WebCore::NetworkExtensionContentFilter::getReplacementData): Ditto.
604         (WebCore::NetworkExtensionContentFilter::unblockHandler): Ditto.
605         * platform/cocoa/ParentalControlsContentFilter.h: Copied from Source/WebCore/platform/ContentFilter.h.
606         * platform/cocoa/ParentalControlsContentFilter.mm: Added.
607         (WebCore::ParentalControlsContentFilter::canHandleResponse): Moved WebFilterEvaluator code from ContentFilterMac.mm to here.
608         (WebCore::ParentalControlsContentFilter::create): Ditto.
609         (WebCore::ParentalControlsContentFilter::ParentalControlsContentFilter): Ditto.
610         (WebCore::ParentalControlsContentFilter::addData): Ditto.
611         (WebCore::ParentalControlsContentFilter::finishedAddingData): Ditto.
612         (WebCore::ParentalControlsContentFilter::needsMoreData): Ditto.
613         (WebCore::ParentalControlsContentFilter::didBlockData): Ditto.
614         (WebCore::ParentalControlsContentFilter::getReplacementData): Ditto.
615         (WebCore::ParentalControlsContentFilter::unblockHandler): Ditto.
616         * platform/mac/ContentFilterMac.mm:
617         (WebCore::contentFilterType): Added a helper function template that creates a new ContentFilterType.
618         (WebCore::contentFilterTypes): Registered a ContentFilterType for each type of content filter.
619         (WebCore::ContentFilter::createIfNeeded): Created a ContentFilterCollection containing each content filter that can handle the given response.
620         (WebCore::ContentFilterCollection::ContentFilterCollection): Constructs a ContentFilterCollection given a Vector of content filters.
621         (WebCore::ContentFilterCollection::addData): Forwarded the call to each content filter in m_contentFilters.
622         (WebCore::ContentFilterCollection::finishedAddingData): Ditto.
623         (WebCore::ContentFilterCollection::needsMoreData): Ditto.
624         (WebCore::ContentFilterCollection::didBlockData): Ditto.
625         (WebCore::ContentFilterCollection::getReplacementData): Returned replacement data for the first filter that blocked the load.
626         If no filter blocked the load, returned the first filter's replacement data.
627         (WebCore::ContentFilterCollection::unblockHandler): Returned the unblock handler for the first filter that blocked the load.
628         (WebCore::ContentFilter::ContentFilter): Deleted.
629         (WebCore::ContentFilter::~ContentFilter): Deleted.
630         (WebCore::ContentFilter::canHandleResponse): Deleted.
631         (WebCore::ContentFilter::addData): Deleted.
632         (WebCore::ContentFilter::finishedAddingData): Deleted.
633         (WebCore::ContentFilter::needsMoreData): Deleted.
634         (WebCore::ContentFilter::didBlockData): Deleted.
635         (WebCore::ContentFilter::getReplacementData): Deleted.
636         (WebCore::ContentFilter::unblockHandler): Deleted.
637
638 2015-03-04  David Kilzer  <ddkilzer@apple.com>
639
640         Switch remaining CoreMedia soft-linking in WebCore over to CoreMediaSoftLink.{cpp,h}
641         <http://webkit.org/b/141870>
642
643         Reviewed by Alex Christensen.
644
645         * Configurations/WebCore.unexp:
646         - Remove all weak symbols for CoreMedia.framework as they should
647           no longer appear.
648
649         * Modules/plugins/QuickTimePluginReplacement.mm:
650         * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp:
651         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
652         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
653         - Clean up headers.
654
655         * platform/cf/CoreMediaSoftLink.cpp:
656         * platform/cf/CoreMediaSoftLink.h:
657         - Add soft-link functions and constants from remaining source
658           files.
659
660         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
661         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
662         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
663         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
664         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
665         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
666         * platform/mac/PlatformClockCM.mm:
667         * platform/mediastream/mac/AVMediaCaptureSource.mm:
668         * platform/mediastream/mac/AVVideoCaptureSource.mm:
669         - Switch to using CoreMediaSoftLink.h.
670
671         * platform/mac/SoftLinking.h:
672         * platform/win/SoftLinking.h:
673         - Remove 'const' from SOFT_LINK_CONSTANT_{HEADER,SOURCE}()
674           macros since it won't work with const structs.
675
676         * platform/spi/cf/CoreMediaSPI.h:
677         - Add SPI declarations for Windows originally from
678           InbandTextTrackPrivateAVF.cpp.
679
680 2015-03-04  Commit Queue  <commit-queue@webkit.org>
681
682         Unreviewed, rolling out r181001 and r181003.
683         https://bugs.webkit.org/show_bug.cgi?id=142307
684
685         Broke many tests (Requested by ap on #webkit).
686
687         Reverted changesets:
688
689         "Make JavaScript binding get and set legacy event listener
690         attributes directly"
691         https://bugs.webkit.org/show_bug.cgi?id=142282
692         http://trac.webkit.org/changeset/181001
693
694         "Update bindings tests after r181001."
695         http://trac.webkit.org/changeset/181003
696
697 2015-03-04  Roger Fong  <roger_fong@apple.com>
698
699         Update elapsed/remaining time displays on media inline controls on OSX.
700         https://bugs.webkit.org/show_bug.cgi?id=142264.
701         <rdar://problem/19997487>
702
703         Reviewed by Dean Jackson.
704
705         Div surrounding times are set widths. A larger width is used for times that are
706         an hour or longer. Time elapsed is right justified. Time remaining is left justified.
707         Times are displayed in 11pt Helvetica Neue.
708         * Modules/mediacontrols/mediaControlsApple.css:
709         (audio::-webkit-media-controls-time-remaining-display):
710         (audio::-webkit-media-controls-current-time-display):
711         (audio::-webkit-media-controls-time-remaining-display.hour-long-time):
712         (audio::-webkit-media-controls-current-time-display.hour-long-time):
713         (audio::-webkit-media-controls-time-remaining-display.ten-hour-long-time):
714         (audio::-webkit-media-controls-current-time-display.ten-hour-long-time):
715         * Modules/mediacontrols/mediaControlsApple.js:
716         (Controller.prototype.updateDuration):
717
718 2015-03-04  Myles C. Maxfield  <mmaxfield@apple.com>
719
720         Implement -apple-trailing-word: -apple-partially-balanced
721         https://bugs.webkit.org/show_bug.cgi?id=142253
722
723         Reviewed by David Hyatt.
724
725         This patch implements a history mechanism for line breaking. In particular, this patch partitions
726         the updates to the current line breaking location into two kinds: conceptually new breaking locations,
727         and fixups to existing locations. Then, this patch remembers all the fixed up breaking locations, up
728         to a maximum number of remembered locations.
729
730         The patch then uses this memory to change the line-breaking selection based on the rules of
731         -apple-trailing-word.
732
733         Test: fast/text/trailing-word.html
734
735         * rendering/line/BreakingContextInlineHeaders.h:
736         Use InlineIteratorHistory as a proxy for the current breaking location. Note that all these functions
737         are inlined, so the overhead should be next to nothing when -apple-trailing-word is not in use.
738         (WebCore::BreakingContext::BreakingContext): Use InlineIteratorHistory instead of InlineIterator
739         (WebCore::BreakingContext::lineBreak): Ditto.
740         (WebCore::BreakingContext::clearLineBreakIfFitsOnLine): Ditto
741         (WebCore::BreakingContext::commitLineBreakAtCurrentWidth): Ditto
742         (WebCore::BreakingContext::InlineIteratorHistory::InlineIteratorHistory): Keeps track of historical
743         breaking locations
744         (WebCore::BreakingContext::InlineIteratorHistory::push): Remember a new breaking location
745         (WebCore::BreakingContext::InlineIteratorHistory::update): Update an existing breaking location
746         (WebCore::BreakingContext::InlineIteratorHistory::renderer): Forwarded to the current breaking location
747         (WebCore::BreakingContext::InlineIteratorHistory::offset): Ditto
748         (WebCore::BreakingContext::InlineIteratorHistory::atTextParagraphSeparator):  Ditto
749         (WebCore::BreakingContext::InlineIteratorHistory::previousInSameNode): Ditto
750         (WebCore::BreakingContext::InlineIteratorHistory::get): Get one of the remembered breaking locations
751         (WebCore::BreakingContext::InlineIteratorHistory::current): Get the current breaking location
752         (WebCore::BreakingContext::InlineIteratorHistory::historyLength):
753         (WebCore::BreakingContext::InlineIteratorHistory::moveTo): Forwarded to the current breaking location.
754         (WebCore::BreakingContext::InlineIteratorHistory::increment): Ditto
755         (WebCore::BreakingContext::InlineIteratorHistory::clear): Ditto
756         (WebCore::BreakingContext::handleBR): Use InlineIteratorHistory instead of InlineIterator
757         (WebCore::BreakingContext::handleFloat): Ditto
758         (WebCore::BreakingContext::handleText): Use InlineIteratorHistory instead of InlineIterator
759         (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded): Style
760         (WebCore::checkMidpoints): Use InlineIteratorHistory instead of InlineIterator
761         (WebCore::BreakingContext::handleEndOfLine): If -apple-trailing-word is in effect, use
762         optimalLineBreakLocationForTrailingWord().
763         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord): Use the remembered breaking
764         locations and choose the optimal one.
765         (WebCore::BreakingContext::lineBreakRef): Deleted.
766
767 2015-03-04  Timothy Horton  <timothy_horton@apple.com>
768
769         <attachment> title text disappears when dragging
770         https://bugs.webkit.org/show_bug.cgi?id=142263
771         <rdar://problem/20035515>
772
773         Reviewed by Sam Weinig.
774
775         * rendering/RenderThemeMac.mm:
776         (WebCore::RenderThemeMac::paintAttachment):
777         We use NSColors with CoreText, which requires that Cocoa knows the current
778         CGContext out-of-band (through the NSGraphicsContext currentContext mechanism).
779         Otherwise, sometimes (especially when dragging), it will try to apply the
780         text foreground color to a null context, complain to the system log, and fail
781         to render the text.
782
783 2015-03-04  Jer Noble  <jer.noble@apple.com>
784
785         [Mac] YouTube playback at 1.5x speed has audible distortion
786         https://bugs.webkit.org/show_bug.cgi?id=142280
787
788         Reviewed by Eric Carlson.
789
790         Use the high-quality AVAudioTimePitchAlgorithmSpectral algorithm for the 
791         AVSampleBufferAudioRenderer rather than its default value of 
792         AVAudioTimePitchAlgorithmTimeDomain.
793
794         Drive-by fix:
795
796         Might as well add support for MediaPlayer::setPreservesPitch() while we're
797         changing the audio pitch algorithm. If preservesPitch() is false use the
798         AVAudioTimePitchAlgorithmVarispeed algorithm in both AVFObjC-based media players
799         (MediaPlayerPrivateAVFoundationObjC & MediaPlayerPrivateMediaSourceAVFObjC).
800
801         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
802         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
803         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
804         (WebCore::MediaPlayerPrivateAVFoundationObjC::setPreservesPitch):
805         (WebCore::MediaPlayerPrivateAVFoundationObjC::setRateDouble): Deleted.
806         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
807         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
808         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
809         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
810
811 2015-03-04  Jer Noble  <jer.noble@apple.com>
812
813         [MSE][EME][Mac] Calling close on a MediaKeysSession will cause many decoding errors to be emitted
814         https://bugs.webkit.org/show_bug.cgi?id=142285
815
816         Reviewed by Eric Carlson.
817
818         When a MediaKeySession (backed by CDMSessionMediaSourceAVFObjC) is closed and the
819         underlying AVStreamSession is invalidated, the decryption context for in-flight
820         CMSampleBuffers is also invalidated, and the AVSampleBufferDisplayLayer will issue
821         one error for each enqueued and un-displayed sample in its image-queue. -flush-ing
822         the AVSampleBufferDisplayLayer is not enough, as the flush only takes effect
823         asynchronously the next time the layer needs new samples.
824
825         Add a workaround until framework-level support lands to fully flush enqueued and
826         encrypted frames.
827
828         When the CDMSessionMediaSOurceAVFObjC object recieves an error from the layer,
829         check to see if the session has been stopped. If so, and if the error in question is
830         one that indicates that the samples decryption context has been invalidated, suppress
831         the error and instruct the sender to suppress the error as well. This workaround will
832         be removed once real support for synchronous flushing lands in <rdar://problem/20027434.>
833
834         Still, we'll make our best effort to flush undisplayed frames when our CDM session is
835         invalidated. Move away from std::map and instead use HashMap to store the set of 
836         AVSampleBufferAudioRenderers. This allows us to use C++11 style loops against just
837         the HashMap's set of values.
838
839         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
840         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
841         (WebCore::CDMSessionMediaSourceAVFObjC::releaseKeys): Flush and set m_stopped.
842         (WebCore::CDMSessionMediaSourceAVFObjC::layerDidReceiveError): Check m_stopped and the
843             error code and bail before issuing the error.
844         (WebCore::CDMSessionMediaSourceAVFObjC::rendererDidReceiveError): Ditto.
845         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
846         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
847         (-[WebAVSampleBufferErrorListener layerFailedToDecode:]): Drive-by fix. Check whether
848             the layer is in the set of listened-to layers only back in the main thread; the
849             listnener may have been unregistered by the time the main thread was called.
850         (WebCore::SourceBufferPrivateAVFObjC::destroyRenderers): std::map -> HashMap.
851         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): Ditto.
852         (WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples): Ditto.
853         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Ditto.
854         (WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples): Ditto.
855         (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples): Ditto.
856         (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples): Ditto.
857         (WebCore::SourceBufferPrivateAVFObjC::flush): Added; call -flush on all the display
858             layers and audio renderers.
859         (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError): Check if any clients
860             asked to ignore the error, and if so, bail.
861         (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError): Ditto.
862
863 2015-03-04  Alex Christensen  <achristensen@webkit.org>
864
865         Update bindings tests after r181001.
866
867         * bindings/scripts/test/JS/*.cpp:
868         Class names changed to auto.
869
870 2015-03-04  Brent Fulgham  <bfulgham@apple.com>
871
872         [Win] Missing dependency checking in DerivedSources.make for FeatureDefines.props
873         https://bugs.webkit.org/show_bug.cgi?id=142284
874
875         Reviewed by David Kilzer.
876
877         Make DerivedSources.make understand its build dependency on FeatureDefines.props
878         when building on Windows:
879         1. Modify DerivedSources.make to declare a default dependency (on Windows)
880            to $(WEBKIT_LIBRARIES)/tools/vsprops/FeatureDefines.props.
881         2. Update the Windows script 'build-generated-files.pl' to specify the correct
882            FeatureDefines{Cairo}.props value to use, depending on build environment.
883
884         * DerivedSources.make:
885         * WebCore.vcxproj/build-generated-files.pl:
886
887 2015-03-04  Darin Adler  <darin@apple.com>
888
889         Make JavaScript binding get and set legacy event listener attributes directly
890         https://bugs.webkit.org/show_bug.cgi?id=142282
891
892         Reviewed by Sam Weinig.
893
894         Test: fast/dom/legacy-event-handler-attributes.html
895
896         This patch changes the JavaScript getters and setters for these attributes
897         to work directly without requiring any functions in the C++ DOM implementation.
898         A subsequent patch will remove the now-unused C++ DOM implementation.
899
900         * bindings/js/JSEventListener.cpp:
901         (WebCore::legacyEventListenerAttribute): Added.
902         (WebCore::createEventListenerForLegacyAttribute): Added.
903         (WebCore::setLegacyEventListenerAttribute): Added.
904         (WebCore::legacyWindowEventListenerAttribute): Added.
905         (WebCore::setLegacyWindowEventListenerAttribute): Added.
906
907         * bindings/js/JSEventListener.h:
908         (WebCore::createJSEventListenerForAttribute): Deleted.
909
910         * bindings/scripts/CodeGeneratorJS.pm:
911         (GenerateAttributeEventListenerCall): Deleted.
912         (LegacyEventListenerAttributeEventName): Added.
913         (LegacyEventListenerAttributePrefix): Added.
914         (GenerateImplementation): Use "auto" in lots of places to simplify the code
915         generation. Replaced the old inlined code to deal with legacy event listener
916         attributes with code that simply calls the new functions from JSEventLister.h.
917         (GenerateCallWith): Use "auto".
918         (GenerateConstructorDefinition): Ditto.
919
920 2015-03-03  Sam Weinig  <sam@webkit.org>
921
922         [Content Extensions] Split parsing and compiling of content extensions into their own files
923         https://bugs.webkit.org/show_bug.cgi?id=142259
924
925         Reviewed by Anders Carlsson.
926
927         Added new unit test:
928             ContentFilterTest.Basic
929
930         * WebCore.xcodeproj/project.pbxproj:
931         Add new files (CompiledContentExtension.h/cpp, ContentExtensionCompiler.h/cpp, and ContentExtensionParser.h/cpp)
932
933         * contentextensions/CompiledContentExtension.cpp: Added.
934         * contentextensions/CompiledContentExtension.h: Added.
935         Add new class for holding onto the compiled content extension itself. Make it ThreadSafeRefCounted so it is easy
936         to move between threads which will be important in a subsequent patch where we enable compilation on a background
937         thread.
938
939         * contentextensions/ContentExtensionCompiler.cpp: Added.
940         (WebCore::ContentExtensions::serializeActions):
941         (WebCore::ContentExtensions::compileRuleList):
942         * contentextensions/ContentExtensionCompiler.h: Added.
943         Moving compilation to its own file. Was previously in ContentExtensionsBackend. This is necessary because
944         we will want to be able to compile without the need of a backend.
945
946         * contentextensions/ContentExtensionParser.cpp: Copied from contentextensions/ContentExtensionsManager.cpp.
947         * contentextensions/ContentExtensionParser.h: Copied from contentextensions/ContentExtensionsManager.h.
948         Renamed ContentExtensionsManager to ContentExtensionParser, since that is all it is doing.
949
950         * contentextensions/ContentExtensionsBackend.cpp:
951         (WebCore::ContentExtensions::ContentExtensionsBackend::addContentExtension):
952         (WebCore::ContentExtensions::ContentExtensionsBackend::removeContentExtension):
953         (WebCore::ContentExtensions::ContentExtensionsBackend::removeAllContentExtensions):
954         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL):
955         (WebCore::ContentExtensions::ContentExtensionsBackend::serializeActions): Deleted.
956         (WebCore::ContentExtensions::ContentExtensionsBackend::setRuleList): Deleted.
957         (WebCore::ContentExtensions::ContentExtensionsBackend::removeRuleList): Deleted.
958         (WebCore::ContentExtensions::ContentExtensionsBackend::removeAllRuleLists): Deleted.
959         * contentextensions/ContentExtensionsBackend.h:
960         Change the backend to use the new CompiledContentExtension and change the terminology to
961         reference content extensions, rather than rule lists.
962
963         * page/UserContentController.cpp:
964         (WebCore::UserContentController::addUserContentFilter):
965         (WebCore::UserContentController::removeUserContentFilter):
966         (WebCore::UserContentController::removeAllUserContentFilters):
967         Update for new names and change addUserContentFilter to explicitly compile the JSON
968         rule list before handing it to the backend. In subsequent changes, addUserContentFilter
969         should be changed to take the compiled content extension, and it should become the responsibility
970         of the called (WebKit) to create them.
971
972 2015-03-04  Philippe Normand  <pnormand@igalia.com>
973
974         [GStreamer] the GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED should be wrapped by a ifdef
975         https://bugs.webkit.org/show_bug.cgi?id=142274
976
977         Reviewed by Carlos Garcia Campos.
978
979         Don't handle scheduling queries if building against versions of
980         GStreamer older than 1.2.0.
981
982         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
983         (webKitWebSrcQueryWithParent):
984
985 2015-03-03  Yoav Weiss  <yoav@yoav.ws>
986
987         Add a microtask abstraction
988         https://bugs.webkit.org/show_bug.cgi?id=137496
989
990         Reviewed by Sam Weinig.
991
992         This patch adds a microtask abstraction: https://html.spec.whatwg.org/multipage/webappapis.html#microtask
993         That abstraction is required in order to enable async loading of images,
994         which is in turn required to enable support for the picture element, as well as
995         to make sure that the order of properties set on HTMLImageElement has no implications.
996
997         A similar patch was rolled back in r180914. This patch is an improved version.
998
999         * WebCore.vcxproj/WebCore.vcxproj: Add MicroTask.{h,cpp} to the project.
1000         * WebCore.vcxproj/WebCoreTestSupport.vcxproj: Add MicroTaskTest.{h,cpp} to the project.
1001         * WebCore.vcxproj/WebCore.vcxproj.filters: Add MicroTask.{h,cpp} to the project.
1002         * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: Add MicroTaskTest.{h,cpp} to the project.
1003         * WebCore.xcodeproj/project.pbxproj: Add MicroTask{,Test}.{h,cpp} to the project.
1004         * dom/Document.h: Add WEBCORE_EXPORT to addConsoleMessage, so it can be used in MicroTaskTest that's in WebCoreTestSupport..
1005         * dom/MicroTask.h: Add a MicroTask interface class. Add a MicroTaskQueue singleton.
1006         (WebCore::MicroTask::~MicroTask):
1007         (WebCore::MicroTask::run): Run the microtask.
1008         * dom/MicroTask.cpp: Implement the MicroTaskQueue singleton.
1009         (WebCore::MicroTaskQueue::singleton): Get a singleton instance of MicroTaskQueue.
1010         (WebCore::MicroTaskQueue::queueMicroTask): Add a microtask to the queue.
1011         (WebCore::MicroTaskQueue::runMicroTasks): Run all the microtasks in the queue and clear it.
1012         * dom/ScriptRunner.cpp: Trigger running of all microtasks in queue.
1013         (WebCore::ScriptRunner::timerFired):
1014         * html/parser/HTMLScriptRunner.cpp: Trigger running of all microtasks in queue.
1015         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
1016         (WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing):
1017         (WebCore::HTMLScriptRunner::runScript):
1018         * testing/Internals.cpp: Add a method to queue a test microtask.
1019         (WebCore::Internals::queueMicroTask):
1020         * testing/Internals.h: Add a method to queue a test microtask.
1021         (WebCore::Internals::queueMicroTask):
1022         * testing/Internals.idl: Expose test microtask queueing to test JS.
1023         * testing/MicroTaskTest.cpp: Add a test class that implements a microtask and prints to the console when it runs.
1024         (WebCore::MicroTaskTest::run): Run the microtask
1025         (WebCore::MicroTaskTest::create): Create a test microtask.
1026         * testing/MicroTaskTest.h: Add a test class that implements a microtask.
1027         (WebCore::MicroTaskTest::run):
1028         (WebCore::MicroTaskTest::create):
1029
1030 2015-03-03  Brent Fulgham  <bfulgham@apple.com>
1031
1032         Scroll snap points are not supported on the main frame
1033         https://bugs.webkit.org/show_bug.cgi?id=141973
1034         <rdar://problem/19938393>
1035
1036         Reviewed by Simon Fraser.
1037
1038         No new tests. Tests will be added when the animation behavior is finalized. Manual tests are attached to the bug.
1039
1040         Update the ScrollingTreeFrameScrollingNodeMac class to implement the delegate interface needed by the
1041         ScrollController. This involves the following:
1042         1. Implement scrollOffsetOnAxis: Used by the AxisScrollAnimator to determine the current position of the ScrollableArea.
1043         2. Implement immediateScrollOnAxis: Used by the AxisScrollAnimator to scroll the ScrollableArea
1044
1045         We also need to hold a copy of the snap points vector to send to the scrolling thread.
1046
1047         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1048         (WebCore::convertToLayoutUnits): Added helper function to match Scroll Snap Points API.
1049         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren): Recognize and react to changes to
1050         Scroll Snap Points on top-level frames.
1051         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Implement delegate method needed by the ScrollController.
1052         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollOnAxis): Ditto.
1053         * platform/cocoa/ScrollController.h:
1054         * platform/cocoa/ScrollController.mm:
1055         (WebCore::ScrollController::updateScrollAnimatorsAndTimers): Pass snap offsets to AxisScrollSnapAnimator constructor as references.
1056         (WebCore::ScrollController::updateScrollSnapPoints): Added. Used by ScrollingTreeFrameScrollingNodeMac to update scroll snap point
1057         settings in the scrolling thread.
1058         * platform/mac/AxisScrollSnapAnimator.h:
1059         * platform/mac/AxisScrollSnapAnimator.mm:
1060         (WebCore::toWheelEventStatus): Don't ignore the "MayBegin" or "Cancelled" event phases.
1061         (WebCore::AxisScrollSnapAnimator::AxisScrollSnapAnimator): Revise signature to take a reference to the layout units.
1062         (WebCore::AxisScrollSnapAnimator::scrollSnapAnimationUpdate): Handle the case where this method gets called from a thread
1063         when the scrollable area has already reached its final destination.
1064         (WebCore::AxisScrollSnapAnimator::beginScrollSnapAnimation): Handle the possibility that the snap offset point vector might be
1065         empty. Update method to account for m_snapOffsets being a value, instead of a pointer.
1066
1067 2015-03-03  Andy Estes  <aestes@apple.com>
1068
1069         [Content Filtering] Separate unblock handling into its own class
1070         https://bugs.webkit.org/show_bug.cgi?id=142251
1071
1072         Reviewed by Andreas Kling.
1073
1074         Unblock handling is currently supported only for one type of content filter (WebFilterEvaluator) on one
1075         platform (iOS). Having its implementation in ContentFilter is making it difficult to support other filters and
1076         platforms, so let's separate unblock handling into its own class called ContentFilterUnblockHandler.
1077
1078         * WebCore.xcodeproj/project.pbxproj:
1079         * loader/DocumentLoader.cpp:
1080         (WebCore::DocumentLoader::finishedLoading): Passed a ContentFilterUnblockHandler to FrameLoaderClient::contentFilterDidBlockLoad.
1081         (WebCore::DocumentLoader::dataReceived): Ditto.
1082         * loader/FrameLoaderClient.h:
1083         * platform/ContentFilter.h:
1084         * platform/ContentFilterUnblockHandler.h: Copied from Source/WebCore/platform/ios/ContentFilterIOS.mm.
1085         (WebCore::ContentFilterUnblockHandler::clear):
1086         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm: Renamed from Source/WebCore/platform/ios/ContentFilterIOS.mm.
1087         (WebCore::ContentFilterUnblockHandler::ContentFilterUnblockHandler):
1088         (WebCore::ContentFilterUnblockHandler::encode):
1089         (WebCore::ContentFilterUnblockHandler::decode):
1090         (WebCore::scheme):
1091         (WebCore::ContentFilterUnblockHandler::handleUnblockRequestAndDispatchIfSuccessful):
1092         * platform/mac/ContentFilterMac.mm:
1093         (WebCore::ContentFilter::unblockHandler):
1094         (WebCore::ContentFilter::ContentFilter): Deleted.
1095         (WebCore::ContentFilter::encode): Deleted.
1096         (WebCore::ContentFilter::decode): Deleted.
1097
1098 2015-03-03  Alexey Proskuryakov  <ap@apple.com>
1099
1100         [Mac] Track localized name follows locale instead of primary language
1101         https://bugs.webkit.org/show_bug.cgi?id=142242
1102         rdar://problem/20000365
1103
1104         Reviewed by Eric Carlson.
1105
1106         * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::trackDisplayName): Use the
1107         language for localization, as CFBundle does.
1108
1109 2015-03-03  Alex Christensen  <achristensen@webkit.org>
1110
1111         [Win] Unreviewed build fix.
1112
1113         * WebCore.vcxproj/WebCoreIncludeCommon.props:
1114         Include contentextensions subdirectory.
1115
1116 2015-03-03  Alex Christensen  <achristensen@webkit.org>
1117
1118         Prepare to use CSS selectors in content extensions.
1119         https://bugs.webkit.org/show_bug.cgi?id=142227
1120
1121         Reviewed by Benjamin Poulain.
1122
1123         Test: http/tests/usercontentfilter/css-display-none.html
1124
1125         * CMakeLists.txt:
1126         * WebCore.xcodeproj/project.pbxproj:
1127         * contentextensions/ContentExtensionActions.h: Added.
1128         * contentextensions/ContentExtensionRule.cpp:
1129         (WebCore::ContentExtensions::Action::deserialize):
1130         * contentextensions/ContentExtensionRule.h:
1131         (WebCore::ContentExtensions::Action::Action):
1132         (WebCore::ContentExtensions::Action::type):
1133         (WebCore::ContentExtensions::Action::cssSelector):
1134         * contentextensions/ContentExtensionsBackend.cpp:
1135         (WebCore::ContentExtensions::ContentExtensionsBackend::serializeActions):
1136         Put action descriptions into a compact format in a Vector 
1137         to be able to be put into one block of shared read-only memory.
1138         (WebCore::ContentExtensions::ContentExtensionsBackend::setRuleList):
1139         Put an index of the beginning of the description into the NFA instead of the index of the rule
1140         because we will be sharing the descriptions of the actions and not the rules.
1141         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL):
1142         (WebCore::ContentExtensions::ContentExtensionsBackend::actionForURL): Deleted.
1143         Return a vector of actions to be able to do multiple actions for one URL.
1144         * contentextensions/ContentExtensionsBackend.h:
1145         * contentextensions/ContentExtensionsManager.cpp:
1146         (WebCore::ContentExtensions::ExtensionsManager::loadTrigger):
1147         (WebCore::ContentExtensions::ExtensionsManager::loadAction):
1148         Added the css-display-none action type, which requires a selector.
1149         (WebCore::ContentExtensions::ExtensionsManager::loadRule):
1150         * loader/cache/CachedResourceLoader.cpp:
1151         (WebCore::CachedResourceLoader::requestResource):
1152         * page/UserContentController.cpp:
1153         (WebCore::UserContentController::actionsForURL):
1154         (WebCore::UserContentController::actionForURL): Deleted.
1155         * page/UserContentController.h:
1156
1157 2015-03-03  Brent Fulgham  <bfulgham@apple.com>
1158
1159         Move scroll animating functions from ScrollAnimator to ScrollController
1160         https://bugs.webkit.org/show_bug.cgi?id=142102
1161         <rdar://problem/20007161>
1162
1163         Reviewed by Simon Fraser.
1164
1165         Tested by platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-mainframe-zoom.html.
1166
1167         Do some refactoring of the various scrolling classes:
1168         1. Consolidate animation times to RunLoop::Timer instead of a combination of WebCore::Timer
1169            and CFRunLoopTimers. Do this for Scroll Snap Point and Rubberband animations.
1170         2. Move ScrollController from platform/mac to platform/cocoa to enable sharing with iOS.
1171         3. Move code from ScrollAnimator{Mac} -> ScrollController.
1172         4. Rename scrollOffsetInAxis -> scrollOffsetOnAxis
1173         5. Rename immediateScrollInAxis -> immediateScrollOnAxis
1174
1175         * WebCore.xcodeproj/project.pbxproj: Move ScrollController to 'platform/cocoa'
1176         * page/mac/EventHandlerMac.mm: Make sure the scroll controller is notified of end-of-scroll
1177         events, just as is done for the "event not handled" case in EventHandler.cpp. 
1178         (WebCore::EventHandler::platformCompleteWheelEvent):
1179         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Remove timer and some delegate
1180         methods, now that ScrollController is controlling this state.
1181         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1182         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac): We no longer
1183         need to clean up the CFRunLoopTimer.
1184         (WebCore::ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer): Make sure scroll
1185         state is updated after rubber band snap.
1186         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Add temporary stub needed
1187         until Bug1973 is completed.).
1188         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollOnAxis): Ditto.
1189         (WebCore::ScrollingTreeFrameScrollingNodeMac::startSnapRubberbandTimer): Deleted.
1190         * platform/ScrollAnimator.cpp:
1191         (WebCore::ScrollAnimator::ScrollAnimator):
1192         (WebCore::ScrollAnimator::processWheelEventForScrollSnap): Just call the ScrollController method.
1193         (WebCore::ScrollAnimator::handleWheelEvent): Ditto.
1194         (WebCore::ScrollAnimator::updateScrollAnimatorsAndTimers): Ditto.
1195         (WebCore::ScrollAnimator::scrollOffsetOnAxis): Renamed from scrollOffsetInAxis.
1196         (WebCore::ScrollAnimator::immediateScrollOnAxis): Renamed from immediateScrollInAxis.
1197         (WebCore::ScrollAnimator::scrollOffsetInAxis): Deleted.
1198         (WebCore::ScrollAnimator::immediateScrollInAxis): Deleted.
1199         (WebCore::ScrollAnimator::startScrollSnapTimer): Deleted.
1200         (WebCore::ScrollAnimator::stopScrollSnapTimer): Deleted.
1201         (WebCore::ScrollAnimator::horizontalScrollSnapTimerFired): Deleted.
1202         (WebCore::ScrollAnimator::verticalScrollSnapTimerFired): Deleted.
1203         * platform/ScrollAnimator.h:
1204         * platform/cocoa/ScrollController.h: Copied from platform/mac/ScrollController.h.
1205         (WebCore::ScrollControllerClient::startSnapRubberbandTimer):
1206         (WebCore::ScrollControllerClient::stopSnapRubberbandTimer):
1207         (WebCore::ScrollControllerClient::startScrollSnapTimer):
1208         (WebCore::ScrollControllerClient::stopScrollSnapTimer):
1209         * platform/cocoa/ScrollController.mm: Copied from platform/mac/ScrollController.mm.
1210         (WebCore::ScrollController::ScrollController): Update to initialize new timers.
1211         (WebCore::ScrollController::handleWheelEvent): Update to handle Scroll Snap Point events.
1212         (WebCore::ScrollController::startSnapRubberbandTimer): Added.
1213         (WebCore::ScrollController::stopSnapRubberbandTimer): Manage animation timers locally, do not
1214         require client to maintain timers.
1215         (WebCore::ScrollController::snapRubberBand): Ditto.
1216         (WebCore::ScrollController::processWheelEventForScrollSnap): Added. (Moved from ScrollAnimatorMac)
1217         (WebCore::ScrollController::updateScrollAnimatorsAndTimers): Ditto. Also updated to use RunLoop::Timer.
1218         (WebCore::ScrollController::startScrollSnapTimer): Ditto. Also updated to use RunLoop::Timer.
1219         (WebCore::ScrollController::stopScrollSnapTimer): Ditto. Also updated to use RunLoop::Timer.
1220         (WebCore::ScrollController::horizontalScrollSnapTimerFired): Ditto.
1221         (WebCore::ScrollController::verticalScrollSnapTimerFired): Ditto.
1222         (WebCore::ScrollController::scrollOffsetOnAxis): Moved from ScrollAnimatorMac.
1223         (WebCore::ScrollController::immediateScrollOnAxis): Ditto.
1224         * platform/mac/AxisScrollSnapAnimator.h: Rename methods from 'InAxis' to 'OnAxis'
1225         * platform/mac/AxisScrollSnapAnimator.mm:
1226         (WebCore::AxisScrollSnapAnimator::handleWheelEvent): Update for 'InAxis' to 'OnAxis' renaming.
1227         (WebCore::AxisScrollSnapAnimator::scrollSnapAnimationUpdate): Ditto.
1228         (WebCore::AxisScrollSnapAnimator::beginScrollSnapAnimation): Ditto.
1229         (WebCore::AxisScrollSnapAnimator::computeSnapDelta): Ditto.
1230         (WebCore::AxisScrollSnapAnimator::computeGlideDelta): Ditto.
1231         * platform/mac/ScrollAnimatorMac.h:
1232         * platform/mac/ScrollAnimatorMac.mm:
1233         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac): Remove unused Rubberband timers (now that this is
1234         controlled in the ScrollController)
1235         (WebCore::ScrollAnimatorMac::startSnapRubberbandTimer): Deleted.
1236         (WebCore::ScrollAnimatorMac::stopSnapRubberbandTimer): Deleted.
1237         (WebCore::ScrollAnimatorMac::snapRubberBandTimerFired): Deleted.
1238         * platform/mac/ScrollController.h: Removed.
1239         * platform/mac/ScrollController.mm: Removed.
1240
1241 2015-03-03  Commit Queue  <commit-queue@webkit.org>
1242
1243         Unreviewed, rolling out r180683.
1244         https://bugs.webkit.org/show_bug.cgi?id=142249
1245
1246         Broke fast/css/acid2-pixel.html (Requested by ap on #webkit).
1247
1248         Reverted changeset:
1249
1250         "Setting any of the <object> element plugin controlling
1251         attributes does not have any affect."
1252         https://bugs.webkit.org/show_bug.cgi?id=141936
1253         http://trac.webkit.org/changeset/180683
1254
1255 2015-03-03  Dean Jackson  <dino@apple.com>
1256
1257         Controls panel should have system blurry background
1258         https://bugs.webkit.org/show_bug.cgi?id=142154
1259         <rdar://problem/20000964>
1260
1261         Reviewed by Simon Fraser.
1262
1263         In order to replicate the system style of media controls
1264         on OS X and iOS, we need to expose a special -webkit-appearance.
1265         This patch adds the new property value, and implements
1266         the iOS part of the appearance, which is a blurry shaded
1267         background.
1268
1269         Test: compositing/media-controls-bar-appearance.html
1270
1271         * css/CSSPrimitiveValueMappings.h:
1272         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Map the new
1273         keywords from ControlParts.
1274
1275         * css/CSSValueKeywords.in: Add media-controls-light-bar-background
1276         and media-controls-dark-bar-background. Darin suggested they
1277         be sorted, so I did this at the same time.
1278         * platform/ThemeTypes.h: New ControlParts for the values, and
1279         sort the values since they need to be in sync with
1280         CSSValueKeywords.in.
1281
1282         * platform/graphics/GraphicsLayer.h: Expose two new custom appearance
1283         values.
1284         * platform/graphics/ca/GraphicsLayerCA.cpp:
1285         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
1286         (WebCore::layerTypeForCustomBackdropAppearance): Helper function.
1287         (WebCore::isCustomBackdropLayerType): Ditto.
1288         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Merge setting
1289         a system backdrop layer in with the code that swaps to/from tiled layers.
1290         (WebCore::GraphicsLayerCA::changeLayerTypeTo): New method that does what
1291         swapFromOrToTiledLayer implemented, but also allows us to change to a
1292         system backdrop layer.
1293         (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer): Deleted.
1294         * platform/graphics/ca/GraphicsLayerCA.h:
1295
1296         * platform/graphics/ca/PlatformCALayer.h: New layer types.
1297         * platform/graphics/ca/mac/PlatformCALayerMac.mm: For now expose these
1298         as regular backdrop layers.
1299         (PlatformCALayerMac::PlatformCALayerMac):
1300         (PlatformCALayerMac::updateCustomAppearance):
1301
1302         * rendering/RenderLayerBacking.cpp:
1303         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer): Make sure to update
1304         custom appearance,
1305         (WebCore::RenderLayerBacking::updateCustomAppearance): New method.
1306         * rendering/RenderLayerBacking.h:
1307
1308 2015-03-03  Chris Dumez  <cdumez@apple.com>
1309
1310         Access ApplicationCacheStorage global instance via singleton() static member function
1311         https://bugs.webkit.org/show_bug.cgi?id=142239
1312
1313         Reviewed by Anders Carlsson.
1314
1315         Access ApplicationCacheStorage global instance via singleton() static
1316         member function as per WebKit coding style.
1317
1318 2015-03-03  Anders Carlsson  <andersca@apple.com>
1319
1320         Try to fix the build.
1321
1322         * platform/spi/cf/CFNetworkSPI.h:
1323
1324 2015-03-03  Timothy Horton  <timothy_horton@apple.com>
1325
1326         <attachment> label can get very wide, doesn't wrap/truncate
1327         https://bugs.webkit.org/show_bug.cgi?id=142214
1328         <rdar://problem/19982499>
1329
1330         Reviewed by Simon Fraser.
1331
1332         Test: fast/attachment/attachment-label-highlight.html
1333
1334         * rendering/RenderThemeMac.h:
1335         * rendering/RenderThemeMac.mm:
1336         (WebCore::labelTextColorForAttachment):
1337         (WebCore::AttachmentLayout::addLine):
1338         (WebCore::AttachmentLayout::layOutText):
1339         (WebCore::AttachmentLayout::AttachmentLayout):
1340         Make it possible to lay out multiple lines of label text.
1341         We lay out the whole string normally, but then only draw N (where N=1 for now,
1342         but is adjustable) of the lines. The remainder of the string is then
1343         merged into a single line, which is middle-truncated with an ellipsis
1344         and drawn in place of the N+1 line.
1345
1346         (WebCore::addAttachmentLabelBackgroundRightCorner):
1347         (WebCore::addAttachmentLabelBackgroundLeftCorner):
1348         (WebCore::paintAttachmentLabelBackground):
1349         Wrap the label background around the multiple lines of text with curved edges.
1350         We run first down the right side of the label, determining whether to use
1351         concave or convex arcs based on the relative widths of adjacent lines.
1352         Then, we run back up the left side of the label doing the same thing.
1353
1354         If the background rects of two lines are very similar (within the rounded rect radius),
1355         they will be expanded to the larger of the two, because otherwise the arcs
1356         look quite wrong.
1357
1358         (WebCore::paintAttachmentLabel):
1359         Draw the label with CoreText directly instead of bothering with WebCore
1360         text layout primitives. There's no need, and it makes wrapping much more complicated.
1361
1362         (WebCore::RenderThemeMac::paintAttachment):
1363         (WebCore::RenderThemeMac::paintAttachmentLabelBackground): Deleted.
1364         (WebCore::RenderThemeMac::paintAttachmentLabel): Deleted.
1365
1366 2015-03-03  Simon Fraser  <simon.fraser@apple.com>
1367
1368         Avoid applying the clip-path when painting, if a layer also has a shape layer mask
1369         https://bugs.webkit.org/show_bug.cgi?id=142212
1370
1371         Reviewed by Zalan Bujtas.
1372
1373         After r180882 we translate clip-path into a composited shape mask when the layer
1374         is composited. However, we were also still applying the clip-path when painting
1375         the layer contents.
1376         
1377         Now, we set the GraphicsLayer bits GraphicsLayerPaintClipPath and GraphicsLayerPaintMask
1378         only for the m_maskLayer's painting. This translate into setting PaintLayerPaintingCompositingMaskPhase
1379         and PaintLayerPaintingCompositingClipPathPhase only when painting that same mask layer,
1380         rather than always. To ensure that masks and clip-path get applied for software paints,
1381         add shouldPaintMask() and shouldApplyClipPath() that return true for non-composited layers,
1382         and when doing a flattening paint.
1383
1384         * rendering/RenderLayer.cpp:
1385         (WebCore::RenderLayer::paintLayerContents): Use shouldApplyClipPath().
1386         Pull three chunks of code under a single "if (shouldPaintContent && !selectionOnly)" condition.
1387         The condition for paintChildClippingMaskForFragments() is changed slightly; we need to call this
1388         only when painting the clip-path/mask layer contents, but also only when there is no mask to fill
1389         the clipped area for us.
1390         (WebCore::RenderLayer::calculateClipRects):
1391         (WebCore::RenderLayer::paintsWithClipPath): Deleted.
1392         * rendering/RenderLayer.h:
1393         * rendering/RenderLayerBacking.cpp:
1394         (WebCore::RenderLayerBacking::updateMaskingLayer): Be sure to set the GraphicsLayerPaintClipPath bit
1395         when having a mask forces us onto the painting path.
1396
1397 2015-03-03  Anders Carlsson  <andersca@apple.com>
1398
1399         Use the correct display name for website data for local files
1400         https://bugs.webkit.org/show_bug.cgi?id=142228
1401
1402         Reviewed by Dan Bernstein.
1403
1404         * English.lproj/Localizable.strings:
1405         Add local file display name.
1406
1407         * platform/spi/cf/CFNetworkSPI.h:
1408         Add kCFHTTPCookieLocalFileDomain declaration.
1409
1410 2015-03-03  Myles C. Maxfield  <mmaxfield@apple.com>
1411
1412         BreakingContext cleanup
1413         https://bugs.webkit.org/show_bug.cgi?id=142146
1414
1415         Reviewed by Dean Jackson.
1416
1417         1. Use commitLineBreakAtCurrentWidth() instead of directly
1418         updating m_width and m_lineBreak, because the name makes the
1419         intent clearer.
1420         2. Remove duplicate function LineBreaker::nextSegmentBreak().
1421         3. lineStyle() takes care of inspecting RenderText's parent's
1422         style.
1423         4. Add FIXME to BreakingContext::initializeForCurrentObject()
1424         because it seems like we are ignoring first-line style for
1425         some properties.
1426
1427         No new tests because there is no behavior change.
1428
1429         * rendering/line/BreakingContextInlineHeaders.h:
1430         (WebCore::BreakingContext::BreakingContext):
1431         (WebCore::BreakingContext::initializeForCurrentObject):
1432         (WebCore::BreakingContext::handleReplaced):
1433         (WebCore::BreakingContext::handleText):
1434         (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
1435         (WebCore::BreakingContext::handleEndOfLine):
1436         * rendering/line/LineBreaker.cpp:
1437         (WebCore::LineBreaker::nextLineBreak): Deleted.
1438         (WebCore::LineBreaker::nextSegmentBreak): Deleted.
1439         * rendering/line/LineBreaker.h:
1440         * rendering/line/LineInlineHeaders.h:
1441         (WebCore::lineStyle):
1442
1443 2015-03-03  Chris Dumez  <cdumez@apple.com>
1444
1445         Make AudioContext suspendable when it is not rendering
1446         https://bugs.webkit.org/show_bug.cgi?id=142210
1447         <rdar://problem/19923085>
1448
1449         Reviewed by Eric Carlson.
1450
1451         Make AudioContext suspendable when it is not rendering to increase the
1452         likelihood of entering the PageCache for pages using WebAudio.
1453
1454         This patch adds a state member to AudioContext with 3 possible states:
1455         Suspended / Running / Closed, as defined in the specification:
1456         http://webaudio.github.io/web-audio-api/#widl-AudioContext-state
1457
1458         This state is used to decide if we can suspend the page or not. We
1459         can safely suspend if the AudioContext's state is suspended (did not
1460         start rendering) or closed (Stopped rendering).
1461
1462         Note that this patch does not expose the AudioContext's state to the
1463         Web yet, even though it is exposed in the latest specification.
1464
1465         Tests: fast/history/page-cache-closed-audiocontext.html
1466                fast/history/page-cache-running-audiocontext.html
1467                fast/history/page-cache-suspended-audiocontext.html
1468
1469         * Modules/webaudio/AudioContext.cpp:
1470         (WebCore::AudioContext::AudioContext):
1471         (WebCore::AudioContext::uninitialize):
1472         (WebCore::AudioContext::canSuspend):
1473         (WebCore::AudioContext::startRendering):
1474         (WebCore::AudioContext::fireCompletionEvent):
1475         * Modules/webaudio/AudioContext.h:
1476
1477 2015-03-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1478
1479         [SOUP] Use SoupMessage::starting instead of SoupSession::request-started
1480         https://bugs.webkit.org/show_bug.cgi?id=142164
1481
1482         Reviewed by Sergio Villar Senin.
1483
1484         SoupSession::request-started is deprecated in libsoup 2.50. Both
1485         signals are equivalent, but SoupMessage::starting is also emitted
1486         for resources loaded from the disk cache. This fixes web timing
1487         calculations for cached resources, since we were not initializing
1488         m_requestStart.
1489
1490         * platform/network/soup/ResourceHandleSoup.cpp:
1491         (WebCore::startingCallback):
1492         (WebCore::createSoupMessageForHandleAndRequest):
1493         * platform/network/soup/SoupNetworkSession.cpp:
1494         (WebCore::SoupNetworkSession::SoupNetworkSession):
1495
1496 2015-03-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1497
1498         [SOUP] Synchronous XMLHttpRequests can time out when we reach the max connections limit
1499         https://bugs.webkit.org/show_bug.cgi?id=141508
1500
1501         Reviewed by Sergio Villar Senin.
1502
1503         Use SOUP_MESSAGE_IGNORE_CONNECTION_LIMITS flag when loading a
1504         synchronous message instead of increasing the maximum number of
1505         connections allowed if the soup version is recent enough.
1506         The current solution of increasing/decreasing the limits doesn't
1507         always work, because connections are not marked as IDLE in libsoup
1508         until the message is unqueued, but we don't wait for the message
1509         to be unqueued to finish our loads in WebKit, we finish them as
1510         soon as we have finished reading the stream. This causes that
1511         synchronous loads keep blocked in the nested main loop until the
1512         timeout of 10 seconds is fired and the load fails.
1513         Also marked WebCoreSynchronousLoader class as final, the virtual
1514         methods as override and removed the unsused method isSynchronousClient.
1515
1516         * platform/network/soup/ResourceHandleSoup.cpp:
1517         (WebCore::createSoupMessageForHandleAndRequest):
1518         (WebCore::WebCoreSynchronousLoader::WebCoreSynchronousLoader):
1519         (WebCore::WebCoreSynchronousLoader::isSynchronousClient): Deleted.
1520         (WebCore::WebCoreSynchronousLoader::didReceiveResponse):
1521         (WebCore::WebCoreSynchronousLoader::didReceiveData):
1522         (WebCore::WebCoreSynchronousLoader::didReceiveBuffer):
1523         (WebCore::WebCoreSynchronousLoader::didFinishLoading):
1524         (WebCore::WebCoreSynchronousLoader::didFail):
1525         (WebCore::WebCoreSynchronousLoader::didReceiveAuthenticationChallenge):
1526         (WebCore::WebCoreSynchronousLoader::shouldUseCredentialStorage):
1527
1528 2015-03-02  David Kilzer  <ddkilzer@apple.com>
1529
1530         [iOS] Disable -Wdeprecated-declaration warnings in WebVideoFullscreenInterfaceAVKit.mm
1531
1532         Fixing the deprecations is tracked by: <rdar://problem/20018692>
1533
1534         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1535         (WebVideoFullscreenInterfaceAVKit::enterFullscreenOptimized):
1536         Ignore -Wdeprecated-declaration warnings via clang pragmas.
1537
1538 2015-03-02  Commit Queue  <commit-queue@webkit.org>
1539
1540         Unreviewed, rolling out r180902.
1541         https://bugs.webkit.org/show_bug.cgi?id=142205
1542
1543         It broke scrolling in some cases. See bug 142202 for details.
1544         (Requested by bdash on #webkit).
1545
1546         Reverted changeset:
1547
1548         "Move scroll animating functions from ScrollAnimator to
1549         ScrollController"
1550         https://bugs.webkit.org/show_bug.cgi?id=142102
1551         http://trac.webkit.org/changeset/180902
1552
1553 2015-03-02  Commit Queue  <commit-queue@webkit.org>
1554
1555         Unreviewed, rolling out r180911.
1556         https://bugs.webkit.org/show_bug.cgi?id=142204
1557
1558         The tests it added are crashing (Requested by bdash on
1559         #webkit).
1560
1561         Reverted changeset:
1562
1563         "Add a microtask abstraction"
1564         https://bugs.webkit.org/show_bug.cgi?id=137496
1565         http://trac.webkit.org/changeset/180911
1566
1567 2015-03-02  Yoav Weiss  <yoav@yoav.ws>
1568
1569         Add a microtask abstraction
1570         https://bugs.webkit.org/show_bug.cgi?id=137496
1571
1572         Reviewed by Sam Weinig.
1573
1574         This patch adds a microtask abstraction: https://html.spec.whatwg.org/multipage/webappapis.html#microtask
1575         That abstraction is required in order to enable async loading of images,
1576         which is in turn required to enable support for the picture element, as well as
1577         to make sure that the order of properties set on HTMLImageElement has no implications.
1578
1579         * WebCore.vcxproj/WebCore.vcxproj: Add MicroTask.{h,cpp} to the project.
1580         * WebCore.vcxproj/WebCoreTestSupport.vcxproj: Add MicroTaskTest.{h,cpp} to the project.
1581         * WebCore.vcxproj/WebCore.vcxproj.filters: Add MicroTask.{h,cpp} to the project.
1582         * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: Add MicroTaskTest.{h,cpp} to the project.
1583         * WebCore.xcodeproj/project.pbxproj: Add MicroTask{,Test}.{h,cpp} to the project.
1584         * dom/Document.h: Add WEBCORE_EXPORT to addConsoleMessage, so it can be used in MicroTaskTest that's in WebCoreTestSupport..
1585         * dom/MicroTask.h: Add a MicroTask interface class. Add a MicroTaskQueue singleton.
1586         (WebCore::MicroTask::~MicroTask):
1587         (WebCore::MicroTask::run): Run the microtask.
1588         * dom/MicroTask.cpp: Implement the MicroTaskQueue singleton.
1589         (WebCore::MicroTaskQueue::singleton): Get a singleton instance of MicroTaskQueue.
1590         (WebCore::MicroTaskQueue::queueMicroTask): Add a microtask to the queue.
1591         (WebCore::MicroTaskQueue::runMicroTasks): Run all the microtasks in the queue and clear it.
1592         * dom/ScriptRunner.cpp: Trigger running of all microtasks in queue.
1593         (WebCore::ScriptRunner::timerFired):
1594         * html/parser/HTMLScriptRunner.cpp: Trigger running of all microtasks in queue.
1595         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
1596         (WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing):
1597         (WebCore::HTMLScriptRunner::runScript):
1598         * testing/Internals.cpp: Add a method to queue a test microtask.
1599         (WebCore::Internals::queueMicroTask):
1600         * testing/Internals.h: Add a method to queue a test microtask.
1601         (WebCore::Internals::queueMicroTask):
1602         * testing/Internals.idl: Expose test microtask queueing to test JS.
1603         * testing/MicroTaskTest.cpp: Add a test class that implements a microtask and prints to the console when it runs.
1604         (WebCore::MicroTaskTest::run): Run the microtask
1605         (WebCore::MicroTaskTest::create): Create a test microtask.
1606         * testing/MicroTaskTest.h: Add a test class that implements a microtask.
1607         (WebCore::MicroTaskTest::run):
1608         (WebCore::MicroTaskTest::create):
1609
1610 2015-03-02  Jeremy Jones  <jeremyj@apple.com>
1611
1612         RenderVideo should not paint the video frame when video is fullscreen.
1613         https://bugs.webkit.org/show_bug.cgi?id=142097
1614
1615         Reviewed by Eric Carlson.
1616
1617         For performance and correctness, RenderVideo should not paint the current video frame
1618         inline when video is fullscreen. This happens when snapshots are taken and can have a
1619         negative performance impact.
1620
1621         * rendering/RenderVideo.cpp:
1622         (WebCore::RenderVideo::paintReplaced):
1623
1624 2015-03-02  Dean Jackson  <dino@apple.com>
1625
1626         [iOS Media] Airplay button should be blue when active
1627         https://bugs.webkit.org/show_bug.cgi?id=142193
1628
1629         Reviewed by Brent Fulgham.
1630
1631         Add a blue form of the Airplay button that is used
1632         when we are actively displaying on another screen.
1633
1634         * Modules/mediacontrols/mediaControlsiOS.css:
1635         (video::-webkit-media-controls-wireless-playback-picker-button):
1636         (video::-webkit-media-controls-wireless-playback-picker-button:active):
1637         (video::-webkit-media-controls-wireless-playback-picker-button.playing):
1638         * Modules/mediacontrols/mediaControlsiOS.js:
1639         (ControllerIOS.prototype.updateWirelessPlaybackStatus):
1640
1641 2015-03-02  Brent Fulgham  <bfulgham@apple.com>
1642
1643         Move scroll animating functions from ScrollAnimator to ScrollController
1644         https://bugs.webkit.org/show_bug.cgi?id=142102
1645         <rdar://problem/20007161>
1646
1647         Reviewed by Simon Fraser.
1648
1649         No change in functionality.
1650         
1651         Do some refactoring of the various scrolling classes:
1652         1. Consolidate animation times to RunLoop::Timer instead of a combination of WebCore::Timer
1653            and CFRunLoopTimers. Do this for Scroll Snap Point and Rubberband animations.
1654         2. Move ScrollController from platform/mac to platform/cocoa to enable sharing with iOS.
1655         3. Move code from ScrollAnimator{Mac} -> ScrollController.
1656         4. Rename scrollOffsetInAxis -> scrollOffsetOnAxis
1657         5. Rename immediateScrollInAxis -> immediateScrollOnAxis
1658
1659         * WebCore.xcodeproj/project.pbxproj: Move ScrollController to 'platform/cocoa'
1660         * page/mac/EventHandlerMac.mm: Make sure the scroll controller is notified of end-of-scroll
1661         events, just as is done for the "event not handled" case in EventHandler.cpp. 
1662         (WebCore::EventHandler::platformCompleteWheelEvent):
1663         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Remove timer and some delegate
1664         methods, now that ScrollController is controlling this state.
1665         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1666         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac): We no longer
1667         need to clean up the CFRunLoopTimer.
1668         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Add temporary stub needed
1669         until Bug 141973 is completed.).
1670         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollOnAxis): Ditto.
1671         (WebCore::ScrollingTreeFrameScrollingNodeMac::startSnapRubberbandTimer): Deleted.
1672         (WebCore::ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer): Deleted.
1673         * platform/ScrollAnimator.cpp:
1674         (WebCore::ScrollAnimator::ScrollAnimator):
1675         (WebCore::ScrollAnimator::processWheelEventForScrollSnap): Just call the ScrollController method.
1676         (WebCore::ScrollAnimator::handleWheelEvent): Ditto.
1677         (WebCore::ScrollAnimator::updateScrollAnimatorsAndTimers): Ditto.
1678         (WebCore::ScrollAnimator::scrollOffsetOnAxis): Renamed from scrollOffsetInAxis.
1679         (WebCore::ScrollAnimator::scrollOffsetInAxis): Deleted.
1680         (WebCore::ScrollAnimator::immediateScrollOnAxis): Renamed from immediateScrollInAxis.
1681         (WebCore::ScrollAnimator::immediateScrollInAxis): Deleted.
1682         (WebCore::ScrollAnimator::startScrollSnapTimer): Deleted.
1683         (WebCore::ScrollAnimator::stopScrollSnapTimer): Deleted.
1684         (WebCore::ScrollAnimator::horizontalScrollSnapTimerFired): Deleted.
1685         (WebCore::ScrollAnimator::verticalScrollSnapTimerFired): Deleted.
1686         * platform/ScrollAnimator.h:
1687         * platform/cocoa/ScrollController.h: Copied from platform/mac/ScrollController.h.
1688         * platform/cocoa/ScrollController.mm: Copied from platform/mac/ScrollController.mm.
1689         (WebCore::ScrollController::ScrollController): Update to initialize new timers.
1690         (WebCore::ScrollController::handleWheelEvent): Update to handle Scroll Snap Point events.
1691         (WebCore::ScrollController::startSnapRubberbandTimer): Added.
1692         (WebCore::ScrollController::stopSnapRubberbandTimer): Manage animation timers locally, do not
1693         require client to maintain timers.
1694         (WebCore::ScrollController::snapRubberBand): Ditto.
1695         (WebCore::ScrollController::processWheelEventForScrollSnap): Added. (Moved from ScrollAnimatorMac)
1696         (WebCore::ScrollController::updateScrollAnimatorsAndTimers): Ditto. Also updated to use RunLoop::Timer.
1697         (WebCore::ScrollController::startScrollSnapTimer): Ditto. Also updated to use RunLoop::Timer.
1698         (WebCore::ScrollController::stopScrollSnapTimer):  Ditto. Also updated to use RunLoop::Timer.
1699         (WebCore::ScrollController::horizontalScrollSnapTimerFired): Ditto.
1700         (WebCore::ScrollController::verticalScrollSnapTimerFired): Ditto.
1701         (WebCore::ScrollController::scrollOffsetOnAxis): Moved from ScrollAnimatorMac.
1702         (WebCore::ScrollController::immediateScrollOnAxis): Ditto.
1703         * platform/mac/AxisScrollSnapAnimator.h: Rename methods from 'InAxis' to 'OnAxis'
1704         * platform/mac/AxisScrollSnapAnimator.mm: Ditto.
1705         * platform/mac/ScrollAnimatorMac.h:
1706         * platform/mac/ScrollAnimatorMac.mm:
1707         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac): Remove unused Rubberband timers (now that this is
1708         controlled in the ScrollController)
1709         (WebCore::ScrollAnimatorMac::startSnapRubberbandTimer): Deleted.
1710         (WebCore::ScrollAnimatorMac::stopSnapRubberbandTimer): Deleted.
1711         (WebCore::ScrollAnimatorMac::snapRubberBandTimerFired): Deleted.
1712         * platform/mac/ScrollController.h: Removed.
1713         * platform/mac/ScrollController.mm: Removed.
1714
1715 2015-03-02  Mark Lam  <mark.lam@apple.com>
1716
1717         The InspectorTimelineAgent should gracefully handle attempts to start more than once.
1718         <https://webkit.org/b/142189>
1719
1720         Reviewed by Joseph Pecoraro.
1721
1722         No new tests.  Unskipped an existing test that already asserts this.
1723
1724         InspectorTimelineAgent::internalStop() already checks for redundant calls to it in
1725         case the InspectorTimelineAgent is already disabled. Similarly,
1726         InspectorTimelineAgent::internalStart() should check if the InspectorTimelineAgent
1727         is already enabled before proceeding to do work to enable it. Though wasteful,
1728         it is legal for clients of the InspectorTimelineAgent to invoke start on it more
1729         than once. Hence, this check is needed.
1730
1731         This check fixes the debug assertion failure when running the
1732         inspector/timeline/debugger-paused-while-recording.html test. The test can now
1733         be unskipped.
1734
1735         * inspector/InspectorTimelineAgent.cpp:
1736         (WebCore::InspectorTimelineAgent::internalStart):
1737
1738 2015-03-02  Roger Fong  <roger_fong@apple.com>
1739
1740         Update backgrounds of sliders for inline media controls on OS X.
1741         https://bugs.webkit.org/show_bug.cgi?id=142188.
1742         <rdar://problem/20012413>
1743
1744         Reviewed by Dean Jackson.
1745
1746         Don’t use CSS to draw volume and timeline slider backgrounds.
1747         * Modules/mediacontrols/mediaControlsApple.css:
1748         (video::-webkit-media-controls-volume-slider):
1749         (audio::-webkit-media-controls-volume-slider::-webkit-slider-thumb):
1750         (audio::-webkit-media-controls-timeline):
1751         (audio::-webkit-media-controls-timeline::-webkit-slider-thumb):
1752         (audio::-webkit-media-controls-panel .thumbnail-track):
1753         (audio::-webkit-media-controls-volume-slider::-webkit-slider-thumb:active::-webkit-slider-thumb): Deleted.
1754         (audio::-webkit-media-controls-timeline:active::-webkit-slider-thumb,): Deleted.
1755
1756         Draw volume and timeline slider backgrounds using 2d canvases.
1757         * Modules/mediacontrols/mediaControlsApple.js:
1758         (Controller.prototype.createControls):
1759         (Controller.prototype.handleVolumeSliderInput):
1760         (Controller.prototype.addRoundedRect):
1761         (Controller.prototype.drawTimelineBackground):
1762         (Controller.prototype.drawVolumeBackground):
1763         (Controller.prototype.showControls):
1764         * Modules/mediacontrols/mediaControlsiOS.js:
1765         (ControllerIOS.prototype.addRoundedRect): Deleted.
1766
1767 2015-03-01  Roger Fong  <roger_fong@apple.com>
1768
1769         Update inline media element controls appearance Part 1.
1770         https://bugs.webkit.org/show_bug.cgi?id=142138.
1771         <rdar://problem/19997384>
1772
1773         Reviewed by Dean Jackson.
1774
1775         Update positioning, sizes, and background colors media control elements.
1776         Volume and timeline sliders will be drawn in a separate patch via 2d canvases.
1777
1778         * Modules/mediacontrols/mediaControlsApple.css:
1779         (audio::-webkit-media-controls-panel):
1780         (video::-webkit-media-controls-panel):
1781         (audio::-webkit-media-controls-rewind-button):
1782         (audio::-webkit-media-controls-play-button):
1783         (audio::-webkit-media-controls-panel .mute-box):
1784         (video::-webkit-media-controls-volume-max-button):
1785         (audio::-webkit-media-controls-panel .volume-box):
1786         (audio::-webkit-media-controls-panel .volume-box:active):
1787         (video::-webkit-media-controls-volume-slider):
1788         (audio::-webkit-media-controls-toggle-closed-captions-button):
1789         (audio::-webkit-media-controls-fullscreen-button):
1790         (audio::-webkit-media-controls-current-time-display):
1791         (audio::-webkit-media-controls-time-remaining-display):
1792         (audio::-webkit-media-controls-timeline-container .hour-long-time): Deleted.
1793
1794 2015-03-02  David Kilzer  <ddkilzer@apple.com>
1795
1796         REGRESSION (r180882): Build failure: Methods not marked override in GraphicsLayerCA.h
1797         <http://webkit.org/b/138684>
1798
1799         Fixes the following build failures:
1800
1801             In file included from WebKit2/WebProcess/WebPage/DrawingArea.cpp:39:
1802             In file included from WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:30:
1803             In file included from WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.h:29:
1804             WebCore.framework/PrivateHeaders/GraphicsLayerCA.h:123:33: error: 'setShapeLayerPath' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
1805                 WEBCORE_EXPORT virtual void setShapeLayerPath(const Path&);
1806                                             ^
1807             In file included from WebKit2/WebProcess/WebPage/DrawingArea.cpp:30:
1808             In file included from WebKit2/WebProcess/WebPage/WebPage.h:46:
1809             In file included from WebKit2/WebProcess/Plugins/Plugin.h:31:
1810             WebCore.framework/PrivateHeaders/GraphicsLayer.h:390:18: note: overridden virtual function is here
1811                 virtual void setShapeLayerPath(const Path&);
1812                              ^
1813             In file included from WebKit2/WebProcess/WebPage/DrawingArea.cpp:39:
1814             In file included from WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:30:
1815             In file included from WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.h:29:
1816             WebCore.framework/PrivateHeaders/GraphicsLayerCA.h:124:33: error: 'setShapeLayerWindRule' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
1817                 WEBCORE_EXPORT virtual void setShapeLayerWindRule(WindRule);
1818                                             ^
1819             In file included from WebKit2/WebProcess/WebPage/DrawingArea.cpp:30:
1820             In file included from WebKit2/WebProcess/WebPage/WebPage.h:46:
1821             In file included from WebKit2/WebProcess/Plugins/Plugin.h:31:
1822             WebCore.framework/PrivateHeaders/GraphicsLayer.h:393:18: note: overridden virtual function is here
1823                 virtual void setShapeLayerWindRule(WindRule);
1824                              ^
1825             2 errors generated.
1826
1827         * platform/graphics/ca/GraphicsLayerCA.h:
1828         (WebCore::GraphicsLayer::setShapeLayerPath): Mark as override.
1829         (WebCore::GraphicsLayer::setShapeLayerWindRule): Ditto.
1830
1831 2015-03-01  Simon Fraser  <simon.fraser@apple.com>
1832
1833         Make clip-path work on <video>, <canvas> etc.
1834         https://bugs.webkit.org/show_bug.cgi?id=138684
1835
1836         Reviewed by Darin Adler.
1837         
1838         clip-path only worked in compositing layers on the painted contents of the layer,
1839         and failed to clip children. Fix this by translating the clip path into a Path
1840         which is set on a CA shape layer (for Mac and iOS), or painted into the
1841         RenderLayerBacking's mask layer. There are two code paths:
1842
1843         1. clip-path which is a <basic-shape> or <geometry-box>, and no mask.
1844             Here we can use the optimal code path of converting the clip into a path
1845             that is put onto a CAShapeLayer, which is then used as a mask. There is no
1846             additional backing store.
1847         2. clip-path with an SVG reference, or clip-path combined with -webkit-mask:
1848             Here we have to allocate backing store for the mask layer, and paint the
1849             clip path (possibly with the mask).
1850         
1851         We add GraphicsLayer::Type::Shape, and add a getter for the layer type.
1852
1853         Tests: compositing/masks/compositing-clip-path-and-mask.html
1854                compositing/masks/compositing-clip-path-mask-change.html
1855                compositing/masks/compositing-clip-path.html
1856                compositing/masks/reference-clip-path-on-composited.html
1857
1858         * platform/graphics/GraphicsLayer.cpp:
1859         (WebCore::GraphicsLayer::GraphicsLayer): Store the type in the layer so the getter can return it.
1860         (WebCore::GraphicsLayer::shapeLayerPath): Get and set the shape layer path.
1861         (WebCore::GraphicsLayer::setShapeLayerPath): Ditto.
1862         (WebCore::GraphicsLayer::shapeLayerWindRule): Get and set the shape layer wind rule.
1863         (WebCore::GraphicsLayer::setShapeLayerWindRule): Ditto.
1864         * platform/graphics/GraphicsLayer.h:
1865         (WebCore::GraphicsLayer::type): Expose the type.
1866         (WebCore::GraphicsLayer::supportsLayerType): Allow the cross-platform code to use
1867         shape layers when it knows they are available.
1868         (WebCore::GraphicsLayer::needsClippingMaskLayer): Deleted. This was never used.
1869         * platform/graphics/GraphicsLayerClient.h: Align the bits (helps avoid typos). Add a
1870         GraphicsLayerPaintClipPath phase.
1871         * platform/graphics/Path.h: Some exports since WK2 needs to encode Paths now.
1872         * platform/graphics/ca/GraphicsLayerCA.cpp:
1873         (WebCore::GraphicsLayerCA::initialize): Make shape layers.
1874         (WebCore::GraphicsLayerCA::setShapeLayerPath): Setter for the shape path. Sadly we
1875         can't early return on unchanged paths yet.
1876         (WebCore::GraphicsLayerCA::setShapeLayerWindRule):
1877         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Updates for shape path
1878         and wind rule.
1879         (WebCore::GraphicsLayerCA::updateShape):
1880         (WebCore::GraphicsLayerCA::updateWindRule):
1881         * platform/graphics/ca/GraphicsLayerCA.h: Some new dirty bits for shape path and wind rule.
1882         * platform/graphics/ca/PlatformCALayer.h:
1883         * platform/graphics/ca/mac/PlatformCALayerMac.h:
1884         * platform/graphics/ca/mac/PlatformCALayerMac.mm: Got rid of lots of m_layer.get().
1885         (PlatformCALayerMac::~PlatformCALayerMac):
1886         (PlatformCALayerMac::setNeedsDisplay):
1887         (PlatformCALayerMac::setNeedsDisplayInRect):
1888         (PlatformCALayerMac::removeFromSuperlayer):
1889         (PlatformCALayerMac::setSublayers):
1890         (PlatformCALayerMac::removeAllSublayers):
1891         (PlatformCALayerMac::appendSublayer):
1892         (PlatformCALayerMac::insertSublayer):
1893         (PlatformCALayerMac::replaceSublayer):
1894         (PlatformCALayerMac::adoptSublayers):
1895         (PlatformCALayerMac::addAnimationForKey):
1896         (PlatformCALayerMac::removeAnimationForKey):
1897         (PlatformCALayerMac::animationForKey):
1898         (PlatformCALayerMac::setMask):
1899         (PlatformCALayerMac::isOpaque):
1900         (PlatformCALayerMac::setOpaque):
1901         (PlatformCALayerMac::bounds):
1902         (PlatformCALayerMac::setBounds):
1903         (PlatformCALayerMac::position):
1904         (PlatformCALayerMac::setPosition):
1905         (PlatformCALayerMac::anchorPoint):
1906         (PlatformCALayerMac::setAnchorPoint):
1907         (PlatformCALayerMac::transform):
1908         (PlatformCALayerMac::setTransform):
1909         (PlatformCALayerMac::sublayerTransform):
1910         (PlatformCALayerMac::setSublayerTransform):
1911         (PlatformCALayerMac::setHidden):
1912         (PlatformCALayerMac::setGeometryFlipped):
1913         (PlatformCALayerMac::isDoubleSided):
1914         (PlatformCALayerMac::setDoubleSided):
1915         (PlatformCALayerMac::masksToBounds):
1916         (PlatformCALayerMac::setMasksToBounds):
1917         (PlatformCALayerMac::acceleratesDrawing):
1918         (PlatformCALayerMac::setAcceleratesDrawing):
1919         (PlatformCALayerMac::contents):
1920         (PlatformCALayerMac::setContents):
1921         (PlatformCALayerMac::setContentsRect):
1922         (PlatformCALayerMac::setMinificationFilter):
1923         (PlatformCALayerMac::setMagnificationFilter):
1924         (PlatformCALayerMac::backgroundColor):
1925         (PlatformCALayerMac::setBackgroundColor):
1926         (PlatformCALayerMac::setBorderWidth):
1927         (PlatformCALayerMac::setBorderColor):
1928         (PlatformCALayerMac::opacity):
1929         (PlatformCALayerMac::setOpacity):
1930         (PlatformCALayerMac::copyFiltersFrom):
1931         (PlatformCALayerMac::setName):
1932         (PlatformCALayerMac::setSpeed):
1933         (PlatformCALayerMac::setTimeOffset):
1934         (PlatformCALayerMac::contentsScale):
1935         (PlatformCALayerMac::setContentsScale):
1936         (PlatformCALayerMac::cornerRadius):
1937         (PlatformCALayerMac::setCornerRadius):
1938         (PlatformCALayerMac::setEdgeAntialiasingMask):
1939         (PlatformCALayerMac::shapeWindRule): New function.
1940         (PlatformCALayerMac::setShapeWindRule): Ditto.
1941         (PlatformCALayerMac::shapePath): Ditto.
1942         (PlatformCALayerMac::setShapePath): Ditto.
1943         (PlatformCALayer::isWebLayer):
1944         * platform/graphics/cg/PathCG.cpp:
1945         (WebCore::Path::Path): nullptr.
1946         * rendering/RenderLayer.cpp:
1947         (WebCore::RenderLayer::paintsWithClipPath): Return true if the clip path is painted.
1948         (WebCore::RenderLayer::computeClipPath): Factor code that computes the clip path into this
1949         function, so we can call it from RenderLayerBacking too.
1950         (WebCore::RenderLayer::setupClipPath):
1951         (WebCore::RenderLayer::paintLayerContents): We only want to apply the clip path
1952         for painting when we're either painting a non-composited layer, or we're painting the
1953         mask layer of a composited layer. We in the latter case, we just want to fill the clip
1954         path with black, so re-use the paintChildClippingMaskForFragments() which does this.
1955         * rendering/RenderLayer.h: Align the bits, add PaintLayerPaintingCompositingClipPathPhase.
1956         * rendering/RenderLayerBacking.cpp:
1957         (WebCore::RenderLayerBacking::~RenderLayerBacking):
1958         (WebCore::RenderLayerBacking::updateConfiguration):
1959         (WebCore::RenderLayerBacking::updateGeometry): Move mask updating into its own function.
1960         (WebCore::RenderLayerBacking::updateMaskingLayerGeometry): If we're using the shape layer
1961         code path, compute the Path and set it and the wind rule on the mask layer.
1962         (WebCore::RenderLayerBacking::updateMaskingLayer): This is now more complex, as it has
1963         to deal with combinations of clip-path and mask, some of which allow for the shape layer
1964         mask, and we handle dynamic changes between these and painted masks.
1965         (WebCore::RenderLayerBacking::paintingPhaseForPrimaryLayer): Include the GraphicsLayerPaintClipPath phase.
1966         (WebCore::RenderLayerBacking::paintIntoLayer): Map GraphicsLayerPaintClipPath to PaintLayerPaintingCompositingClipPathPhase.
1967         (WebCore::RenderLayerBacking::updateMaskLayer): Deleted.
1968         * rendering/RenderLayerBacking.h:
1969
1970 2015-03-01  Hunseop Jeong  <hs85.jeong@samsung.com>
1971
1972         [Cairo] Implement Path::addEllipse 
1973         https://bugs.webkit.org/show_bug.cgi?id=142144
1974
1975         Reviewed by Gyuyoung Kim.
1976
1977         Add support for addEllipse method for platforms using cairo.
1978
1979         * platform/graphics/cairo/PathCairo.cpp:
1980         (WebCore::Path::addEllipse):
1981
1982 2015-03-01  Joonghun Park  <jh718.park@samsung.com>
1983
1984         Use std::unique_ptr instead of PassOwnPtr|OwnPtr for ScrollAnimator
1985         https://bugs.webkit.org/show_bug.cgi?id=142143
1986
1987         Reviewed by Darin Adler.
1988
1989         No new tests, no behavior changes.
1990
1991         * platform/ScrollAnimator.cpp:
1992         (WebCore::ScrollAnimator::create):
1993         * platform/ScrollAnimator.h:
1994         * platform/ScrollAnimatorNone.cpp:
1995         (WebCore::ScrollAnimator::create):
1996         * platform/ScrollableArea.h:
1997         * platform/ios/ScrollAnimatorIOS.mm:
1998         (WebCore::ScrollAnimator::create):
1999         * platform/mac/ScrollAnimatorMac.mm:
2000         (WebCore::ScrollAnimator::create):
2001
2002 2015-02-26  Andy Estes  <aestes@apple.com>
2003
2004         [Content Filtering] Move another declaration to WebFilterEvaluatorSPI.h
2005         https://bugs.webkit.org/show_bug.cgi?id=142066
2006
2007         Reviewed by Andreas Kling.
2008
2009         * platform/ios/ContentFilterIOS.mm:
2010         * platform/spi/cocoa/WebFilterEvaluatorSPI.h:
2011
2012 2015-03-01  Chris Dumez  <cdumez@apple.com>
2013
2014         Make NotificationCenter / Notification suspendable
2015         https://bugs.webkit.org/show_bug.cgi?id=142117
2016         <rdar://problem/19923085>
2017
2018         Reviewed by Andreas Kling.
2019
2020         Make NotificationCenter / Notification suspendable so that pages using
2021         them can enter the PageCache.
2022
2023         NotificationCenter can safely be suspended if there are no pending
2024         permission requests. This required adding an
2025         "hasPendingPermissionRequests()" callback to the NotificationClient.
2026
2027         Notification can safely be suspended if it is either idle (not showing
2028         yet) or closed.
2029
2030         Tests: fast/history/page-cache-notification-non-suspendable.html
2031                fast/history/page-cache-notification-suspendable.html
2032
2033         * Modules/notifications/Notification.cpp:
2034         (WebCore::Notification::canSuspend):
2035         * Modules/notifications/NotificationCenter.cpp:
2036         (WebCore::NotificationCenter::canSuspend):
2037         * Modules/notifications/NotificationClient.h:
2038
2039 2015-03-01  Ryosuke Niwa  <rniwa@webkit.org>
2040
2041         isContentEditable shouldn't trigger synchronous style recalc in most cases
2042         https://bugs.webkit.org/show_bug.cgi?id=129034
2043
2044         Reviewed by Antti Koivisto.
2045
2046         Avoid style recalc inside isContentEditable when the document doesn't contain -webkit-user-modify or
2047         -webkit-user-select: all. Instead, compute the value from contenteditable attributes in ancestors.
2048         However, still compute the editability from the style tree when it's up-to-date in order to avoid
2049         repeatedly walking up the DOM tree in a hot code path inside editing.
2050
2051         Test: fast/dom/HTMLElement/dynamic-editability-change.html
2052
2053         * css/CSSGrammar.y.in: No need to pass in "true" as we never call this function with false.
2054         * css/CSSParser.cpp:
2055         (WebCore::isValidKeywordPropertyAndValue): Calls parserSetUsesStyleBasedEditability as needed.
2056         (WebCore::parseKeywordValue): Passes around StyleSheetContents*.
2057         (WebCore::CSSParser::parseValue): Ditto.
2058         (WebCore::CSSParser::parseFont): Ditto.
2059
2060         * css/StyleSheetContents.cpp:
2061         (WebCore::StyleSheetContents::StyleSheetContents): Initializes and copies m_usesStyleBasedEditability.
2062
2063         * css/StyleSheetContents.h:
2064         (WebCore::StyleSheetContents::parserSetUsesRemUnits): Removed the argument since it was always true.
2065         (WebCore::StyleSheetContents::parserSetUsesStyleBasedEditability): Added.
2066         (WebCore::StyleSheetContents::usesStyleBasedEditability): Added.
2067
2068         * dom/Document.cpp:
2069         (WebCore::Document::recalcStyle): Added a FIXME as well as a comment explaining why we don't call
2070         setUsesStyleBasedEditability. Since Node::computeEditability triggers style recalc only when the flag
2071         is set to true, it's too late to update the flag here.
2072         (WebCore::Document::updateStyleIfNeeded): Uses a newly extracted needsStyleRecalc.
2073         (WebCore::Document::updateBaseURL): Preserves m_usesStyleBasedEditability as well as m_usesRemUnit.
2074         (WebCore::Document::usesStyleBasedEditability): Added. Returns true when inline style declarations or
2075         any active stylesheet uses -webkit-user-modify or -webkit-user-select: all. Flushing pending stylesheet
2076         changes here is fine because the alternative is to trigger a full blown style recalc.
2077
2078         * dom/Document.h:
2079         (WebCore::Document::needsStyleRecalc): Added. Extracted from updateStyleIfNeeded.
2080
2081         * dom/DocumentStyleSheetCollection.cpp:
2082         (WebCore::DocumentStyleSheetCollection::DocumentStyleSheetCollection):
2083         (WebCore::styleSheetsUseRemUnits): Deleted.
2084         (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets): Updates m_usesStyleBasedEditability
2085         as well as m_usesRemUnit.
2086
2087         * dom/DocumentStyleSheetCollection.h:
2088         (WebCore::DocumentStyleSheetCollection::usesStyleBasedEditability): Added.
2089         (WebCore::DocumentStyleSheetCollection::setUsesStyleBasedEditability): Added.
2090
2091         * dom/Node.cpp:
2092         (WebCore::computeEditabilityFromComputedStyle): Extracted from computeEditability.
2093         (WebCore::Node::computeEditability): When the style recalc is requested and the render tree is dirty,
2094         check if the document uses any CSS property that can affect the editability of elements. If it doesn't,
2095         compute the editability from contenteditable attributes in the anchors via matchesReadWritePseudoClass.
2096         Continue to use the style-based computation when the render tree isn't dirty to avoid the tree walk.
2097
2098         * html/HTMLElement.cpp:
2099         (WebCore::HTMLElement::editabilityFromContentEditableAttr): Extracted from matchesReadWritePseudoClass
2100         to be called in Node::computeEditability. Also made it return Editability instead of boolean.
2101         (WebCore::HTMLElement::matchesReadWritePseudoClass):
2102         * html/HTMLElement.h:
2103
2104 2015-03-01  Brent Fulgham  <bfulgham@apple.com>
2105
2106         [Win] Unreviewed build fix.
2107
2108         * WebCorePrefix.h: Provide some default definitions to help build on Windows
2109         machines with different application support libraries.
2110
2111 2015-02-28  Simon Fraser  <simon.fraser@apple.com>
2112
2113         Viewport units should not dirty style just before we do layout
2114         https://bugs.webkit.org/show_bug.cgi?id=141682
2115
2116         Reviewed by Zalan Bujtas.
2117         
2118         In documents using viewport units, we dirtied style every time layout changed
2119         the size of the document. This is nonsensical, because viewport units depend on the
2120         viewport size, not the document size.
2121         
2122         Move the style dirtying from layout() into availableContentSizeChanged(). Hook
2123         this up for WebKit1 by calling from -[WebFrameView _frameSizeChanged], and,
2124         since that causes availableContentSizeChanged() to be called for WK1 for the first
2125         time, protect the call to updateScrollbars() with a !platformWidget check.
2126
2127         Covered by existing viewport unit tests.
2128
2129         * page/FrameView.cpp:
2130         (WebCore::FrameView::layout):
2131         (WebCore::FrameView::availableContentSizeChanged):
2132         (WebCore::FrameView::viewportSizeForCSSViewportUnits): Add a FIXME comment. Whether
2133         scrollbars are ignored depends on the value of the overflow property on the root element.
2134         * page/FrameView.h:
2135         * platform/ScrollView.cpp:
2136         (WebCore::ScrollView::availableContentSizeChanged):
2137
2138 2015-02-28  Andreas Kling  <akling@apple.com>
2139
2140         [Cocoa] Purge SQLite page cache when under memory pressure.
2141         <https://webkit.org/b/142139>
2142         <rdar://problem/19997739>
2143
2144         Reviewed by Pratik Solanki.
2145
2146         Call out to sqlite3 cache purging SPI on Cocoa platforms when
2147         we need to free up some extra memory.
2148
2149         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2150         (WebCore::MemoryPressureHandler::platformReleaseMemory):
2151
2152 2015-02-28  Simon Fraser  <simon.fraser@apple.com>
2153
2154         FrameView::layoutTimerFired() should update style if needed before doing layout
2155         https://bugs.webkit.org/show_bug.cgi?id=141688
2156
2157         Reviewed by Andreas Kling.
2158
2159         If the style recalc timer has been scheduled to fire after the layout timer,
2160         when the layout timer fires, we might as well just do the style recalc
2161         too. The call to updateStyleIfNeeded() will cancel the pending style
2162         recalc timer.
2163         
2164         This doesn't have much impact on the number of layouts (measured via PLT)
2165         but seems like a reasonable thing to do.
2166
2167         * page/FrameView.cpp:
2168         (WebCore::FrameView::layoutTimerFired):
2169
2170 2015-02-28  Simon Fraser  <simon.fraser@apple.com>
2171
2172         Fullscreen video layers are off by one sometimes
2173         https://bugs.webkit.org/show_bug.cgi?id=142122
2174         rdar://problem/19878821
2175
2176         Reviewed by Eric Carlson.
2177
2178         Convert MediaPlayer::naturalSize() to return a FloatSize, since the natural size
2179         isn't always integral (because of preserving pixel aspect ratio etc). Fix all the media
2180         backends to use FloatSizes for natural size. Convert the video image drawing code
2181         paths to FloatSize, since naturalSize is used on the destination rect computation,
2182         and painting should be floating point anyway.
2183         
2184         Give the layer created by SourceBufferPrivateAVFObjC a name in debug builds.
2185
2186         * html/HTMLVideoElement.cpp:
2187         (WebCore::HTMLVideoElement::videoWidth):
2188         (WebCore::HTMLVideoElement::videoHeight):
2189         (WebCore::HTMLVideoElement::paintCurrentFrameInContext):
2190         * html/HTMLVideoElement.h:
2191         * html/canvas/CanvasRenderingContext2D.cpp:
2192         (WebCore::size):
2193         (WebCore::CanvasRenderingContext2D::drawImage):
2194         * html/canvas/WebGLRenderingContextBase.cpp:
2195         (WebCore::WebGLRenderingContextBase::videoFrameToImage):
2196         * platform/graphics/MediaPlayer.cpp:
2197         (WebCore::NullMediaPlayerPrivate::naturalSize):
2198         (WebCore::MediaPlayer::naturalSize):
2199         (WebCore::MediaPlayer::paint):
2200         (WebCore::MediaPlayer::paintCurrentFrameInContext):
2201         (WebCore::NullMediaPlayerPrivate::paint): Deleted.
2202         * platform/graphics/MediaPlayer.h:
2203         * platform/graphics/MediaPlayerPrivate.h:
2204         (WebCore::MediaPlayerPrivateInterface::paintCurrentFrameInContext):
2205         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2206         (WebCore::MediaPlayerPrivateAVFoundation::naturalSize):
2207         (WebCore::MediaPlayerPrivateAVFoundation::setNaturalSize):
2208         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2209         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2210         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2211         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext):
2212         (WebCore::MediaPlayerPrivateAVFoundationObjC::paint):
2213         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator):
2214         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
2215         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
2216         (WebCore::MediaPlayerPrivateAVFoundationObjC::sizeChanged):
2217         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
2218         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2219         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2220         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::naturalSize):
2221         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paint):
2222         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext):
2223         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
2224         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
2225         (WebCore::MediaSourcePrivateAVFObjC::naturalSize):
2226         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2227         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2228         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
2229         (WebCore::SourceBufferPrivateAVFObjC::naturalSize):
2230         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h:
2231         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm:
2232         (WebCore::VideoTrackPrivateMediaSourceAVFObjC::naturalSize):
2233         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
2234         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2235         (WebCore::MediaPlayerPrivateQTKit::naturalSize):
2236         (WebCore::MediaPlayerPrivateQTKit::paintCurrentFrameInContext):
2237         (WebCore::MediaPlayerPrivateQTKit::paint):
2238         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
2239         (WebCore::MockMediaPlayerMediaSource::naturalSize):
2240         (WebCore::MockMediaPlayerMediaSource::paint):
2241         * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
2242         * rendering/RenderVideo.cpp:
2243         (WebCore::RenderVideo::calculateIntrinsicSize):
2244         (WebCore::RenderVideo::paintReplaced):
2245
2246 2015-02-27  Hunseop Jeong  <hs85.jeong@samsung.com>
2247
2248         [EFL][GTK] Fix build break after r180790,180798
2249         https://bugs.webkit.org/show_bug.cgi?id=142127
2250
2251         Reviewed by Gyuyoung Kim.
2252
2253         * platform/graphics/cairo/PathCairo.cpp:
2254         (WebCore::Path::addEllipse):
2255
2256 2015-02-27  Zalan Bujtas  <zalan@apple.com>
2257
2258         Subpixel-layout: width: max-content; property might cause unnecessary scrollbar.
2259         https://bugs.webkit.org/show_bug.cgi?id=142065
2260
2261         Reviewed by Simon Fraser.
2262
2263         We should not pixelsnap (ceil in this case) logical coordinates during layout.
2264         Should this cause content to be partially cut off, we need to
2265         find the broken piece in the computation logic.
2266
2267         Covered by the unskipped test.
2268
2269         * rendering/RootInlineBox.cpp:
2270         (WebCore::RootInlineBox::paddedLayoutOverflowRect):
2271
2272 2015-02-27  Ryosuke Niwa  <rniwa@webkit.org>
2273
2274         Node::hasEditableStyle and isEditablePosition have too many options
2275         https://bugs.webkit.org/show_bug.cgi?id=142078
2276
2277         Reviewed by Andreas Kling.
2278
2279         Moved the code that dealt with accessibility to htmlediting.cpp from Node. This patch introduces
2280         new editing helper functions hasEditableStyle and isEditableNode for this purpose.
2281
2282         Also removed UserSelectAllTreatment from isContentEditable's arguments in the favor of using
2283         newly extracted computeEditability in call sites that specify this option since isContentEditable
2284         is a public DOM API.
2285
2286         No new tests since there should be no observable behavior changes.
2287
2288         * accessibility/AXObjectCache.h: Removed the declaration of an undefined function.
2289
2290         * dom/Element.cpp:
2291         (WebCore::Element::shouldUseInputMethod): Uses newly added computeEditability.
2292
2293         * dom/Node.cpp:
2294         (WebCore::Node::isContentEditable): Ditto. No longer takes UserSelectAllTreatment as an argument.
2295         (WebCore::Node::isContentRichlyEditable): Ditto.
2296         (WebCore::Node::computeEditability): Renamed from hasEditableStyle to avoid the confusion with
2297         a helper function of the same name. Added ShouldUpdateStyle as an argument to optionally update
2298         style tree. Also returns tri-state Editability enum instead of returning a boolean based on
2299         the value of EditableLevel argument.
2300         (WebCore::Node::isEditableToAccessibility): Moved to htmlediting.cpp.
2301         (WebCore::Node::willRespondToMouseClickEvents): Uses newly added computeEditability.
2302         (WebCore::Node::rootEditableElement): Moved to htmlediting.cpp.
2303
2304         * dom/Node.h: No longer includes EditingBoundary.h.
2305         (WebCore::Node::isContentEditable):
2306         (WebCore::Node::hasEditableStyle): No longer takes EditableType as an argument.
2307         (WebCore::Node::hasRichlyEditableStyle): Ditto.
2308
2309         * editing/ApplyStyleCommand.cpp:
2310         (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): Uses newly added isEditableNode.
2311         (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement): Ditto.
2312         * editing/DeleteFromTextNodeCommand.cpp:
2313         (WebCore::DeleteFromTextNodeCommand::doApply): Ditto.
2314         * editing/FrameSelection.cpp:
2315         (WebCore::CaretBase::invalidateCaretRect): Ditto.
2316         * editing/InsertNodeBeforeCommand.cpp:
2317         (WebCore::InsertNodeBeforeCommand::doApply): Ditto.
2318         (WebCore::InsertNodeBeforeCommand::doUnapply): Ditto.
2319         * editing/RemoveNodeCommand.cpp:
2320         (WebCore::RemoveNodeCommand::doApply): Ditto.
2321
2322         * editing/VisibleSelection.cpp:
2323         (WebCore::VisibleSelection::hasEditableStyle): Since this is the only caller of isEditablePosition
2324         which sets DoNotUpdateStyle, directly call hasEditableStyle on the container node instead. This was
2325         not possible prior to r180726 because isEditablePosition had to move out of tables.
2326
2327         * editing/VisibleUnits.cpp:
2328         (WebCore::previousLeafWithSameEditability): Uses newly added hasEditableStyle.
2329         (WebCore::nextLeafWithSameEditability): Ditto.
2330         (WebCore::rootEditableOrDocumentElement): Extracted from previousLinePosition. Use helper functions
2331         in htmlediting.cpp instead of member functions of Node since they no longer support EditableType.
2332         (WebCore::previousLinePosition):
2333         (WebCore::nextLinePosition):
2334
2335         * editing/htmlediting.cpp:
2336         (WebCore::highestEditableRoot): Uses newly added hasEditableStyle.
2337         (WebCore::isEditableToAccessibility): Moved from Node.
2338         (WebCore::computeEditability): Extracted from isEditablePosition.
2339         (WebCore::hasEditableStyle): Added.
2340         (WebCore::isEditableNode): Added.
2341         (WebCore::isEditablePosition): Now calls computeEditability.
2342         (WebCore::isRichlyEditablePosition): No longer takes EditableType since that variant was never used.
2343         (WebCore::editableRootForPosition): Moved the code from Node::rootEditableElement.
2344
2345         * editing/htmlediting.h:
2346
2347 2015-02-27  Chris Dumez  <cdumez@apple.com>
2348
2349         Make ActiveDOMObject::canSuspend() pure virtual
2350         https://bugs.webkit.org/show_bug.cgi?id=142096
2351         <rdar://problem/19923085>
2352
2353         Reviewed by Andreas Kling.
2354
2355         Make ActiveDOMObject::canSuspend() pure virtual so that people at least
2356         try to provide an implementation for it. The default implementation was
2357         returning false unconditionally and thus was preventing pages from
2358         entering the PageCache.
2359
2360 2015-02-27  Commit Queue  <commit-queue@webkit.org>
2361
2362         Unreviewed, rolling out r180203 and r180210.
2363         https://bugs.webkit.org/show_bug.cgi?id=142116
2364
2365         broke process suspension and tile map (Requested by thorton on
2366         #webkit).
2367
2368         Reverted changesets:
2369
2370         "Adopt CAMachPort-as-layer-contents"
2371         https://bugs.webkit.org/show_bug.cgi?id=141687
2372         http://trac.webkit.org/changeset/180203
2373
2374         "Fix the !USE(IOSURFACE) build"
2375         http://trac.webkit.org/changeset/180210
2376
2377 2015-02-27  Sam Weinig  <sam@webkit.org>
2378
2379         Add WebKit2 SPI to create a DOM File object
2380         https://bugs.webkit.org/show_bug.cgi?id=142109
2381
2382         Reviewed by Tim Horton.
2383
2384         * WebCore.xcodeproj/project.pbxproj:
2385         Make <WebCore/File.h> (and associated files) available to WebKit2.
2386
2387 2015-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
2388
2389         [Subpixel] Subpixelize RenderListMarker
2390         https://bugs.webkit.org/show_bug.cgi?id=142093
2391
2392         Reviewed by Zalan Bujtas.
2393
2394         Use floats instead of ints.
2395
2396         Test: fast/lists/rtl-marker.html
2397
2398         * rendering/RenderListMarker.cpp:
2399         (WebCore::RenderListMarker::paint):
2400         (WebCore::RenderListMarker::updateContent):
2401         (WebCore::RenderListMarker::getRelativeMarkerRect):
2402         * rendering/RenderListMarker.h:
2403
2404 2015-02-27  Timothy Horton  <timothy_horton@apple.com>
2405
2406         <attachment> should be selected immediately upon click, and be drag/copyable upon click
2407         https://bugs.webkit.org/show_bug.cgi?id=142114
2408         <rdar://problem/19982520>
2409
2410         Reviewed by Enrica Casucci.
2411
2412         * css/html.css:
2413         (attachment):
2414         Make attachment use 'user-select: all' to act as a single click-to-select unit.
2415
2416         * html/HTMLAttachmentElement.cpp:
2417         (WebCore::HTMLAttachmentElement::setFocus): Deleted.
2418         * html/HTMLAttachmentElement.h:
2419         * rendering/RenderAttachment.cpp:
2420         (WebCore::RenderAttachment::isFocused): Deleted.
2421         (WebCore::RenderAttachment::focusChanged): Deleted.
2422         * rendering/RenderAttachment.h:
2423         * rendering/RenderThemeMac.mm:
2424         (WebCore::RenderThemeMac::paintAttachment):
2425         Remove focus-related code; instead of focusing the element upon click,
2426         we get a selection including just the <attachment>, and everything
2427         behaves much more consistently (copy works, drag works, etc.).
2428
2429 2015-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
2430
2431         [iOS] Some MathML tests crash in RenderMathMLOperator::advanceForGlyph() or boundsForGlyph()
2432         https://bugs.webkit.org/show_bug.cgi?id=141371
2433
2434         Reviewed by David Kilzer.
2435
2436         Null checks.
2437
2438         Covered by existing mathml tests.
2439
2440         * rendering/mathml/RenderMathMLOperator.cpp:
2441         (WebCore::RenderMathMLOperator::boundsForGlyph):
2442         (WebCore::RenderMathMLOperator::advanceForGlyph):
2443         (WebCore::RenderMathMLOperator::getDisplayStyleLargeOperator):
2444
2445 2015-02-27  Chris Dumez  <cdumez@apple.com>
2446
2447         Make SourceBuffer ActiveDOMObject suspendable
2448         https://bugs.webkit.org/show_bug.cgi?id=142108
2449         <rdar://problem/19923085>
2450
2451         Reviewed by Jer Noble.
2452
2453         Make SourceBuffer ActiveDOMObject suspendable if it is removed from its
2454         MediaSource and does not have any pending events. This makes it more
2455         likely for pages using SourceBuffer objects to go into the PageCache.
2456
2457         Test: fast/history/page-cache-removed-source-buffer.html
2458
2459         * Modules/mediasource/SourceBuffer.cpp:
2460         (WebCore::SourceBuffer::canSuspend):
2461         * Modules/mediasource/SourceBuffer.h:
2462
2463 2015-02-26  Sam Weinig  <sam@webkit.org>
2464
2465         Add support for canvas ellipse method
2466         https://bugs.webkit.org/show_bug.cgi?id=82791
2467         <rdar://problem/11159172>
2468
2469         Reviewed by Dirk Schulze.
2470
2471         Tests: fast/canvas/canvas-ellipse-360-winding.html
2472                fast/canvas/canvas-ellipse-circumference-fill.html
2473                fast/canvas/canvas-ellipse-circumference.html
2474                fast/canvas/canvas-ellipse-connecting-line.html
2475                fast/canvas/canvas-ellipse-negative-radius.html
2476                fast/canvas/canvas-ellipse-zero-lineto.html
2477                fast/canvas/canvas-ellipse.html
2478
2479         * html/canvas/CanvasPathMethods.h:
2480         * html/canvas/CanvasPathMethods.cpp:
2481         (WebCore::CanvasPathMethods::lineTo):
2482         Convenience for passing a FloatPoint instead of two floats.
2483
2484         (WebCore::normalizeAngles):
2485         Normalizes the angles as described in the HTML spec. Ensuring the startAngle
2486         is greater than 0 and less than 2pi, and the the endAngle is at most 2pi
2487         from the start angle.
2488
2489         (WebCore::CanvasPathMethods::arc):
2490         - Renames some of the parameters to be clearer.
2491         - Normalizes the angles for consistency with ellipse.
2492         - Moves hasInvertibleTransform() higher in the function for consistency.
2493
2494         (WebCore::CanvasPathMethods::ellipse): Added.
2495
2496         * html/canvas/CanvasRenderingContext2D.idl:
2497         * html/canvas/DOMPath.idl:
2498         Add ellipse(...).
2499
2500         * platform/graphics/Path.h:
2501         * platform/graphics/cg/PathCG.cpp:
2502         (WebCore::Path::addArc):
2503         Rename parameters for clarity and use a nullptr.
2504
2505         (WebCore::Path::addEllipse):
2506         Added. Constructs an ellipse via a transformed arc.
2507
2508 2015-02-27  Enrica Casucci  <enrica@apple.com>
2509
2510         Adding support for serializing HTMLAttachment elements.
2511         https://bugs.webkit.org/show_bug.cgi?id=142026
2512
2513         Reviewed by Tim Horton.
2514
2515         Test: editing/pasteboard/copy-paste-attachment.html
2516
2517         Adding support to serialize the attachment element
2518         and properly handle it when converting a DOM range
2519         to NSAttributedString.
2520
2521         * editing/cocoa/HTMLConverter.mm:
2522         (HTMLConverter::_processElement):
2523         * editing/markup.cpp:
2524         (WebCore::StyledMarkupAccumulator::appendCustomAttributes): Create new attribute
2525         for attachment element when serializating.
2526         (WebCore::StyledMarkupAccumulator::appendElement):
2527         (WebCore::createFragmentFromMarkup): Remove the attribute from the attachment element
2528         when creating the fragment.
2529         * html/HTMLAttachmentElement.cpp:
2530         (WebCore::HTMLAttachmentElement::file): Added const to file() to
2531         use it in appendCustonAttributes where the element is a const reference.
2532         * html/HTMLAttachmentElement.h:
2533         * html/HTMLAttributeNames.in:
2534
2535 2015-02-27  Timothy Horton  <timothy_horton@apple.com>
2536
2537         <attachment> should have an inactive style (gray in background)
2538         https://bugs.webkit.org/show_bug.cgi?id=142103
2539         <rdar://problem/19982486>
2540
2541         Reviewed by Dan Bernstein.
2542
2543         * rendering/RenderThemeMac.mm:
2544         (WebCore::attachmentLabelInactiveBackgroundColor):
2545         (WebCore::attachmentLabelInactiveTextColor):
2546         (WebCore::RenderThemeMac::paintAttachmentLabelBackground):
2547         (WebCore::RenderThemeMac::paintAttachmentLabel):
2548         Use a gray background and gray text when the selection containing the
2549         attachment isn't focused and active.
2550
2551 2015-02-27  Brady Eidson  <beidson@apple.com>
2552
2553         Add a "block-cookies" rule to the user content filter.
2554         https://bugs.webkit.org/show_bug.cgi?id=142105
2555
2556         Reviewed by Alex Christensen.
2557
2558         Tests: http/tests/usercontentfilter/block-cookies-basic.html
2559                http/tests/usercontentfilter/block-cookies-send.html
2560
2561         * contentextensions/ContentExtensionRule.h:
2562
2563         * contentextensions/ContentExtensionsBackend.cpp:
2564         (WebCore::ContentExtensions::ContentExtensionsBackend::actionForURL):
2565         (WebCore::ContentExtensions::ContentExtensionsBackend::shouldBlockURL): Deleted.
2566         * contentextensions/ContentExtensionsBackend.h:
2567
2568         * contentextensions/ContentExtensionsManager.cpp:
2569         (WebCore::ContentExtensions::ExtensionsManager::loadAction):
2570
2571         * loader/cache/CachedResourceLoader.cpp:
2572         (WebCore::CachedResourceLoader::requestResource):
2573
2574         * page/UserContentController.cpp:
2575         (WebCore::UserContentController::actionForURL):
2576         (WebCore::UserContentController::contentFilterBlocksURL): Deleted.
2577         * page/UserContentController.h:
2578
2579 2015-02-27  Alex Christensen  <achristensen@webkit.org>
2580
2581         [WinCairo] Unreviewed build fix.
2582
2583         * platform/graphics/BitmapImage.h:
2584         * platform/win/BitmapInfo.h:
2585         Added WEBCORE_EXPORT.
2586
2587 2015-02-27  Timothy Horton  <timothy_horton@apple.com>
2588
2589         <attachment>'s label baseline should match that of the surrounding text
2590         https://bugs.webkit.org/show_bug.cgi?id=142099
2591         rdar://problem/19982495
2592
2593         Reviewed by Dan Bernstein.
2594
2595         * rendering/RenderAttachment.cpp:
2596         (WebCore::RenderAttachment::baselinePosition):
2597         * rendering/RenderAttachment.h:
2598         Override baselinePosition and retrieve it from RenderTheme.
2599
2600         * rendering/RenderTheme.h:
2601         (WebCore::RenderTheme::attachmentBaseline):
2602         * rendering/RenderThemeMac.h:
2603         * rendering/RenderThemeMac.mm:
2604         (WebCore::AttachmentLayout::AttachmentLayout):
2605         (WebCore::RenderThemeMac::attachmentBaseline):
2606         Plumb the label baseline from AttachmentLayout to RenderAttachment.
2607
2608 2015-02-27  Commit Queue  <commit-queue@webkit.org>
2609
2610         Unreviewed, rolling out r180752.
2611         https://bugs.webkit.org/show_bug.cgi?id=142098
2612
2613         Causes 10 SVG test failures on Windows. (Requested by
2614         bfulgham_ on #webkit).
2615
2616         Reverted changeset:
2617
2618         "Cache glyph widths to GlyphPages"
2619         https://bugs.webkit.org/show_bug.cgi?id=142028
2620         http://trac.webkit.org/changeset/180752
2621
2622 2015-02-27  David Kilzer  <ddkilzer@apple.com>
2623
2624         [iOS] Fix build by defining EAGL_IOSURFACE macro before including <OpenGLES/EAGLPrivate.h>
2625
2626         * platform/spi/ios/OpenGLESSPI.h:  Define EAGL_IOSURFACE macro
2627         until header refactoring is completed.
2628
2629 2015-02-27  Chris Dumez  <cdumez@apple.com>
2630
2631         MediaSource should be suspendable when closed
2632         https://bugs.webkit.org/show_bug.cgi?id=142089
2633         <rdar://problem/19923085>
2634
2635         Reviewed by Jer Noble.
2636
2637         Make MediaSource ActiveDOMObject suspendable when it is in closed state
2638         and it has no pending events. This increases the likelihood of pages
2639         using MediaSource to enter the PageCache.
2640
2641         Tests: fast/history/page-cache-media-source-closed-2.html
2642                fast/history/page-cache-media-source-closed.html
2643                fast/history/page-cache-media-source-opened.html
2644
2645 2015-02-27  Andreas Kling  <akling@apple.com>
2646
2647         Use NeverDestroyed for JS wrapper owners.
2648         <https://webkit.org/b/142090>
2649
2650         Reviewed by Chris Dumez.
2651
2652         Using NeverDestroyed puts these objects in BSS which is preferable
2653         since that prevents them from pinning down entire malloc pages forever.
2654
2655         * bindings/scripts/CodeGeneratorJS.pm:
2656         (GenerateHeader): Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL.
2657
2658         * bindings/scripts/test/JS/*: Rebaseline bindings tests for this change.
2659
2660 2015-02-27  Chris Dumez  <cdumez@apple.com>
2661
2662         Make IDBDatabase / IDBRequest suspendable
2663         https://bugs.webkit.org/show_bug.cgi?id=142076
2664         <rdar://problem/19923085>
2665
2666         Reviewed by Andreas Kling.
2667
2668         Make IDBDatabase / IDBRequest suspendable under certain conditions to
2669         make it more likely for pages using indexeddb to enter the PageCache.
2670
2671         IDBDatabase is safely suspendable if the database is closed. IDBRequest
2672         is safely suspendable if the request no longer has any pending activity
2673         (i.e. state is DONE and success / failure handler was called). We may
2674         be able to do better later but this is the bare minimum for now.
2675
2676         Tests: fast/history/page-cache-indexed-closed-db.html
2677                fast/history/page-cache-indexed-opened-db.html
2678
2679         * Modules/indexeddb/IDBDatabase.cpp:
2680         (WebCore::IDBDatabase::IDBDatabase):
2681         (WebCore::IDBDatabase::closeConnection):
2682         (WebCore::IDBDatabase::enqueueEvent):
2683         (WebCore::IDBDatabase::canSuspend):
2684         * Modules/indexeddb/IDBDatabase.h:
2685         * Modules/indexeddb/IDBRequest.cpp:
2686         (WebCore::IDBRequest::canSuspend):
2687         * Modules/indexeddb/IDBRequest.h:
2688
2689 2015-02-27  Chris Dumez  <cdumez@apple.com>
2690
2691         Drop unnecessary DatabaseManager::hasOpenDatabases() in PageCache::canCachePageContainingThisFrame()
2692         https://bugs.webkit.org/show_bug.cgi?id=142052
2693
2694         Reviewed by Andreas Kling.
2695
2696         Drop WebDatabase special-handling from PageCache::canCachePageContainingThisFrame().
2697         DatabaseContext is already an ActiveDOMObject and DatabaseContext::canSuspend() was
2698         returning false so pages using WebDatabase would never enter the PageCache anyway.
2699
2700         This patch also overrides ActiveDOMObject::canSuspend() in DatabaseContext to only
2701         return false when there are open databases. This check is now equivalent to the one
2702         that was in PageCache.
2703
2704         An issue that remains is that DatabaseContext::m_hasOpenDatabases is never reset
2705         to false so once a page opened a database, it will never be page-cacheable. This
2706         will be taken care of separately though.
2707
2708         Test: fast/history/page-cache-webdatabase-opened-db.html
2709
2710         * Modules/webdatabase/DatabaseContext.cpp:
2711         (WebCore::DatabaseContext::canSuspend):
2712         * Modules/webdatabase/DatabaseContext.h:
2713         * history/PageCache.cpp:
2714         (WebCore::logCanCacheFrameDecision):
2715         (WebCore::PageCache::canCachePageContainingThisFrame):
2716         * page/DiagnosticLoggingKeys.cpp:
2717         (WebCore::DiagnosticLoggingKeys::hasOpenDatabasesKey): Deleted.
2718         * page/DiagnosticLoggingKeys.h:
2719
2720 2015-02-27  Alex Christensen  <achristensen@webkit.org>
2721
2722         Compile DFA to bytecode.
2723         https://bugs.webkit.org/show_bug.cgi?id=142031
2724
2725         Reviewed by Benjamin Poulain.
2726
2727         * WebCore.xcodeproj/project.pbxproj:
2728         * contentextensions/ContentExtensionsBackend.cpp:
2729         (WebCore::ContentExtensions::ContentExtensionsBackend::setRuleList):
2730         (WebCore::ContentExtensions::ContentExtensionsBackend::shouldBlockURL):
2731         * contentextensions/ContentExtensionsBackend.h:
2732         * contentextensions/DFA.cpp:
2733         (WebCore::ContentExtensions::DFA::nextState): Deleted.
2734         (WebCore::ContentExtensions::DFA::actions): Deleted.
2735         * contentextensions/DFA.h:
2736         (WebCore::ContentExtensions::DFA::size):
2737         (WebCore::ContentExtensions::DFA::nodeAt):
2738         * contentextensions/DFABytecode.h: Added.
2739         (WebCore::ContentExtensions::instructionSizeWithArguments):
2740         * contentextensions/DFABytecodeCompiler.cpp: Added.
2741         (WebCore::ContentExtensions::append):
2742         (WebCore::ContentExtensions::set32Bits):
2743         (WebCore::ContentExtensions::DFABytecodeCompiler::emitAppendAction):
2744         (WebCore::ContentExtensions::DFABytecodeCompiler::emitJump):
2745         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValue):
2746         (WebCore::ContentExtensions::DFABytecodeCompiler::emitTerminate):
2747         (WebCore::ContentExtensions::DFABytecodeCompiler::reserveBufferCapacity):
2748         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
2749         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
2750         * contentextensions/DFABytecodeCompiler.h: Added.
2751         (WebCore::ContentExtensions::DFABytecodeCompiler::DFABytecodeCompiler):
2752         * contentextensions/DFABytecodeInterpreter.cpp: Added.
2753         (WebCore::ContentExtensions::getBits):
2754         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
2755         * contentextensions/DFABytecodeInterpreter.h: Added.
2756         (WebCore::ContentExtensions::DFABytecodeInterpreter::DFABytecodeInterpreter):
2757
2758 2015-02-27  Zalan Bujtas  <zalan@apple.com>
2759
2760         Use after free in WebCore::RenderNamedFlowFragment::restoreRegionObjectsOriginalStyle
2761         https://bugs.webkit.org/show_bug.cgi?id=138366
2762
2763         Reviewed by Dave Hyatt.
2764
2765         This patch ensures that we clean up RenderNamedFlowFragment::m_renderObjectRegionStyle when embedded flow content is getting destroyed.
2766
2767         In m_renderObjectRegionStyle hash map, we store style information about the named flow's descendant children.
2768         When a child is being detached from the tree, it removes itself from this hashmap.
2769         We do it by traversing up on the ancestor chain and call removeFlowChildInfo() on the parent flow.
2770         However in case of embedded flows (for example multicolumn content inside a region), we need to check whether the parent flow
2771         is inside a flow too and continue the cleanup accordingly.
2772
2773         Test: fast/regions/region-with-multicolumn-embedded-crash.html
2774
2775         * rendering/RenderObject.cpp:
2776         (WebCore::RenderObject::removeFromRenderFlowThreadIncludingDescendants):
2777
2778 2015-02-27  Brady Eidson  <beidson@apple.com>
2779
2780         Add API to remove a single content filter.
2781         <rdar://problem/19977764> and https://bugs.webkit.org/show_bug.cgi?id=142088
2782
2783         Reviewed by Sam Weinig.
2784
2785         * page/UserContentController.cpp:
2786         (WebCore::UserContentController::removeUserContentFilter):
2787         * page/UserContentController.h:
2788
2789 2015-02-26  Brent Fulgham  <bfulgham@apple.com>
2790
2791         [Win] Remove remaining SafariTheme cruft
2792         https://bugs.webkit.org/show_bug.cgi?id=142075
2793
2794         Reviewed by Anders Carlsson.
2795
2796         Remove reference to SafariTheme-switching preference.
2797
2798         Tested by existing layout tests.
2799
2800         * WebCore.vcxproj/WebCore.vcxproj:
2801         * WebCore.vcxproj/WebCore.vcxproj.filters:
2802         * config.h:
2803         * page/Settings.cpp:
2804         (WebCore::Settings::fontRenderingMode):
2805         (WebCore::Settings::setShouldPaintNativeControls): Deleted.
2806         * page/Settings.h:
2807         (WebCore::Settings::shouldPaintNativeControls): Deleted.
2808         * platform/win/ScrollbarThemeWin.cpp:
2809         (WebCore::ScrollbarTheme::nativeTheme):
2810         * rendering/RenderThemeWin.cpp:
2811         (WebCore::RenderTheme::themeForPage):
2812
2813 2015-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
2814
2815         Add comment about CSS value name mangling
2816
2817         Unreviewed
2818
2819         * css/CSSParser.cpp:
2820         (WebCore::cssValueKeywordID):
2821
2822 2015-02-27  Antti Koivisto  <antti@apple.com>
2823
2824         Cache glyph widths to GlyphPages
2825         https://bugs.webkit.org/show_bug.cgi?id=142028
2826
2827         Reviewed by Andreas Kling.
2828
2829         Currently we have a separate cache in Font for glyph widths. In practice we always need
2830         the widths so we can just cache them in GlyphPages. This simplifies the code and removes
2831         a per-character hash lookup from WidthIterator.
2832
2833         * platform/graphics/Font.cpp:
2834         (WebCore::Font::Font):
2835         (WebCore::Font::initCharWidths):
2836         (WebCore::Font::platformGlyphInit):
2837         (WebCore::createAndFillGlyphPage):
2838         (WebCore::Font::computeWidthForGlyph):
2839
2840             Rename to make it clear this doesn't cache.
2841
2842         (WebCore::GlyphPage::setGlyphDataForIndex):
2843
2844             Initialize the width.
2845             This could go to GlyphPage.cpp if we had one.
2846
2847         * platform/graphics/Font.h:
2848         (WebCore::Font::glyphZeroWidth):
2849         (WebCore::Font::isZeroWidthSpaceGlyph):
2850         (WebCore::Font::zeroGlyph): Deleted.
2851         (WebCore::Font::setZeroGlyph): Deleted.
2852         (WebCore::Font::widthForGlyph): Deleted.
2853         * platform/graphics/FontCascade.cpp:
2854         (WebCore::offsetToMiddleOfGlyph):
2855         * platform/graphics/FontCascadeFonts.cpp:
2856         (WebCore::FontCascadeFonts::glyphDataForCharacter):
2857         * platform/graphics/GlyphPage.h:
2858         (WebCore::GlyphData::GlyphData):
2859
2860             Return width too as part of GlyphData.
2861
2862         (WebCore::GlyphPage::glyphDataForIndex):
2863         (WebCore::GlyphPage::setGlyphDataForCharacter):
2864         (WebCore::GlyphPage::setGlyphDataForIndex):
2865         (WebCore::GlyphPage::GlyphPage):
2866         * platform/graphics/WidthIterator.cpp:
2867         (WebCore::WidthIterator::advanceInternal):
2868
2869             No need to lookup width separately now.
2870
2871         * platform/graphics/mac/ComplexTextController.cpp:
2872         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
2873         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
2874         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
2875         * rendering/mathml/RenderMathMLOperator.cpp:
2876         (WebCore::RenderMathMLOperator::advanceForGlyph):
2877         * rendering/svg/SVGTextRunRenderingContext.cpp:
2878         (WebCore::missingGlyphForFont):
2879         * svg/SVGFontData.cpp:
2880         (WebCore::SVGFontData::initializeFont):
2881
2882 2015-02-26  Alexey Proskuryakov  <ap@apple.com>
2883
2884         iOS build fix after r180717.
2885
2886         * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseUnpauseTask::doPerformTask):
2887
2888 2015-02-26  Ryosuke Niwa  <rniwa@webkit.org>
2889
2890         isEditablePosition and related functions shouldn't move position out of table
2891         https://bugs.webkit.org/show_bug.cgi?id=129200
2892
2893         Reviewed by Darin Adler.
2894
2895         This patch removes the legacy editing position for elements display: table in its computed style.
2896         Previously, we used (table, 0) and (table, !0) to denote positions immediately before and after
2897         such an element for historical reasons. This forced us to update the style tree before computing
2898         the editability of a position because we have to check the editability of the position outside
2899         the element with display: table if the position was using such a legacy editing position.
2900         e.g. if a table was not editable (contenteditable=false), the position before the table (table, 0)
2901         should still be considered editable if the parent node of the table was editable.
2902
2903         This patch replaces such a legacy editing position by using modern position types:
2904         PositionIsBeforeAnchor and PositionIsAfterAnchor.
2905
2906         No new tests since there should be no change in the user perceived editing operations.
2907
2908         * dom/Position.cpp:
2909         (WebCore::Position::previous): Setup the node and the offset correctly when the original position's
2910         type is PositionIsBeforeAnchor. Also return a position before or after node when the node we found
2911         is "atomic" (e.g. input, img, br, etc...) or it's a table. This avoids creating a legacy editing
2912         position inside a table.
2913         (WebCore::Position::next): Ditto.
2914         (WebCore::Position::atStartOfTree): Use atFirstEditingPositionForNode, which takes care of all types
2915         of positions.
2916         (WebCore::Position::atEndOfTree): Ditto.
2917         (WebCore::Position::downstream): Return a position before a node instead of a legacy editing position
2918         for an atomic element or a table element as done in the equivalent code in Position::upstream.
2919         (WebCore::Position::isCandidate): Don't treat a position inside a table to be a candidate. e.g.
2920         (table, 1) when there are more than two children of the table.
2921
2922         * dom/PositionIterator.cpp:
2923         (WebCore::PositionIterator::operator Position): PositionIterator internally uses legacy editing
2924         positions. So convert it to a modern position by returning a position before or after a table here.
2925         * editing/ApplyBlockElementCommand.cpp:
2926         (WebCore::ApplyBlockElementCommand::formatSelection): Check that the unsplittable element we found
2927         is actually empty before executing the simple code path for an empty unsplittable element. Without
2928         this check, block formatting a table element will fail.
2929
2930         * editing/htmlediting.cpp:
2931         (WebCore::isEditablePosition): Use containerNode instead of deprecatedNode because the editability
2932         of a position before or after an element is determined by its parent, not the element itself.
2933         (WebCore::isAtUnsplittableElement): Ditto.
2934         (WebCore::isRichlyEditablePosition): Ditto. Removed the code that moved the starting node out of
2935         an element with display: table. This is the code removal for which this patch was made.
2936         (WebCore::editableRootForPosition): Ditto.
2937
2938 2015-02-26  Timothy Horton  <timothy_horton@apple.com>
2939
2940         Implement <attachment> element appearance on Mac
2941         https://bugs.webkit.org/show_bug.cgi?id=142023
2942
2943         Reviewed by Dean Jackson.
2944
2945         * css/CSSParser.cpp:
2946         (WebCore::isValidKeywordPropertyAndValue):
2947         * css/CSSPrimitiveValueMappings.h:
2948         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2949         * css/CSSValueKeywords.in:
2950         * css/html.css:
2951         (attachment):
2952         * platform/ThemeTypes.h:
2953         Add a new -webkit-appearance value, attachment.
2954
2955         * WebCore.xcodeproj/project.pbxproj:
2956         * html/HTMLAttachmentElement.cpp:
2957         (WebCore::HTMLAttachmentElement::setFile):
2958         Let the renderer know when the file changes (so it can relayout and repaint).
2959
2960         (WebCore::HTMLAttachmentElement::filePath):
2961         (WebCore::HTMLAttachmentElement::fileName):
2962         * html/HTMLAttachmentElement.h:
2963         Handy acccessors for the full path and the name of the file.
2964
2965         * platform/spi/mac/IconServicesSPI.h: Added.
2966         * platform/spi/mac/LaunchServicesSPI.h: Added.
2967         Add some IconServices and LaunchServices SPI headers.
2968
2969         * rendering/RenderAttachment.cpp:
2970         (WebCore::RenderAttachment::RenderAttachment):
2971         Don't have a default intrinsic size; we'll adjust in layout().
2972
2973         (WebCore::RenderAttachment::isSelected):
2974         (WebCore::RenderAttachment::isFocused):
2975         (WebCore::RenderAttachment::isSelectedOrFocused):
2976         Factor out from paintReplaced().
2977
2978         (WebCore::RenderAttachment::layout):
2979         Use RenderTheme to compute the intrinsic size of this attachment.
2980
2981         (WebCore::RenderAttachment::paintReplaced):
2982         Use RenderTheme to paint the attachment.
2983
2984         (WebCore::RenderAttachment::representedFileChanged):
2985         When the represented file changes, we need to recompute the intrinsic size and repaint.
2986
2987         * rendering/RenderTheme.cpp:
2988         (WebCore::RenderTheme::adjustStyle):
2989         (WebCore::RenderTheme::paint):
2990         (WebCore::RenderTheme::adjustAttachmentStyle):
2991         (WebCore::RenderTheme::paintAttachment):
2992         Plumb through the attachment appearance.
2993
2994         * rendering/RenderAttachment.h:
2995         * rendering/RenderTheme.h:
2996         (WebCore::RenderTheme::paintAttachment):
2997         (WebCore::RenderTheme::attachmentIntrinsicSize):
2998         * rendering/RenderThemeMac.h:
2999         * rendering/RenderThemeMac.mm:
3000         (WebCore::attachmentIconBackgroundColor):
3001         (WebCore::attachmentIconBorderColor):
3002         (WebCore::AttachmentLayout):
3003         AttachmentLayout lays out the innards of the RenderThemeMac attachment
3004         presentation: an icon with an optional bordered background, with a label
3005         underneath it with an optional background.
3006
3007         (WebCore::RenderThemeMac::attachmentIntrinsicSize):
3008         (WebCore::paintAttachmentIconBackground):
3009         (WebCore::paintAttachmentIcon):
3010         (WebCore::RenderThemeMac::paintAttachmentLabelBackground):
3011         (WebCore::RenderThemeMac::paintAttachmentLabel):
3012         (WebCore::RenderThemeMac::paintAttachment):
3013         Paint the attachment element. Paint the optional backgrounds (and swap
3014         out the text color) if the element is selected/focused.
3015
3016 2015-02-26  Doug Russell  <d_russell@apple.com>
3017
3018         AX: Expose caret browsing preference to accessibility API
3019         https://bugs.webkit.org/show_bug.cgi?id=141862
3020
3021         Reviewed by Chris Fleizach.
3022
3023         Exposing the caret browsing setting on WebCore::Frame via the accessibility API would allow assistive tech apps to enable it contextually (for example, when the assistive tech app is running).
3024         Enabling caret browsing when assistive tech apps are running greatly improves the reliability of keyboard navigation on the web. Most especially in cases where selection would be disrupted by focus events.
3025
3026         Tests: platform/mac/accessibility/caret-browsing-arrow-nav.html
3027                platform/mac/accessibility/caret-browsing-attribute.html
3028                platform/mac/accessibility/caret-browsing-tab-selection.html
3029
3030         * accessibility/AccessibilityObject.h:
3031         * accessibility/mac/AccessibilityObjectMac.mm:
3032         (WebCore::AccessibilityObject::caretBrowsingEnabled):
3033         (WebCore::AccessibilityObject::setCaretBrowsingEnabled):
3034         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3035         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
3036         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3037         (-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
3038         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
3039         (-[WebAccessibilityObjectWrapper _accessibilitySetTestValue:forAttribute:]):
3040
3041 2015-02-26  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3042
3043         Remove unnecessary create() factory functions
3044         https://bugs.webkit.org/show_bug.cgi?id=142039
3045
3046         Reviewed by Chris Dumez.
3047
3048         Clean up remaining JSCryptoKeySerializationJWK::create, HTMLMediaSession::create,
3049         and DatabaseUnpauseTask::create.
3050
3051         * Modules/webdatabase/DatabaseThread.cpp:
3052         (WebCore::DatabaseUnpauseTask::DatabaseUnpauseTask):
3053         (WebCore::DatabaseThread::setPaused):
3054         (WebCore::DatabaseUnpauseTask::create): Deleted.
3055         * bindings/js/JSCryptoKeySerializationJWK.h:
3056         * bindings/js/JSSubtleCryptoCustom.cpp:
3057         (WebCore::importKey):
3058         * html/HTMLMediaElement.cpp:
3059         (WebCore::HTMLMediaElement::HTMLMediaElement):
3060         * html/HTMLMediaSession.cpp:
3061         (WebCore::HTMLMediaSession::create): Deleted.
3062         * html/HTMLMediaSession.h:
3063
3064 2015-02-26  Joseph Pecoraro  <pecoraro@apple.com>
3065
3066         Web Inspector: Save Console Evaluations into Command Line variables $1-$99 ($n)
3067         https://bugs.webkit.org/show_bug.cgi?id=142061
3068
3069         Reviewed by Timothy Hatcher.
3070
3071         * inspector/CommandLineAPIModuleSource.js:
3072         Replace $1-$4 "inspected objects" with $1-$99 "saved results".
3073
3074         * bindings/js/JSCommandLineAPIHostCustom.cpp:
3075         (WebCore::JSCommandLineAPIHost::inspectedObject):
3076         * inspector/CommandLineAPIHost.cpp:
3077         (WebCore::CommandLineAPIHost::CommandLineAPIHost):
3078         (WebCore::CommandLineAPIHost::InspectableObject::get):
3079         (WebCore::CommandLineAPIHost::addInspectedObject):
3080         (WebCore::CommandLineAPIHost::inspectedObject):
3081         (WebCore::CommandLineAPIHost::clearInspectedObjects): Deleted.
3082         * inspector/CommandLineAPIHost.h:
3083         * inspector/CommandLineAPIHost.idl:
3084         Since we now just save the single $0 inspected object, eliminate
3085         keeping track of a list of 5 values.
3086
3087 2015-02-26  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3088
3089         Remove unnecessary create() factory functions in CDMFoo, NamedNodeMap
3090         https://bugs.webkit.org/show_bug.cgi?id=141902
3091
3092         Reviewed by Darin Adler.
3093
3094         Create instance using std::make_unique<> in CDMFactory directly. To do that,
3095         CDMFactory uses lambdas. Additionally this patch removes NamedNodeMap::create() as well.
3096
3097         No new tests, no behavior changes.
3098
3099         * Modules/encryptedmedia/CDM.cpp:
3100         (WebCore::installedCDMFactories):
3101         * Modules/encryptedmedia/CDM.h:
3102         * Modules/encryptedmedia/CDMPrivateClearKey.h:
3103         (WebCore::CDMPrivateClearKey::CDMPrivateClearKey):
3104         (WebCore::CDMPrivateClearKey::create): Deleted.
3105         * Modules/encryptedmedia/CDMPrivateMediaPlayer.h:
3106         (WebCore::CDMPrivateMediaPlayer::create): Deleted.
3107         * dom/Element.cpp:
3108         (WebCore::Element::attributes):
3109         * dom/NamedNodeMap.h:
3110         (WebCore::NamedNodeMap::NamedNodeMap):
3111         (WebCore::NamedNodeMap::create): Deleted.
3112         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
3113         (WebCore::CDMPrivateMediaSourceAVFObjC::create): Deleted.
3114
3115 2015-02-26  Andy Estes  <aestes@apple.com>
3116
3117         [Content Filtering] Move WebFilterEvaluator and NEFilterSource declarations to SPI headers
3118         https://bugs.webkit.org/show_bug.cgi?id=142062
3119
3120         Reviewed by Daniel Bates.
3121
3122         * WebCore.xcodeproj/project.pbxproj:
3123         * platform/mac/ContentFilterMac.mm:
3124         * platform/spi/cocoa/NEFilterSourceSPI.h: Added.
3125         * platform/spi/cocoa/WebFilterEvaluatorSPI.h: Added.
3126
3127 2015-02-26  Anders Carlsson  <andersca@apple.com>
3128
3129         Add API to remove all website data for the given data records
3130         https://bugs.webkit.org/show_bug.cgi?id=142060
3131
3132         Reviewed by Beth Dakin.
3133
3134         * loader/cache/MemoryCache.cpp:
3135         (WebCore::MemoryCache::removeResourcesWithOrigins):
3136         New function that removes all resources that match the set of origins in a given session.
3137
3138 2015-02-26  Chris Dumez  <cdumez@apple.com>
3139
3140         Rename DatabaseManager::manager() to DatabaseManager::singleton()
3141         https://bugs.webkit.org/show_bug.cgi?id=142054
3142
3143         Reviewed by Ryosuke Niwa.
3144
3145         Rename DatabaseManager::manager() to DatabaseManager::singleton() as
3146         per coding style and use WTF::NeverDestroyed.
3147
3148         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
3149         (WebCore::DOMWindowWebDatabase::openDatabase):
3150         * Modules/webdatabase/DatabaseBackendBase.cpp:
3151         (WebCore::DatabaseBackendBase::DatabaseBackendBase):
3152         * Modules/webdatabase/DatabaseContext.cpp:
3153         (WebCore::DatabaseContext::DatabaseContext):
3154         (WebCore::DatabaseContext::~DatabaseContext):
3155         (WebCore::DatabaseContext::stopDatabases):
3156         (WebCore::DatabaseContext::databaseExceededQuota):
3157         * Modules/webdatabase/DatabaseManager.cpp:
3158         (WebCore::DatabaseManager::singleton):
3159         (WebCore::DatabaseManager::manager): Deleted.
3160         * Modules/webdatabase/DatabaseManager.h:
3161         (WebCore::DatabaseManager::~DatabaseManager): Deleted.
3162         * Modules/webdatabase/SQLTransactionClient.cpp:
3163         (WebCore::SQLTransactionClient::didExceedQuota):
3164         * history/PageCache.cpp:
3165         (WebCore::logCanCacheFrameDecision):
3166         (WebCore::PageCache::canCachePageContainingThisFrame):
3167         * loader/FrameLoader.cpp:
3168         (WebCore::FrameLoader::stopLoading):
3169
3170 2015-02-26  Csaba Osztrogonác  <ossy@webkit.org>
3171
3172         Fix the !ENABLE(GEOLOCATION) build after r180533
3173         https://bugs.webkit.org/show_bug.cgi?id=142053
3174
3175         Reviewed by Chris Dumez.
3176
3177         * Modules/geolocation/GeoNotifier.cpp:
3178         * Modules/geolocation/GeoNotifier.h:
3179
3180 2015-02-26  Dean Jackson  <dino@apple.com>
3181
3182         [iOS Media] incorrect front padding on time values
3183         https://bugs.webkit.org/show_bug.cgi?id=142027
3184         <rdar://problem/19960790>
3185
3186         Reviewed by Brent Fulgham.
3187
3188         My last commit was updating the OS X file,
3189         not the iOS file.
3190
3191         We don't want to prefix times with a "0".
3192
3193         * Modules/mediacontrols/mediaControlsApple.js:
3194         (Controller.prototype.formatTime):
3195         * Modules/mediacontrols/mediaControlsiOS.js:
3196         (ControllerIOS.prototype.formatTime):
3197
3198 2015-02-26  Mark Lam  <mark.lam@apple.com>
3199
3200         Rolling out r180602, r180608, r180613, r180617, r180671.
3201         <https://webkit.org/b/141990>
3202
3203         Not reviewed.
3204
3205         The r180602 solution does result in more work for GC when worker
3206         threads are in use.  Filip is uncomfortable with that.
3207         The EFL and GTK ports also seem to be unhappy with this change.
3208         Rolling out while we investigate.
3209
3210         * bindings/js/JSDOMWindowBase.cpp:
3211         (WebCore::JSDOMWindowBase::commonVM):
3212
3213 2015-02-26  Myles C. Maxfield  <mmaxfield@apple.com>
3214
3215         [Mac] [iOS] Parsing support for -apple-trailing-word
3216         https://bugs.webkit.org/show_bug.cgi?id=141939
3217
3218         Reviewed by Andreas Kling.
3219
3220         This patch implements initial parsing support for the -apple-trailing-word CSS property.
3221         This property has two possible (mutually exclusive) values: auto and
3222         -apple-partially-balanced. This property is inherited.
3223
3224         The work for this property is behind the ENABLE(CSS_TRAILING_WORD) preprocessor define.
3225
3226         This is an internal property that will allow us to control line breaking behavior for
3227         short paragraphs.
3228
3229         Note that, because of the implementation of cssValueKeywordID() in CSSParser.cpp,
3230         the new value must be implemented as -webkit-partially-balanced. Using the -apple-
3231         prefix will work, but if you getComputedStyle(), it will return the -webkit- prefixed
3232         version.
3233
3234         Test: platform/mac/fast/text/trailing-word-parse.html
3235
3236         * Configurations/FeatureDefines.xcconfig:
3237         * css/CSSComputedStyleDeclaration.cpp:
3238         (WebCore::ComputedStyleExtractor::propertyValue): Turn internal representation into a
3239         CSS value.
3240         * css/CSSParser.cpp:
3241         (WebCore::isValidKeywordPropertyAndValue): Updated for new keyword property / value
3242         pair.
3243         (WebCore::isKeywordPropertyID): New property is a keyword property.
3244         (WebCore::CSSParser::parseValue): Use the keyword property codepath.
3245         * css/CSSPrimitiveValueMappings.h:
3246         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Convert to and from the internal
3247         representation and CSS values.
3248         (WebCore::CSSPrimitiveValue::operator TrailingWord):
3249         * css/CSSPropertyNames.in: New property.
3250         * css/CSSValueKeywords.in: New value.
3251         * rendering/SimpleLineLayout.cpp:
3252         (WebCore::SimpleLineLayout::canUseFor): Can't use SimpleLineLayout for this.
3253         * rendering/style/RenderStyle.h: Getter, setter and initial value.
3254         * rendering/style/RenderStyleConstants.h: Internal data type.
3255         * rendering/style/StyleRareInheritedData.h: One bit to control this style property.
3256         * rendering/style/StyleRareInheritedData.cpp: Update constructors and operators.
3257
3258 2015-02-26  Roger Fong  <roger_fong@apple.com>
3259
3260         Unreviewed. Fix a accidental deletion from r178674.
3261
3262         * html/canvas/WebGLRenderingContextBase.cpp:
3263         (WebCore::WebGLRenderingContextBase::create):
3264         Return the fake WebGL context.
3265
3266 2015-02-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
3267
3268         Cleanup RenderSVGResourceClipper class.
3269         https://bugs.webkit.org/show_bug.cgi?id=142032.
3270
3271         Reviewed by Darin Adler.
3272         
3273         This is a follow up for r180643: <http://trac.webkit.org/changeset/180643>.
3274         It includes cleanup for RenderSVGResourceClipper class.
3275
3276         * rendering/svg/RenderSVGResourceClipper.cpp:
3277         (WebCore::RenderSVGResourceClipper::applyClippingToContext):
3278         (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
3279         * rendering/svg/RenderSVGResourceClipper.h: Change ClipperData to be a
3280         typedef instead of a class and rename it to ClipperMaskImage. The purpose
3281         of having it a class even though it includes only one member was because
3282         we wanted it to be WTF_MAKE_FAST_ALLOCATED. We do not need to allocate it
3283         as a separate object on the heap anymore.
3284         
3285         (WebCore::RenderSVGResourceClipper::addRendererToClipper): Instead of doing
3286         double hash table lookups by calling HashMap::contains() and then HashMap::get(),
3287         we can use HashMap::add() instead.
3288
3289 2015-02-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
3290
3291         Setting any of the <object> element plugin controlling attributes does not have any affect.
3292         https://bugs.webkit.org/show_bug.cgi?id=141936.
3293
3294         Reviewed by Zalan Bujtas.
3295
3296         When setting any of the <object> element plugin controlling attributes
3297         dynamically we need to mark the the element to be dirty by calling
3298         setNeedsStyleRecalc(), so it has to recreate its renderer when needed.
3299         
3300         Test: svg/as-object/svg-in-object-dynamic-attribute-change.html
3301
3302         * dom/Element.h: Delete unimplemented function.
3303         
3304         * html/HTMLObjectElement.cpp:
3305         (WebCore::HTMLObjectElement::parseAttribute): Dirty the element by calling
3306         setNeedsStyleRecalc() when one of the plugin controlling attributes gets
3307         changed. We have to clear the m_useFallbackContent because the attribute's
3308         new value might fix the object rendering.
3309         
3310         * html/HTMLObjectElement.h: Add a function to clear m_useFallbackContent.
3311         
3312         * html/HTMLPlugInImageElement.cpp:
3313         (WebCore::HTMLPlugInImageElement::willRecalcStyle): We might need to 
3314         reconstruct the object renderer in the image case. This can happen if the
3315         image was rendering fallback content and the attribute's new value fixes
3316         the object rendering.
3317
3318 2015-02-26  Brent Fulgham  <bfulgham@apple.com>
3319
3320         [Win] Make build logs more legible by reducing noise
3321         https://bugs.webkit.org/show_bug.cgi?id=142034
3322
3323         Reviewed by Alexey Proskuryakov.
3324
3325         Modify batch files, makefiles, and DOS commands to remove
3326         uninteresting/unhelpful output.
3327
3328         * WebCore.vcxproj/WebCoreGenerated.make:
3329         * WebCore.vcxproj/WebCorePreBuild.cmd:
3330         * WebCore.vcxproj/copyForwardingHeaders.cmd:
3331         * WebCore.vcxproj/copyWebCoreResourceFiles.cmd:
3332
3333 2015-02-26  Michael Catanzaro  <mcatanzaro@igalia.com>
3334
3335         [FreeType] REGRESSION(r180563): Introduced crashes
3336         https://bugs.webkit.org/show_bug.cgi?id=142044
3337
3338         Reviewed by Martin Robinson.
3339
3340         No new tests, should be caught by any woff font test.
3341
3342         Use optionsPattern, not m_pattern, when m_pattern may be null.
3343
3344         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
3345         (WebCore::FontPlatformData::initializeWithFontFace):
3346
3347 2015-02-26  Sergio Villar Senin  <svillar@igalia.com>
3348
3349         ASSERTION FAILED: !length.isUndefined() in WebCore::GridLength::GridLength
3350         https://bugs.webkit.org/show_bug.cgi?id=141645
3351
3352         Reviewed by Chris Dumez.
3353
3354         This bug has been here since r110484 but was uncovered by
3355         r180140. The problem r110484 was trying to fix was that
3356         CSSPrimitiveValue::convertToLength<Length> ended up calling
3357         CSSPrimitiveValue::computeLengthDouble() which was apparently
3358         dereferencing conversionData.style() and
3359         conversionData.rootStyle() pointers without checking them. That's
3360         why that fix added this condition to convertToLength():
3361
3362         isFontRelativeLength() && (!conversionData.style() || !conversionData.rootStyle())
3363
3364         which is not correct, because for the 4 possible font relative
3365         length types, 3 of them just use the style() pointer and the other
3366         one just uses rootStyle() which BTW could be NULL. This erroneous
3367         condition makes that function to return Length(Undefined) more
3368         often than it should.
3369
3370         From now on it only returns Length(Undefined) if the style()
3371         pointer is NULL and the font relative length type is one in the
3372         set (CSS_EMS, CSS_EXS, CSS_CHS);
3373
3374         Test: fast/css-grid-layout/grid-with-relative-font-length-crash.html
3375
3376         * css/CSSPrimitiveValue.h:
3377         * css/CSSPrimitiveValueMappings.h:
3378         (WebCore::CSSPrimitiveValue::convertingToLengthRequiresNonNullStyle):
3379         (WebCore::CSSPrimitiveValue::convertToLength):
3380
3381
3382 2015-02-26  Andreas Kling  <akling@apple.com>
3383
3384         [Cocoa] Prod libcache to drop caches in memory pressure relief handler.
3385         <https://webkit.org/b/142024>
3386         <rdar://problem/19966096>
3387
3388         Reviewed by Antti Koivisto.
3389
3390         libcache already listens to the OS memory pressure notifications, but we still
3391         need to manually request a cleanup when doing an iOS process suspension, or when
3392         simulating memory pressure.
3393
3394         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
3395         (WebCore::MemoryPressureHandler::platformReleaseMemory): Call out to libcache's
3396         cache_simulate_memory_warning_event() to make sure that nonessential objects
3397         being kept alive by NSCaches get dropped when we need the memory.
3398
3399 2015-02-25  Zalan Bujtas  <zalan@apple.com>
3400
3401         Black line across screen on Adobe Illustrator detail page (non-retina only)
3402         https://bugs.webkit.org/show_bug.cgi?id=141866
3403
3404         Reviewed by Simon Fraser.
3405
3406         Phase is relative to the destination origin. We need to take location information into account
3407         while snapping so that the result is inline with the snapped destination rect.
3408         (location affects the snapped size.)
3409
3410         Test: fast/backgrounds/gradient-background-on-subpixel-position.html
3411
3412         * rendering/RenderBoxModelObject.cpp:
3413         (WebCore::pixelSnapBackgroundImageGeometryForPainting):
3414         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
3415
3416 2015-02-25  Brent Fulgham  <bfulgham@apple.com>
3417
3418         [Win] Use WEBCORE_EXPORT instead of Definition file
3419         https://bugs.webkit.org/show_bug.cgi?id=141734
3420
3421         Reviewed by Alex Christensen.
3422
3423         No change in functionality.
3424
3425         * WebCore.vcxproj/WebCore.vcxproj: Correct bad Precompiled header
3426         settings on certain files.
3427         * WebCore.vcxproj/WebCore.vcxproj.filters: Automatically updated
3428         by Visual Studio.
3429         * WebCore.vcxproj/WebCoreTestSupport.vcxproj: Ditto.
3430         * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: Ditto.
3431         * WebCore.vcxproj/WebCoreTestSupportCommon.props: Added.
3432         * WebCore.vcxproj/WebCoreTestSupportDebug.props: Added.
3433         * WebCore.vcxproj/WebCoreTestSupportDebugWinCairo.props: Added.
3434         * WebCore.vcxproj/WebCoreTestSupportProduction.props: Added.
3435         * WebCore.vcxproj/WebCoreTestSupportRelease.props: Added.
3436         * WebCore.vcxproj/WebCoreTestSupportReleaseWinCairo.props: Added.
3437         * WebCorePrefix.h: Provide proper export definitions for Windows.
3438         * bindings/js/JSCustomXPathNSResolver.cpp: Add missing #include
3439         needed by the new export style.
3440         * bindings/js/JSDOMWindowBase.h: Export class since DRT needs
3441         access to parts of it.
3442         * bindings/js/ScriptCachedFrameData.cpp: Add missing #include
3443         needed by the new export style.
3444         * bindings/scripts/CodeGeneratorJS.pm: Use different export macro
3445         when generating WebCoreTestSupport files, so that we don't confuse
3446         the linker when WebCore.lib and WebCoreTestSupport.lib try to
3447         both export WEBCORE_EXPORT symbols.
3448         (ExportLabelForClass):
3449         (GenerateHeader):
3450         * bridge/jsc/BridgeJSC.cpp: Add missing #include needed by the new
3451         export style.
3452         * css/CSSParser.cpp: Ditto.
3453         * dom/Document.cpp: Ditto.
3454         * html/HTMLImageLoader.cpp: Ditto.
3455         * inspector/CommandLineAPIModule.cpp: Ditto.
3456         * inspector/PageDebuggerAgent.cpp: Ditto.
3457         * inspector/PageRuntimeAgent.cpp: Ditto.
3458         * inspector/WorkerRuntimeAgent.cpp: Ditto.
3459         * page/DOMWindow.cpp: Ditto.
3460         * page/DOMWindow.h: Export the destructor, as it is needed by
3461         DumpRenderTree (on Windows).
3462         * page/Page.cpp: Add missing #include needed by the new export style.
3463         * platform/Logging.h: Remove conflicting export declaration.
3464         * platform/PlatformExportMacros.h: Update for Windows use.
3465         * testing/Internals.cpp: Add missing #include needed by the new export style.
3466         * testing/Internals.h: Use WEBCORE_TESTSUPPORT_EXPORT for things that
3467         are supposed to be exported by WebCoreTestSupport, not WebCore.
3468         * testing/js/WebCoreTestSupport.cpp: Add missing #include needed by
3469         new export style.
3470         * testing/js/WebCoreTestSupportPrefix.cpp: Added.
3471         * testing/js/WebCoreTestSupportPrefix.h: Added.
3472         * xml/XMLHttpRequest.h: Export the destructor.
3473         * xml/XSLStyleSheetLibxslt.cpp: Add missing #include needed by the new
3474         export style.
3475         * xml/XSLTProcessorLibxslt.cpp: Ditto.
3476
3477 2015-02-25  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3478
3479         Remove unnecessary DatabaseFooTask::create
3480         https://bugs.webkit.org/show_bug.cgi?id=142002
3481
3482         Reviewed by Darin Adler.
3483
3484         DatabaseFooTask::create can be replaced with std::make_unique<>.
3485
3486         No new tests, no behavior changes.
3487
3488         * Modules/webdatabase/Database.cpp:
3489         (WebCore::Database::scheduleTransaction):
3490         (WebCore::Database::scheduleTransactionStep):
3491         (WebCore::Database::markAsDeletedAndClose):
3492         (WebCore::Database::closeImmediately):
3493         (WebCore::Database::tableNames):
3494         * Modules/webdatabase/DatabaseTask.h:
3495         (WebCore::DatabaseBackend::DatabaseCloseTask::create): Deleted.
3496         (WebCore::DatabaseBackend::DatabaseTransactionTask::create): Deleted.
3497         (WebCore::DatabaseBackend::DatabaseTableNamesTask::create): Deleted.
3498
3499 2015-02-25  Dean Jackson  <dino@apple.com>
3500
3501         [iOS Media] incorrect front padding on time values
3502         https://bugs.webkit.org/show_bug.cgi?id=142027
3503         <rdar://problem/19960790>
3504
3505         Reviewed by Brent Fulgham.
3506
3507         We don't want to prefix times with a "0".
3508
3509         * Modules/mediacontrols/mediaControlsApple.js:
3510         (Controller.prototype.formatTime):
3511
3512 2015-02-25  Chris Dumez  <cdumez@apple.com>
3513
3514         Make PublicURLManager suspendable
3515         https://bugs.webkit.org/show_bug.cgi?id=141977
3516         <rdar://problem/19923085>
3517
3518         Reviewed by Andreas Kling.
3519
3520         Make PublicURLManager suspendable by overriding ActiveDOMObject::canSuspend()
3521         and returning true. Nothing prevents suspending the PublicURLManager as its
3522         implementation never causes JS to be executed. No implementation for
3523         suspend() / resume() needs to be provided for the same reason.
3524
3525         The fact that PublicURLManager wasn't suspendable was preventing pages using
3526         URL.createObjectURL() from entering the PageCache. Baidu.com search results
3527         pages are using the API for example.
3528
3529         Test: fast/history/page-cache-createObjectURL.html
3530
3531         * html/PublicURLManager.cpp:
3532         (WebCore::PublicURLManager::canSuspend):
3533         * html/PublicURLManager.h:
3534
3535 2015-02-25  Zalan Bujtas  <zalan@apple.com>
3536
3537         Cleanup BackgroundImageGeometry class.
3538         https://bugs.webkit.org/show_bug.cgi?id=141997
3539
3540         Reviewed by Simon Fraser.
3541
3542         This patch attempts to improve RenderBoxModelObject::calculateBackgroundImageGeometry() readability by
3543         removing redundant code and making image geometry operations explicit. BackgroundImageGeometry
3544         becomes a read only class (with the exception of the clip() method).
3545
3546         No change in functionality.
3547
3548         * rendering/RenderBoxModelObject.cpp:
3549         (WebCore::BackgroundImageGeometry::BackgroundImageGeometry):
3550         (WebCore::BackgroundImageGeometry::pixelSnapBackgroundImageGeometryForPainting):
3551         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
3552         (WebCore::BackgroundImageGeometry::setNoRepeatX): Deleted.
3553         (WebCore::BackgroundImageGeometry::setNoRepeatY): Deleted.
3554         (WebCore::BackgroundImageGeometry::useFixedAttachment): Deleted.
3555         (WebCore::BackgroundImageGeometry::clip): Deleted.
3556         (WebCore::RenderBoxModelObject::pixelSnapBackgroundImageGeometryForPainting): Deleted.
3557         * rendering/RenderBoxModelObject.h:
3558         (WebCore::BackgroundImageGeometry::clip):
3559         (WebCore::BackgroundImageGeometry::BackgroundImageGeometry): Deleted.
3560         (WebCore::BackgroundImageGeometry::setDestRect): Deleted.
3561         (WebCore::BackgroundImageGeometry::setPhase): Deleted.
3562         (WebCore::BackgroundImageGeometry::setPhaseX): Deleted.
3563         (WebCore::BackgroundImageGeometry::setPhaseY): Deleted.
3564         (WebCore::BackgroundImageGeometry::setTileSize): Deleted.
3565         (WebCore::BackgroundImageGeometry::setSpaceSize): Deleted.
3566         (WebCore::BackgroundImageGeometry::setHasNonLocalGeometry): Deleted.
3567
3568 2015-02-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
3569
3570         Horizontal and vertical lines are clipped completely if clip-path is included in the tag but the referenced element is defined later.
3571         https://bugs.webkit.org/show_bug.cgi?id=141776.
3572
3573         Reviewed by Dean Jackson.
3574
3575         Tests: svg/clip-path/clip-path-line-use-before-defined-expected.svg
3576                svg/clip-path/clip-path-line-use-before-defined.svg
3577
3578         * rendering/svg/RenderSVGResourceClipper.cpp:
3579         (WebCore::RenderSVGResourceClipper::applyClippingToContext): Ensure the renderer
3580         is added to m_clipper if it does not exist. The same renderer might have been 
3581         added to m_clipper in resourceBoundingBox().
3582         
3583         (WebCore::RenderSVGResourceClipper::addRendererToClipper): Add the renderer to
3584         m_clipper if it does not exist. Return the associated ClipperData.
3585         
3586         (WebCore::RenderSVGResourceClipper::resourceBoundingBox): If the clipper is
3587         referenced before it is defined, add the renderer to m_clipper. While doing the
3588         layout() for the clipper, we can check if m_clipper has values or not. If it does
3589         have, we are going to mark the clipper for client invalidation which is done by
3590         the SVG root.
3591         
3592         * rendering/svg/RenderSVGResourceClipper.h:
3593         * rendering/svg/RenderSVGResourceContainer.h:
3594         (WebCore::RenderSVGResourceContainer::selfNeedsClientInvalidation): Define a 
3595         new function selfNeedsClientInvalidation() which controls marking the clipper 
3596         for client invalidation. In RenderSVGResourceClipper, override it so it checks
3597         m_clipper to force clients validation even if it the first time we do layout
3598         for this clipper.
3599
3600         * rendering/svg/RenderSVGResourceContainer.cpp:
3601         (WebCore::RenderSVGResourceContainer::layout): Call the virtual function
3602         selfNeedsClientInvalidation() to check whether we need to mark the clipper for
3603         client invalidation.
3604         
3605         * svg/SVGElement.cpp: Delete unneeded header file.
3606
3607 2015-02-25  peavo@outlook.com  <peavo@outlook.com>
3608
3609         [WinCairo] WinLauncher is not starting on Vista.
3610         https://bugs.webkit.org/show_bug.cgi?id=141905
3611
3612         Reviewed by Alex Christensen.
3613
3614         We have to soft link with Media Foundation functions to be able
3615         to start on Vista and WinXP.
3616
3617         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3618         (WebCore::MediaPlayerPrivateMediaFoundation::createSession):
3619         (WebCore::MediaPlayerPrivateMediaFoundation::endSession):
3620         (WebCore::MediaPlayerPrivateMediaFoundation::startCreateMediaSource):
3621         (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
3622         (WebCore::MediaPlayerPrivateMediaFoundation::createTopologyFromSource):
3623         (WebCore::MediaPlayerPrivateMediaFoundation::createOutputNode):
3624         (WebCore::MediaPlayerPrivateMediaFoundation::createSourceStreamNode):
3625         (WebCore::MediaPlayerPrivateMediaFoundation::onTopologySet):
3626
3627 2015-02-25  Beth Dakin  <bdakin@apple.com>
3628
3629         REGRESSION (r180018 ): Holding a rubber-band in place can get stuck
3630         https://bugs.webkit.org/show_bug.cgi?id=142020
3631         -and corresponding-
3632         rdar://problem/19945216
3633
3634         Reviewed by Tom Horton.
3635
3636         It was a mistaken assumption that it was necessary to return false in the zero-
3637         delta case. That is clearly conceptually wrong since false represents the DOM 
3638         doing something special with the event, which is clearly not the case if we never 
3639         even send the event to the DOM. Returning true will allow the rest of the 
3640         scrolling machinery the ability to handle the event.
3641         * dom/Element.cpp:
3642         (WebCore::Element::dispatchWheelEvent):
3643
3644 2015-02-25  Ryosuke Niwa  <rniwa@webkit.org>
3645
3646         HTMLElement::collectStyleForPresentationAttribute duplicates a lot of code for contentEditableAttr
3647         https://bugs.webkit.org/show_bug.cgi?id=142003
3648
3649         Reviewed by Sam Weinig.
3650
3651         Utilized contentEditableType to reduce the code duplication.
3652
3653         * html/HTMLElement.cpp:
3654         (WebCore::contentEditableType): Moved and added a version that takes AtomicString.
3655         (WebCore::HTMLElement::collectStyleForPresentationAttribute):
3656
3657 2015-02-25  Sergio Villar Senin  <svillar@igalia.com>
3658
3659         [CSS Grid Layout] Tracks growing beyond limits when they should not
3660         https://bugs.webkit.org/show_bug.cgi?id=140883
3661
3662         Reviewed by Darin Adler.
3663
3664         Our track sizing algorithm implementation incorrectly grew some
3665         tracks beyond limits when handling min-content and max-content
3666         base sizes. In those cases we should only grow "any affected track
3667         that happens to also have an intrinsic max track sizing function"
3668         or all of them if there are none.
3669
3670         The problem was that we're using a vector of indexes pointing to
3671         the vector with the list of affected tracks. Those indexes become
3672         easily incorrect because the first thing we do in
3673         distributeSpaceToTracks() is to sort the vector with the affected
3674         tracks by growth potential.
3675
3676         Instead of that we now pass a vector with pointers to the list of
3677         tracks allowed to grow over the limits. The size changes are now
3678         directly stored in the GridTracks (it's called plannedSize)
3679         instead of in a separate vector, so we don't need to worry about
3680         tracks being rearranged (and we also get rid of the ugly vector of
3681         indexes pointing to another vector).
3682
3683         * rendering/RenderGrid.cpp:
3684         (WebCore::GridTrack::plannedSize): New member with getter/setter.
3685         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
3686         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
3687         Pass a setXXX() function instead of a growXXX() one to ForItems().
3688         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
3689         Renamed additionalBreadthSpace to extraSpace which is the term
3690         used by specs.
3691         (WebCore::RenderGrid::distributeSpaceToTracks): Use GridTrack's
3692         plannedSize instead of the old distribution vector.
3693         (WebCore::GridTrack::growBaseSize): Deleted.
3694         (WebCore::GridTrack::growGrowthLimit): Deleted.
3695         * rendering/RenderGrid.h:
3696
3697 2015-02-25  Joanmarie Diggs  <jdiggs@igalia.com>
3698
3699         AX: Implement support for ARIA 1.1 'searchbox' role
3700         https://bugs.webkit.org/show_bug.cgi?id=142004
3701
3702         Reviewed by Chris Fleizach.
3703
3704         Add a new accessible SearchFieldRole to handle both the ARIA role
3705         and the "search" input type.
3706
3707         No new tests. Instead, added a new test case to roles-exposed.html
3708         for the mapping, and updated roles-computedRoleString.html because
3709         there is now a one-to-one mapping between the "search" input type
3710         and an ARIA role.
3711
3712         * accessibility/AccessibilityNodeObject.cpp:
3713         (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
3714         (WebCore::AccessibilityNodeObject::isSearchField):
3715         * accessibility/AccessibilityObject.cpp:
3716         (WebCore::AccessibilityObject::isARIATextControl):
3717         (WebCore::AccessibilityObject::isARIAInput):
3718         (WebCore::initializeRoleMap):
3719         * accessibility/AccessibilityObject.h:
3720         * accessibility/AccessibilityRenderObject.cpp:
3721         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
3722         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3723         (atkRole):
3724         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3725         (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
3726         (-[WebAccessibilityObjectWrapper accessibilityTraits]):
3727         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
3728         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3729         (createAccessibilityRoleMap):
3730
3731 2015-02-24  Simon Fraser  <simon.fraser@apple.com>
3732
3733         Clarify some resizing terminology in ScrollView/FrameView
3734         https://bugs.webkit.org/show_bug.cgi?id=141996
3735
3736         Reviewed by Zalan Bujtas.
3737
3738         ScrollableArea/ScrollView/FrameView had some confusing terminology around
3739         contentsResized/visibleContentsResized/fixedLayoutSizeChanged.
3740         
3741         Clarify this by distinguishing between:
3742         1. Available size changes because of
3743             i) non-overlay scrollbar presence
3744            ii) ScrollableArea frame change
3745         2. Removing fixedLayoutSizeChanged() and just treating it like an
3746            available size change.
3747            
3748         contentsResized() is relegated to simply being a hook that allows Mac to
3749         flash overlay scrollbars.
3750         
3751         The confusingly named visibleContentsResized() is now updateContentsSize(),
3752         and is the way that a ScrollableArea tells its subclasss that it should recompute
3753         the size of the contents (i.e. do a layout).
3754
3755         * page/FrameView.cpp:
3756         (WebCore::FrameView::setContentsSize): No longer mysteriously skip the
3757         FrameView implementation of contentsResized(), which used to do a setNeedsLayout()
3758         which we didn't want to do from setContentsSize(), which itself happens as a result of layout.
3759         (WebCore::FrameView::adjustViewSize): Whitespace.
3760         (WebCore::FrameView::layout): Ditto.
3761         (WebCore::FrameView::availableContentSizeChanged): Called on frame size change, or scrollbar
3762         change.
3763         (WebCore::FrameView::updateContentsSize): This actually does the layout.
3764         (WebCore::FrameView::scrollbarStyleChanged): Always call the base class;  ScrollView::scrollbarStyleChanged
3765         will bail if not a forced update.
3766         (WebCore::FrameView::setCustomFixedPositionLayoutRect): Forces a layout via updateContentsSize() now.
3767         (WebCore::FrameView::contentsResized): Deleted.
3768         (WebCore::FrameView::fixedLayoutSizeChanged): Deleted.
3769         (WebCore::FrameView::visibleContentsResized): Deleted.
3770         * page/FrameView.h:
3771         * platform/ScrollView.cpp:
3772         (WebCore::ScrollView::setFixedLayoutSize): Calls availableContentSizeChanged() now.
3773         (WebCore::ScrollView::setUseFixedLayout): Ditto.
3774         (WebCore::ScrollView::availableContentSizeChanged): Update scrollbars if that's not
3775         the reason we are being called.
3776         (WebCore::ScrollView::updateScrollbars): contentsResized() was the thing that caused setNeedsLayout();
3777         replace it with availableContentSizeChanged(). visibleContentsResized() did the layout, and
3778         replace with updateContentsSize().
3779         (WebCore::ScrollView::setFrameRect): Call availableContentSizeChanged() now. This takes care of
3780         updating scrollbars, so no need to explicitly do that.
3781         (WebCore::ScrollView::scrollbarStyleChanged): Call the base class.
3782         (WebCore::ScrollView::fixedLayoutSizeChanged): Deleted.
3783         * platform/ScrollView.h:
3784         * platform/ScrollableArea.cpp:
3785         (WebCore::ScrollableArea::availableContentSizeChanged): Call scrollAnimator->contentsResized()
3786         to flash the scrollbars.
3787         (WebCore::ScrollableArea::scrolledToRight):
3788         (WebCore::ScrollableArea::scrollbarStyleChanged): Call availableContentSizeChanged() since
3789         scrollbar style affects available space.
3790         * platform/ScrollableArea.h:
3791         (WebCore::ScrollableArea::updateContentsSize):
3792         (WebCore::ScrollableArea::scrollbarStyleChanged): Deleted.
3793
3794 2015-02-24  Ryosuke Niwa  <rniwa@webkit.org>
3795
3796         Unreviewed Mavericks build attempt fix after r180609.
3797
3798         * platform/graphics/mac/GraphicsContext3DMac.mm:
3799         (WebCore::GraphicsContext3D::GraphicsContext3D):
3800         (WebCore::GraphicsContext3D::checkGPUStatusIfNecessary):
3801
3802 2015-02-19  Roger Fong  <roger_fong@apple.com>
3803
3804         WebGL: Destroy the GLContext if a GPU restart has been detected.
3805         https://bugs.webkit.org/show_bug.cgi?id=141567.
3806         <rdar://problem/18507496>
3807
3808         Reviewed by Dean Jackson.
3809
3810         * html/canvas/WebGLRenderingContextBase.cpp:
3811         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
3812         * platform/graphics/GraphicsContext3D.h:
3813         (WebCore::GraphicsContext3D::setWebGLContext): 
3814         Keep track of which WebGLRenderingContext is associated with the current GraphicsContext3D.
3815         * platform/graphics/mac/GraphicsContext3DMac.mm:
3816         (WebCore::GraphicsContext3D::checkGPUStatusIfNecessary): Helper method to check GPU status.
3817         (WebCore::GraphicsContext3D::GraphicsContext3D): 
3818         Don’t immediately abort the GPU process when the restart status is kCGLCPGPURestartStatusBlacklisted.
3819         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3820         (WebCore::GraphicsContext3D::forceContextLost): 
3821         Force the WebGLRenderingContext to be lost.
3822         (WebCore::GraphicsContext3D::drawArrays): Check GPU status after calling drawArrays.
3823         (WebCore::GraphicsContext3D::drawElements): Check GPU status after calling drawElements.
3824         * WebCore.xcodeproj/project.pbxproj: Add SPI header for iOS.
3825         * platform/spi/ios/OpenGLESSPI.h: Added.
3826
3827 2015-02-24  Stephanie Lewis  <slewis@apple.com>
3828
3829         Unreviewed ios build fix after http://trac.webkit.org/changeset/180602.
3830
3831         * bindings/js/JSDOMWindowBase.cpp:
3832         (WebCore::JSDOMWindowBase::commonVM):
3833
3834 2015-02-24  Simon Fraser  <simon.fraser@apple.com>
3835
3836         Use an enum for scrollbar style
3837         https://bugs.webkit.org/show_bug.cgi?id=141985
3838
3839         Reviewed by Beth Dakin.
3840
3841         Switch to an enum class for the scrollbar style (normal or overlay).
3842
3843         * page/ChromeClient.h:
3844         * page/FrameView.cpp:
3845         (WebCore::FrameView::scrollbarStyleChanged):
3846         * page/FrameView.h:
3847         * platform/ScrollTypes.h:
3848         * platform/ScrollView.cpp:
3849         (WebCore::ScrollView::scrollbarStyleChanged):
3850         * platform/ScrollView.h:
3851         * platform/ScrollableArea.h:
3852         (WebCore::ScrollableArea::scrollbarStyleChanged):
3853         * platform/mac/ScrollAnimatorMac.mm:
3854         (WebCore::ScrollAnimatorMac::updateScrollerStyle):
3855
3856 2015-02-24  Commit Queue  <commit-queue@webkit.org>
3857
3858         Unreviewed, rolling out r180599.
3859         https://bugs.webkit.org/show_bug.cgi?id=141998
3860
3861         Lots of new test failures (Requested by smfr on #webkit).
3862
3863         Reverted changeset:
3864
3865         "Parsing support for -webkit-trailing-word"
3866         https://bugs.webkit.org/show_bug.cgi?id=141939
3867         http://trac.webkit.org/changeset/180599
3868
3869 2015-02-24  Sam Weinig  <sam@webkit.org>
3870
3871         [Attachment] Give <attachment> elements an underlying File
3872         https://bugs.webkit.org/show_bug.cgi?id=141993
3873
3874         Reviewed by Tim Horton.
3875
3876         - Add a JS subclass for attachments so that <attachment>s are
3877           instances of HTMLAttachmentElement rather than HTMLElement.
3878         - Give HTMLAttachmentElements an underlying File that they
3879           are the representation of. Expose it via a new 'file' property.
3880         - Expose a new Internals function called window.internals.createFile(url)
3881           that allows creating File objects for testing.
3882
3883         * CMakeLists.txt:
3884         * DerivedSources.cpp:
3885         * DerivedSources.make:
3886         * WebCore.vcxproj/WebCore.vcxproj:
3887         * WebCore.vcxproj/WebCore.vcxproj.filters:
3888         * WebCore.xcodeproj/project.pbxproj:
3889         * fileapi/File.h:
3890         * html/HTMLAttachmentElement.cpp:
3891         (WebCore::HTMLAttachmentElement::~HTMLAttachmentElement):
3892         (WebCore::HTMLAttachmentElement::file):
3893         (WebCore::HTMLAttachmentElement::setFile):
3894         * html/HTMLAttachmentElement.h:
3895         * html/HTMLAttachmentElement.idl: Added.
3896         * html/HTMLTagNames.in:
3897         * testing/Internals.cpp:
3898         (WebCore::Internals::createFile):
3899         * testing/Internals.h:
3900         * testing/Internals.idl:
3901
3902 2015-02-24  Joanmarie Diggs  <jdiggs@igalia.com>
3903
3904         AX: Implement support for ARIA 1.1 'switch' role
3905         https://bugs.webkit.org/show_bug.cgi?id=141986
3906
3907         Reviewed by Chris Fleizach.
3908
3909         Map the role to ATK_ROLE_TOGGLE_BUTTON for Gtk and Efl; on the Mac, to
3910         AXCheckBox with a subrole of AXSwitch. Ensure it looks and acts like a
3911         widget to accessibility APIs (supports and emits notifications when
3912         toggled, doesn't have children, exposes a name and description when