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