[ContentExtensions] Prepare for compiling stylesheets of selectors to be used on...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-03-18  Alex Christensen  <achristensen@webkit.org>
2
3         [ContentExtensions] Prepare for compiling stylesheets of selectors to be used on every page.
4         https://bugs.webkit.org/show_bug.cgi?id=142799
5
6         Reviewed by Brady Eidson.
7
8         * WebCore.xcodeproj/project.pbxproj:
9         Make private headers to use with API tests.
10         * contentextensions/CompiledContentExtension.cpp:
11         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
12         * contentextensions/CompiledContentExtension.h:
13         Added method to get only the selectors from the root of the DFA, which apply to all URLs.
14         * contentextensions/ContentExtensionCompiler.cpp:
15         (WebCore::ContentExtensions::compileRuleList):
16         Added checking if the trigger will match everything.
17         These actions can be put directly on the root of the DFA without adding extra epsilon transitions to the NFA.
18         * contentextensions/DFA.h:
19         (WebCore::ContentExtensions::DFA::nodeAt):
20         * contentextensions/DFABytecodeInterpreter.cpp:
21         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
22         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
23         * contentextensions/DFABytecodeInterpreter.h:
24         * contentextensions/NFA.h:
25         * contentextensions/URLFilterParser.cpp:
26         (WebCore::ContentExtensions::Term::quantifier):
27         Sink terms to a vector then add nodes to NFA when finalizing after checking for regexes that match everything.
28         (WebCore::ContentExtensions::GraphBuilder::GraphBuilder):
29         (WebCore::ContentExtensions::GraphBuilder::finalize):
30         (WebCore::ContentExtensions::GraphBuilder::parseStatus):
31         (WebCore::ContentExtensions::GraphBuilder::atomPatternCharacter):
32         (WebCore::ContentExtensions::GraphBuilder::atomBuiltInCharacterClass):
33         (WebCore::ContentExtensions::GraphBuilder::quantifyAtom):
34         (WebCore::ContentExtensions::GraphBuilder::atomBackReference):
35         (WebCore::ContentExtensions::GraphBuilder::assertionBOL):
36         (WebCore::ContentExtensions::GraphBuilder::assertionWordBoundary):
37         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassAtom):
38         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassRange):
39         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassBuiltIn):
40         (WebCore::ContentExtensions::GraphBuilder::atomParentheticalAssertionBegin):
41         (WebCore::ContentExtensions::GraphBuilder::disjunction):
42         (WebCore::ContentExtensions::GraphBuilder::hasError):
43         (WebCore::ContentExtensions::GraphBuilder::fail):
44         (WebCore::ContentExtensions::GraphBuilder::sinkFloatingTermIfNecessary):
45         (WebCore::ContentExtensions::URLFilterParser::addPattern):
46         (WebCore::ContentExtensions::URLFilterParser::statusString):
47         (WebCore::ContentExtensions::GraphBuilder::errorMessage): Deleted.
48         * contentextensions/URLFilterParser.h:
49         Use an enum instead of strings for the status to avoid checking strings when we have a regex that matches everything.
50
51 2015-03-18  Yusuke Suzuki  <utatane.tea@gmail.com>
52
53         Fix build failure due to FALLTHROUGH in unreachable code
54         https://bugs.webkit.org/show_bug.cgi?id=142703
55
56         Reviewed by Benjamin Poulain.
57
58         FALLTHROUGH should not exist in unreachable code marked by
59         ASSERT_NOT_REACHABLE.
60
61         When !ENABLE(CSS_SELECTOR_JIT) and Debug mode is enabled,
62         both ASSERT_NOT_REACHED and FALLTHROUGH are instantiated
63         and it cause build failure.
64
65         Here, since CompiledSingle/CompiledSingleWithRootFilter are
66         not set when !ENABLE(CSS_SELECTOR_JIT). So dropping FALLTHROUGH
67         and leave ASSERT_NOT_REACHED.
68         And since ASSERT_NOT_ReACHED is stripped when Release build,
69         I've inserted FALLTHROUGH() if ASSERT_DISABLED.
70         This fix is the same to r162906.
71
72         * dom/SelectorQuery.cpp:
73         (WebCore::SelectorDataList::execute):
74
75 2015-03-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
76
77         Switching between two SVG images with no intrinsic sizes causes them to get the default SVG size instead of the container size.
78         https://bugs.webkit.org/show_bug.cgi?id=142805.
79
80         Reviewed by Darin Adler.
81         
82         The bug happens due to wrong logic in RenderImage::imageDimensionsChanged().
83         This function decides to setNeedsLayout() if the intrinsic size of the image
84         changes. If the size does not change, it only repaints the image rectangle.
85         When switching the src of the an image between two SVG images and both of
86         them have no intrinsic size, we do not updateInnerContentRect() and this
87         means an SVGImageForContainer is not going to be created for this image.
88         When the image is drawn, it is drawn directly from the SVGImage. And this
89         means the drawing has to be scaled by container_size / SVG_default_intrinsic_size
90         
91         After figuring out that I need to updateInnerContentRect() to fix this bug,
92         I found out Blink has already changed this code to do the same thing. But 
93         they also did more clean-up in this function. Here is the link
94         https://codereview.chromium.org/114323004. I think their change seems correct
95         although they did not say what exactly they were trying to fix.
96         
97         The plan for repaintOrMarkForLayout(), which is the new name of this function,
98         is the following:
99             -- setNeedLayout() if the intrinsic size changes and it affects the size
100                of the image.
101             -- updateInnerContentRect() if the intrinsic size did not change but the
102                image has exiting layout.
103             -- repaint the image rectangle if layout is not needed.
104             
105         This change also removes the call to computeLogicalWidthInRegion(), which is
106         almost running a layout for the image. This call figures out whether the image
107         needs to setNeedsLayout(). This call is unnecessary; the image needs to run a
108         layout if the intrinsic size has changed and it affects the size of the image.
109                     
110         Test: svg/as-image/svg-no-intrinsic-size-switching.html
111
112         * rendering/RenderImage.cpp:
113         (WebCore::RenderImage::styleDidChange): Change the function call.
114         (WebCore::RenderImage::imageChanged): Rename local variable and change the
115         function call.
116         
117         (WebCore::RenderImage::updateIntrinsicSizeIfNeeded): Simplify this function.
118         Call setIntrinsicSize() with the new size unless the image is in error state.
119         
120         (WebCore::RenderImage::repaintOrMarkForLayout): This a better name for this
121         function since it is called even if the intrinsic size was not changed.
122         (WebCore::RenderImage::imageDimensionsChanged): Deleted.
123         
124         * rendering/RenderImage.h: Rename imageDimensionsChanged() and change the 
125         updateIntrinsicSizeIfNeeded() to return void.
126         
127         * rendering/svg/RenderSVGForeignObject.cpp:
128         (WebCore::RenderSVGForeignObject::paint): Code cleanup. This function can
129         only handle the paint phases PaintPhaseForeground and PaintPhaseSelection.
130         Use this information to simplify the logic and order of painting there.
131
132 2015-03-18  Jeremy Jones  <jeremyj@apple.com>
133
134         Fix typo in playerViewControllerWillCancelOptimizedFullscree.
135         https://bugs.webkit.org/show_bug.cgi?id=142745
136
137         Reviewed by Darin Adler.
138
139         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
140         (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscreen:]):
141         (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscree:]): Deleted.
142
143 2015-03-18  Simon Fraser  <simon.fraser@apple.com>
144
145         Avoid repaints when changing transform on an element with multiple background images
146         https://bugs.webkit.org/show_bug.cgi?id=142841
147
148         Reviewed by Zalan Bujtas.
149         
150         Replace the cheap test for changed images in RenderElement::updateFillImages()
151         with an exhaustive test that walks the entire list of background images,
152         since any ensuing repaint is way more expensive than a slightly more expensive check here.
153         
154         Test: fast/repaint/multiple-backgrounds-style-change.html
155
156         * rendering/RenderElement.cpp:
157         (WebCore::RenderElement::updateFillImages):
158         * rendering/style/FillLayer.cpp:
159         (WebCore::layerImagesIdentical): See if both images are the same (either none
160         or both mask images, and same image pointer).
161         (WebCore::FillLayer::imagesIdentical): Walk the two FillLayer lists, checking the images
162         on each one. Returns false if we reach the end of one list before the other, or the images
163         are different.
164         * rendering/style/FillLayer.h: New static function; static because
165         it compares two FillLayer lists, and I think that makes more sense than
166         a member function.
167
168 2015-03-18  Anders Carlsson  <andersca@apple.com>
169
170         Pass cookies by reference in CookieHash functions
171         https://bugs.webkit.org/show_bug.cgi?id=142839
172
173         Reviewed by Sam Weinig.
174
175         * platform/Cookie.h:
176         (WebCore::CookieHash::hash):
177         (WebCore::CookieHash::equal):
178
179 2015-03-18  Tim Horton  <timothy_horton@apple.com>
180
181         Temporarily fix the !ENABLE(CSS_SELECTOR_JIT) and assertions-enabled build
182
183         * dom/SelectorQuery.cpp:
184         (WebCore::SelectorDataList::execute):
185
186 2015-03-18  Myles C. Maxfield  <mmaxfield@apple.com>
187
188         Call CTFontSetRenderingParameters before rendering text
189         https://bugs.webkit.org/show_bug.cgi?id=142816
190
191         Reviewed by Darin Adler.
192
193         No new tests.
194
195         * platform/graphics/cocoa/FontCascadeCocoa.mm:
196         (WebCore::showGlyphsWithAdvances):
197         * platform/spi/cocoa/CoreTextSPI.h:
198
199 2015-03-18  Chris Dumez  <cdumez@apple.com>
200
201         [WK2] Log the number of network cache requests that we have never seen before
202         https://bugs.webkit.org/show_bug.cgi?id=142828
203         <rdar://problem/19632130>
204
205         Reviewed by Antti Koivisto.
206
207         Add diagnostic logging key for network cache efficacy logging.
208
209         * page/DiagnosticLoggingKeys.cpp:
210         (WebCore::DiagnosticLoggingKeys::neverSeenBeforeKey):
211         (WebCore::DiagnosticLoggingKeys::requestKey):
212         * page/DiagnosticLoggingKeys.h:
213
214 2015-03-18  Yusuke Suzuki  <utatane.tea@gmail.com>
215
216         Use filterRootId in SelectorQuery even if CSS JIT is not enabled
217         https://bugs.webkit.org/show_bug.cgi?id=142703
218
219         Reviewed by Benjamin Poulain.
220
221         filterRootId pruning path is not inherently related to CSS JIT.
222         This patch enables filterRootId even in the environment
223         where CSS JIT is not enabled.
224
225         * dom/SelectorQuery.cpp:
226         (WebCore::filterRootById):
227         (WebCore::SelectorDataList::executeSingleSelectorData):
228         (WebCore::SelectorDataList::execute):
229         * dom/SelectorQuery.h:
230
231 2015-03-18  Zalan Bujtas  <zalan@apple.com>
232
233         Simple line layout: Use Vector<>::const_iterator instead of custom FlowContents::Iterator.
234         https://bugs.webkit.org/show_bug.cgi?id=142809
235
236         Reviewed by Antti Koivisto.
237
238         FlowContents::Iterator simply iterates on a vector<>. No need to custom implement it.
239
240         No change in functionality.
241
242         * rendering/SimpleLineLayoutFlowContents.h:
243         (WebCore::SimpleLineLayout::FlowContents::begin):
244         (WebCore::SimpleLineLayout::FlowContents::end):
245         (WebCore::SimpleLineLayout::FlowContents::Iterator::Iterator): Deleted.
246         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator++): Deleted.
247         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator--): Deleted.
248         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator==): Deleted.
249         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator!=): Deleted.
250         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*): Deleted.
251         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->): Deleted.
252         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
253         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
254
255 2015-03-18  Zalan Bujtas  <zalan@apple.com>
256
257         Simple line layout: Change FlowContents::segmentForPosition() to segmentForRun().
258         https://bugs.webkit.org/show_bug.cgi?id=142785
259
260         Reviewed by Antti Koivisto.
261
262         This is in transition to support <br>. A particular position could point to multiple
263         segments when <br> is directly followed by text.
264
265         No change in functionality.
266
267         * rendering/SimpleLineLayoutFlowContents.cpp:
268         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForRunSlow):
269         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPositionSlow): Deleted.
270         * rendering/SimpleLineLayoutFlowContents.h:
271         (WebCore::SimpleLineLayout::FlowContents::segmentForRun):
272         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPosition): Deleted.
273         (WebCore::SimpleLineLayout::FlowContents::segmentForPosition): Deleted.
274         * rendering/SimpleLineLayoutResolver.cpp:
275         (WebCore::SimpleLineLayout::RunResolver::Run::text):
276
277 2015-03-17  Simon Fraser  <simon.fraser@apple.com>
278
279         Skip trying to paint overlay scrollbars when there are none or they are clipped out
280         https://bugs.webkit.org/show_bug.cgi?id=142811
281         rdar://problem/20200725
282
283         Reviewed by Darin Adler.
284
285         In some content with lots of layers and overflow:scroll, we could spend 20% of
286         the time under paintOverflowControlsForFragments() setting up an (empty) clip,
287         and then trying to draw scrollbars that we don't have.
288         
289         Avoid calling paintOverflowControlsForFragments() if there are no scrollbars,
290         and don't both setting up an empty clip just to paint nothing.
291
292         * rendering/RenderLayer.cpp:
293         (WebCore::RenderLayer::paintLayerContents):
294         (WebCore::RenderLayer::paintOverflowControlsForFragments):
295
296 2015-03-18  Per Arne Vollan  <peavo@outlook.com>
297
298         [WinCairo] Unreviewed build fix after r181665.
299
300         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
301         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
302
303 2015-03-18  Joseph Pecoraro  <pecoraro@apple.com>
304
305         Remove unused "preprocessor" parameter to sub-CodeGenerators
306         https://bugs.webkit.org/show_bug.cgi?id=142793
307
308         Reviewed by Darin Adler.
309
310         * bindings/scripts/CodeGenerator.pm:
311         (ProcessDocument):
312         (FileNamePrefix):
313         * bindings/scripts/CodeGeneratorObjC.pm:
314
315 2015-03-18  Zalan Bujtas  <zalan@apple.com>
316
317         Simple line layout: Split fragments on renderer boundary on the fly.
318         https://bugs.webkit.org/show_bug.cgi?id=142579
319
320         Reviewed by Antti Koivisto.
321
322         Fragment splitting at renderers' boundary at the end of the line is no longer needed.
323         This patch ensures that TextFragmentIterator::nextTextFragment() does not concatenate
324         fragments across renderer boundary.
325
326         Test: fast/text/simple-line-with-multiple-renderers.html
327
328         * rendering/SimpleLineLayout.cpp:
329         (WebCore::SimpleLineLayout::revertRuns):
330         (WebCore::SimpleLineLayout::LineState::isEmpty):
331         (WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded): Check if fragments need a new run and
332         whether neighboring fragments need collapsing.
333         (WebCore::SimpleLineLayout::LineState::revertUncommitted): Revert fragments over multiple renderers if they form
334         a fragment continuation.
335         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
336         (WebCore::SimpleLineLayout::forceFragmentToLine): Ensure that if a fragment has continuation across multiple renderers,
337         they all get added to the current line.
338         (WebCore::SimpleLineLayout::createLineRuns):
339         (WebCore::SimpleLineLayout::LineState::appendFragment): Deleted.
340         (WebCore::SimpleLineLayout::FragmentForwardIterator::FragmentForwardIterator): Deleted.
341         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator++): Deleted.
342         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator!=): Deleted.
343         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator*): Deleted.
344         (WebCore::SimpleLineLayout::begin): Deleted.
345         (WebCore::SimpleLineLayout::end): Deleted.
346         (WebCore::SimpleLineLayout::preWrap): Deleted.
347         (WebCore::SimpleLineLayout::removeTrailingWhitespace): Deleted.
348         (WebCore::SimpleLineLayout::updateLineConstrains): Deleted.
349         (WebCore::SimpleLineLayout::splitRunsAtRendererBoundary): Deleted.
350         (WebCore::SimpleLineLayout::createTextRuns): Deleted.
351         (WebCore::SimpleLineLayout::create): Deleted.
352         (WebCore::SimpleLineLayout::Layout::create): Deleted.
353         * rendering/SimpleLineLayoutFlowContents.h:
354         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator+):
355         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*):
356         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->):
357         * rendering/SimpleLineLayoutFunctions.cpp:
358         (WebCore::SimpleLineLayout::paintFlow): Unrelated fix on non-collapsed tab position.
359         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
360         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragmentIterator):
361         (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
362         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
363         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
364         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
365         * rendering/SimpleLineLayoutTextFragmentIterator.h:
366         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
367         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::overlapsToNextRenderer):
368         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isCollapsible):
369         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::operator==):
370         (WebCore::SimpleLineLayout::TextFragmentIterator::isLineBreak):
371         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split): Deleted.
372
373 2015-03-18  Manuel Rego Casasnovas  <rego@igalia.com>
374
375         Flex and grid items should be painted as inline-blocks
376         https://bugs.webkit.org/show_bug.cgi?id=142266
377
378         Reviewed by Darin Adler.
379
380         Based on Blink r157004 by <cbiesinger@chromium.org>.
381         https://src.chromium.org/viewvc/blink?revision=157004&view=revision
382
383         Both flexbox and grid specs define that the painting order of flex/grid
384         items is the same as inline blocks. See
385         http://dev.w3.org/csswg/css-flexbox/#painting and
386         http://dev.w3.org/csswg/css-grid/#z-order.
387
388         Extracted inline blocks painting code from InlineElementBox and moved to
389         a helper method that will be reused for flexboxes and grids.
390
391         Tests: css3/flexbox/flex-item-text-background-not-interleaved.html
392                fast/css-grid-layout/grid-item-text-background-not-interleaved.html
393
394         * rendering/InlineElementBox.cpp:
395         (WebCore::InlineElementBox::paint): Move code to
396         RenderElement::paintAsInlineBlock().
397         * rendering/RenderBlock.cpp:
398         (WebCore::RenderBlock::paintChild): Add new argument to paint children
399         as inline blocks.
400         * rendering/RenderBlock.h: Define PaintType enmu and modify paintChild()
401         signature to add the new argument.
402         * rendering/RenderElement.cpp:
403         (WebCore::paintPhase): Paint element in a phase.
404         (WebCore::RenderElement::paintAsInlineBlock): Code extracted from
405         InlineElementBox::paint().
406         * rendering/RenderElement.h: Add new method signature.
407         * rendering/RenderFlexibleBox.cpp:
408         (WebCore::RenderFlexibleBox::paintChildren): Call
409         RenderBlock::paintChild() with the new argument.
410         * rendering/RenderGrid.cpp:
411         (WebCore::RenderGrid::paintChildren): Ditto.
412
413 2015-03-18  Chris Dumez  <cdumez@apple.com>
414
415         [WK2] Log total number of network cache queries using diagnostic logging
416         https://bugs.webkit.org/show_bug.cgi?id=142803
417         <rdar://problem/19632130>
418
419         Reviewed by Antti Koivisto.
420
421         Add diagnostic logging key needed for network efficacy logging.
422
423         * page/DiagnosticLoggingKeys.cpp:
424         (WebCore::DiagnosticLoggingKeys::retrievalRequestKey):
425         * page/DiagnosticLoggingKeys.h:
426
427 2015-03-18  Tim Horton  <timothy_horton@apple.com>
428
429         Fix the build after r181660
430
431         * page/EventHandler.cpp:
432         (WebCore::EventHandler::setImmediateActionStage):
433         * page/EventHandler.h:
434         (WebCore::EventHandler::setImmediateActionStage):
435         Un-inline setImmediateActionStage, because it is exported to WebCore, and
436         exporting inline thing causes random weak symbol errors on some platforms.
437
438 2015-03-17  Conrad Shultz  <conrad_shultz@apple.com>
439
440         Ignore some deprecation warnings
441         https://bugs.webkit.org/show_bug.cgi?id=142813
442
443         Reviewed by Mark Rowe.
444
445         Fixing the deprecations is tracked by: <rdar://problem/20201450>
446
447         * editing/cocoa/HTMLConverter.mm:
448         (HTMLConverter::_processElement):
449
450 2015-03-17  Commit Queue  <commit-queue@webkit.org>
451
452         Unreviewed, rolling out r181667, r181682, and r181683.
453         https://bugs.webkit.org/show_bug.cgi?id=142812
454
455         Broke multiple tests with ASan, plus dependent commits
456         (Requested by ap on #webkit).
457
458         Reverted changesets:
459
460         "Simple line layout: Split fragments on renderer boundary on
461         the fly."
462         https://bugs.webkit.org/show_bug.cgi?id=142579
463         http://trac.webkit.org/changeset/181667
464
465         "Simple line layout: Change FlowContents::segmentForPosition()
466         to segmentForRun()."
467         https://bugs.webkit.org/show_bug.cgi?id=142785
468         http://trac.webkit.org/changeset/181682
469
470         "Simple line layout: Use Vector<>::const_iterator instead of
471         custom FlowContents::Iterator."
472         https://bugs.webkit.org/show_bug.cgi?id=142809
473         http://trac.webkit.org/changeset/181683
474
475 2015-03-17  Zalan Bujtas  <zalan@apple.com>
476
477         Simple line layout: Use Vector<>::const_iterator instead of custom FlowContents::Iterator.
478         https://bugs.webkit.org/show_bug.cgi?id=142809
479
480         Reviewed by Antti Koivisto.
481
482         FlowContents::Iterator simply iterates on a vector<>. No need to custom implement it.
483
484         No change in functionality.
485
486         * rendering/SimpleLineLayoutFlowContents.h:
487         (WebCore::SimpleLineLayout::FlowContents::begin):
488         (WebCore::SimpleLineLayout::FlowContents::end):
489         (WebCore::SimpleLineLayout::FlowContents::Iterator::Iterator): Deleted.
490         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator++): Deleted.
491         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator--): Deleted.
492         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator==): Deleted.
493         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator!=): Deleted.
494         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*): Deleted.
495         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->): Deleted.
496         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
497         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
498
499 2015-03-17  Zalan Bujtas  <zalan@apple.com>
500
501         Simple line layout: Change FlowContents::segmentForPosition() to segmentForRun().
502         https://bugs.webkit.org/show_bug.cgi?id=142785
503
504         Reviewed by Antti Koivisto.
505
506         This is in transition to support <br>. A particular position could point to multiple
507         segments when <br> is directly followed by text.
508
509         No change in functionality.
510
511         * rendering/SimpleLineLayoutFlowContents.cpp:
512         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForRunSlow):
513         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPositionSlow): Deleted.
514         * rendering/SimpleLineLayoutFlowContents.h:
515         (WebCore::SimpleLineLayout::FlowContents::segmentForRun):
516         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPosition): Deleted.
517         (WebCore::SimpleLineLayout::FlowContents::segmentForPosition): Deleted.
518         * rendering/SimpleLineLayoutResolver.cpp:
519         (WebCore::SimpleLineLayout::RunResolver::Run::text):
520
521 2015-03-17  Chris Dumez  <cdumez@apple.com>
522
523         [Mac][iOS] setSharedTimerFireInterval() / stopSharedTimer() are expensive
524         https://bugs.webkit.org/show_bug.cgi?id=142752
525         <rdar://problem/20176731>
526
527         Reviewed by Antti Koivisto.
528
529         setSharedTimerFireInterval() / stopSharedTimer() are expensive on Mac
530         and iOS on pages using a lot of timers.
531
532         For example, on bing.com / iOS, ~15.4% of the CPU time is spent in
533         setSharedTimerFireInterval() and ~14.7% of the CPU time is spent in
534         stopSharedTimer(). The expensive calls are CFRunLoopAddTimer (11.4%),
535         CFRunLoopTimerInvalidate (14.1%), CFRunLoopTimerCreate (3.3%).
536
537         The issue is that we keep creating, adding to run loop modes, and then
538         destroying the sharedTimer for each firing event. This is very
539         expensive. In such case, the CFRunLoopTimerRef documentation advises to
540         """
541         ... create a repeating timer with an initial firing time in the distant
542         future (or the initial firing time) and a very large repeat interval—on
543         the order of decades or more—and add it to all the necessary run loop
544         modes. Then, when you know when the timer should fire next, you reset
545         the firing time with CFRunLoopTimerSetNextFireDate, perhaps from the
546         timer’s own callback function. This technique effectively produces a
547         reusable, asynchronous timer.
548         """ [1].
549
550         Doing so greatly decreases CPU time spend in:
551         - setSharedTimerFireInterval(): 15.4% -> 4.6%
552         - stopSharedTimer(): 14.6% -> 8.6%
553
554         Overall CPU time spent on bing.com in timerFired() goes down from
555         ~61.2% to ~49.5%.
556
557         This patch also refactors the SharedTimer code to share as much as
558         possible between Mac and iOS.
559
560         This patch is based in part on the following patch:
561         http://trac.webkit.org/changeset/143210
562
563         [1] https://developer.apple.com/library/prerelease/ios/documentation/CoreFoundation/Reference/CFRunLoopTimerRef/index.html#//apple_ref/c/func/CFRunLoopTimerSetNextFireDate
564
565         * WebCore.xcodeproj/project.pbxproj:
566         * platform/SharedTimer.h:
567         (WebCore::SharedTimer::invalidate):
568         (WebCore::MainThreadSharedTimer::setFiredFunction): Deleted.
569         (WebCore::MainThreadSharedTimer::setFireInterval): Deleted.
570         (WebCore::MainThreadSharedTimer::stop): Deleted.
571         * platform/ThreadTimers.cpp:
572         (WebCore::ThreadTimers::fireTimersInNestedEventLoop):
573         * platform/cf/SharedTimerCF.mm: Added.
574         (WebCore::applicationDidBecomeActive):
575         (WebCore::setupPowerObserver):
576         (WebCore::setSharedTimerFiredFunction):
577         (WebCore::timerFired):
578         (WebCore::restartSharedTimer):
579         (WebCore::invalidateSharedTimer):
580         (WebCore::setSharedTimerFireInterval):
581         (WebCore::stopSharedTimer):
582         * platform/efl/SharedTimerEfl.cpp:
583         (WebCore::invalidateSharedTimer):
584         * platform/gtk/SharedTimerGtk.cpp:
585         (WebCore::invalidateSharedTimer):
586         * platform/ios/SharedTimerIOS.mm: Removed.
587         * platform/mac/PowerObserverMac.h: Copied from Source/WebCore/platform/efl/SharedTimerEfl.cpp.
588         * platform/mac/PowerObserverMac.mm: Renamed from Source/WebCore/platform/mac/SharedTimerMac.mm.
589         (WebCore::PowerObserver::PowerObserver):
590         (WebCore::PowerObserver::~PowerObserver):
591         (WebCore::PowerObserver::didReceiveSystemPowerNotification):
592         * platform/win/SharedTimerWin.cpp:
593         (WebCore::removeSharedTimer):
594
595 2015-03-17  Tim Horton  <timothy_horton@apple.com>
596
597         Cannot invoke action menus anymore
598         https://bugs.webkit.org/show_bug.cgi?id=142797
599         <rdar://problem/20032670>
600
601         Reviewed by Beth Dakin.
602
603         * platform/spi/mac/NSMenuSPI.h:
604         Add additional NSMenu SPI.
605
606 2015-03-17  Zalan Bujtas  <zalan@apple.com>
607
608         Simple line layout: Split fragments on renderer boundary on the fly.
609         https://bugs.webkit.org/show_bug.cgi?id=142579
610
611         Reviewed by Antti Koivisto.
612
613         Fragment splitting at renderers' boundary at the end of the line is no longer needed.
614         This patch ensures that TextFragmentIterator::nextTextFragment() does not concatenate
615         fragments across renderer boundary.
616
617         Test: fast/text/simple-line-with-multiple-renderers.html
618
619         * rendering/SimpleLineLayout.cpp:
620         (WebCore::SimpleLineLayout::revertRuns):
621         (WebCore::SimpleLineLayout::LineState::isEmpty):
622         (WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded): Check if fragments need a new run and
623         whether neighboring fragments need collapsing.
624         (WebCore::SimpleLineLayout::LineState::revertUncommitted): Revert fragments over multiple renderers if they form
625         a fragment continuation.
626         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
627         (WebCore::SimpleLineLayout::forceFragmentToLine): Ensure that if a fragment has continuation across multiple renderers,
628         they all get added to the current line.
629         (WebCore::SimpleLineLayout::createLineRuns):
630         (WebCore::SimpleLineLayout::LineState::appendFragment): Deleted.
631         (WebCore::SimpleLineLayout::FragmentForwardIterator::FragmentForwardIterator): Deleted.
632         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator++): Deleted.
633         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator!=): Deleted.
634         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator*): Deleted.
635         (WebCore::SimpleLineLayout::begin): Deleted.
636         (WebCore::SimpleLineLayout::end): Deleted.
637         (WebCore::SimpleLineLayout::preWrap): Deleted.
638         (WebCore::SimpleLineLayout::removeTrailingWhitespace): Deleted.
639         (WebCore::SimpleLineLayout::updateLineConstrains): Deleted.
640         (WebCore::SimpleLineLayout::splitRunsAtRendererBoundary): Deleted.
641         (WebCore::SimpleLineLayout::createTextRuns): Deleted.
642         (WebCore::SimpleLineLayout::create): Deleted.
643         (WebCore::SimpleLineLayout::Layout::create): Deleted.
644         * rendering/SimpleLineLayoutFlowContents.h:
645         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator+):
646         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*):
647         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->):
648         * rendering/SimpleLineLayoutFunctions.cpp:
649         (WebCore::SimpleLineLayout::paintFlow): Unrelated fix on non-collapsed tab position.
650         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
651         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragmentIterator):
652         (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
653         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
654         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
655         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
656         * rendering/SimpleLineLayoutTextFragmentIterator.h:
657         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
658         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::overlapsToNextRenderer):
659         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isCollapsible):
660         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::operator==):
661         (WebCore::SimpleLineLayout::TextFragmentIterator::isLineBreak):
662         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split): Deleted.
663
664 2015-03-17  Jeremy Jones  <jeremyj@apple.com>
665
666         When tab hides, pause fullscreen and exit normally.
667         https://bugs.webkit.org/show_bug.cgi?id=142685
668
669         Reviewed by Eric Carlson.
670
671         Pause fullscreen playback when switching tabs. Exit fullscreen is not necessary and even prevents
672         the normal flow of teardown. This allows the normal exit fullscreen call to succeed and call its callback.
673
674         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
675         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
676
677 2015-03-17  Per Arne Vollan  <peavo@outlook.com>
678
679         [WinCairo] Video position is incorrect when located inside a frame.
680         https://bugs.webkit.org/show_bug.cgi?id=142784
681
682         Reviewed by Brent Fulgham.
683
684         We need to take the enclosing frame's position into account, when finding the video position.
685
686         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
687         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
688
689 2015-03-17  Benjamin Poulain  <bpoulain@apple.com>
690
691         Compile character ranges targeting the same state as range check in the bytecode
692         https://bugs.webkit.org/show_bug.cgi?id=142759
693
694         Reviewed by Alex Christensen.
695
696         Previously, character ranges would be compiled as many individual character checks.
697         For example, a transition on "[a-z]" would do 26 character checks + jump, which leads
698         to enormous matchines.
699
700         With this patch, we find the ranges at lowering time and generate a single instruction
701         for them: "CheckValueRange". This helps making the machine denser when the input
702         use character sets.
703
704         The second part of this patch goes further in the case where the transitions out of
705         a state cover the entire alphabet. In that case, we create a fallback transition
706         on the fly and remove all the ranges made useless.
707         That case is common when ranges are used with inverse character set (e.g. [^a]+a).
708
709         * contentextensions/DFABytecode.h:
710         (WebCore::ContentExtensions::instructionSizeWithArguments):
711         * contentextensions/DFABytecodeCompiler.cpp:
712         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValueRange):
713         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
714         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
715         (WebCore::ContentExtensions::DFABytecodeCompiler::compileCheckForRange):
716         * contentextensions/DFABytecodeCompiler.h:
717         Extend the compiler to detect ranges and lower them as CheckValueRange.
718
719         * contentextensions/DFABytecodeInterpreter.cpp:
720         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
721         Range checks in the interpreter.
722
723         * contentextensions/NFA.cpp:
724         (WebCore::ContentExtensions::NFA::setFinal):
725         This assertion does not make sense with the current codebase. Actions are "compressed",
726         it is possible to have two patterns with the same action.
727
728         * contentextensions/NFAToDFA.cpp:
729         (WebCore::ContentExtensions::simplifyTransitions):
730         A very simple DFA optimization function: it only reduce the strength of ranges.
731
732         (WebCore::ContentExtensions::NFAToDFA::convert):
733
734 2015-03-17  Jer Noble  <jer.noble@apple.com>
735
736         REGRESSION (r181423): Crash @ generatedcontent.org at com.apple.WebCore: WebCore::MediaPlayer::maximumDurationToCacheMediaTime const + 4
737         https://bugs.webkit.org/show_bug.cgi?id=142787
738
739         Reviewed by Eric Carlson.
740
741         Null check m_player before derefencing.
742
743         * html/HTMLMediaElement.cpp:
744         (WebCore::HTMLMediaElement::parseAttribute):
745
746 2015-03-17  Beth Dakin  <bdakin@apple.com>
747
748         DOM mouse events have weird timing for force clickable elements in Safari 8.0.3 on 
749         10.10.2
750         https://bugs.webkit.org/show_bug.cgi?id=142700
751         -and corresponding-
752         rdar://problem/20165168
753
754         Reviewed by Tim Horton.
755
756         This patch adds a new enum and member variable so that EventHandler can keep track 
757         of the current immediate action state.
758         * page/EventHandler.cpp:
759         (WebCore::EventHandler::EventHandler):
760
761         A new mouse press even is starting. We can re-set m_immediateActionStage to none 
762         unless a Hit Test has already been performed.
763         (WebCore::EventHandler::handleMousePressEvent):
764
765         If an immediate action was completed, then send mouse to the DOM and return early. 
766         This will prevent us from doing our own normal mouseup behaviors such as 
767         navigating to a link that was clicked — we only want to do that if the click was 
768         not used to perform an immediate action.
769         (WebCore::EventHandler::handleMouseReleaseEvent):
770         * page/EventHandler.h:
771         (WebCore::EventHandler::setImmediateActionStage):
772
773 2015-03-17  Joseph Pecoraro  <pecoraro@apple.com>
774
775         Use a better parameter name for Document.getElementsByClassName
776         https://bugs.webkit.org/show_bug.cgi?id=142771
777
778         Reviewed by Chris Dumez.
779
780         * bindings/objc/PublicDOMInterfaces.h:
781         * dom/Document.idl:
782
783 2015-03-17  Timothy Horton  <timothy_horton@apple.com>
784
785         Reproducible null deref under ScriptedAnimationController::createDisplayRefreshMonitor
786         https://bugs.webkit.org/show_bug.cgi?id=142776
787         <rdar://problem/18921338>
788
789         Reviewed by Alexey Proskuryakov.
790
791         Test: fast/animation/request-animation-frame-unparented-iframe-crash.html
792
793         In some cases (like the new test), we can end up trying to start
794         requestAnimationFrame on a Document that has no Page. Most paths null-checked
795         the Page and did the right thing, but one failed to do so. In addition,
796         the current fallback (when Page is null) can result in us constructing
797         the wrong kind of DisplayRefreshMonitor, which could lead to trouble
798         down the road when it's reused. Instead, just completely avoid making a
799         DisplayRefreshMonitor in the null-page case.
800
801         * dom/ScriptedAnimationController.cpp:
802         (WebCore::ScriptedAnimationController::createDisplayRefreshMonitor):
803         If the page is null, bail.
804
805         * dom/ScriptedAnimationController.h:
806         * platform/graphics/DisplayRefreshMonitor.cpp:
807         (WebCore::DisplayRefreshMonitor::create):
808         Use Optional<> to make it easy to distinguish between ChromeClient
809         being unreachable (because we don't have a Page for some reason) and
810         ChromeClient declaring that it doesn't want to override the type of
811         DisplayRefreshMonitor that is created.
812
813         If ChromeClient was unreachable for some reason, we'll get back an engaged
814         nullptr and return it (instead of creating a DisplayRefreshMonitor based
815         on the platform). This avoids creating the wrong type of DisplayRefreshMonitor
816         in the rare case where we can't reach the ChromeClient (e.g. a freshly unparented
817         IFrame).
818
819         If instead the client returns a disengaged Nullopt, we'll interpret that as
820         "construct the default type", which falls back on the platform #ifdefs to
821         decide what to make.
822
823         * platform/graphics/DisplayRefreshMonitorManager.cpp:
824         (WebCore::DisplayRefreshMonitorManager::ensureMonitorForClient):
825         (WebCore::DisplayRefreshMonitorManager::scheduleAnimation):
826         Silently handle the case where we failed to make a DisplayRefreshMonitor.
827
828         * platform/graphics/DisplayRefreshMonitor.h:
829         * platform/graphics/DisplayRefreshMonitorClient.h:
830         * platform/graphics/GraphicsLayerUpdater.cpp:
831         (WebCore::GraphicsLayerUpdater::createDisplayRefreshMonitor):
832         * platform/graphics/GraphicsLayerUpdater.h:
833         * rendering/RenderLayerCompositor.cpp:
834         (WebCore::RenderLayerCompositor::createDisplayRefreshMonitor):
835         * rendering/RenderLayerCompositor.h:
836         Adjust to the new signature of createDisplayRefreshMonitor, and return
837         an engaged (nullptr) Optional if we can't get to ChromeClient for any reason.
838
839         * page/ChromeClient.h:
840         Return Nullopt (indicating a lack of override) by default.
841
842 2015-03-17  Dean Jackson  <dino@apple.com>
843
844         Implement Scroll Container Animation Triggers
845         https://bugs.webkit.org/show_bug.cgi?id=142732
846
847         Attempt to fix the build.
848
849         * css/CSSComputedStyleDeclaration.cpp: Add an #if ENABLE guard.
850
851 2015-03-17  Dean Jackson  <dino@apple.com>
852
853         Implement Scroll Container Animation Triggers
854         https://bugs.webkit.org/show_bug.cgi?id=142732
855
856         Reviewed by Simon Fraser.
857
858         Test: animations/trigger-container-scroll-simple.html
859
860         Basic implementation of container-scroll. It only checks
861         the page scroll position for trigger values (not the scrolling
862         container in an overflow).
863
864         * css/CSSComputedStyleDeclaration.cpp: Add CSSPropertyWebkitAnimationTrigger
865         so that this property will appear in the inspector.
866
867         * page/FrameView.cpp:
868         (WebCore::FrameView::sendScrollEvent): If the page has scrolled, let the animation
869         controller know about it.
870
871         * page/animation/AnimationBase.cpp:
872         (WebCore::AnimationBase::updateStateMachine): Whitespace fix.
873         (WebCore::AnimationBase::fireAnimationEventsIfNeeded): If there is a trigger,
874         and the scroll position is past it, then tell the state machine that
875         we should start.
876         (WebCore::AnimationBase::timeToNextService): Use the scroll position as
877         an input to the update timer if a trigger is involved.
878
879         * page/animation/AnimationController.cpp:
880         (WebCore::AnimationControllerPrivate::ensureCompositeAnimation): Add whitespace.
881         (WebCore::AnimationControllerPrivate::scrollWasUpdated): Call updateAnimations.
882         (WebCore::AnimationController::scrollWasUpdated): Call into AnimationControllerPrivate.
883         * page/animation/AnimationController.h:
884         * page/animation/AnimationControllerPrivate.h:
885
886         * page/animation/CompositeAnimation.cpp: Keep a record of whether we have a scroll
887         triggered animation.
888         (WebCore::CompositeAnimation::CompositeAnimation):
889         (WebCore::CompositeAnimation::updateKeyframeAnimations):
890         * page/animation/CompositeAnimation.h:
891         (WebCore::CompositeAnimation::hasScrollTriggeredAnimation):
892         * platform/animation/Animation.cpp:
893         (WebCore::Animation::operator=):
894
895 2015-03-17  Simon Fraser  <simon.fraser@apple.com>
896
897         Move some code from LogicalSelectionOffsetCaches into RenderElement
898         https://bugs.webkit.org/show_bug.cgi?id=142758
899
900         Reviewed by Myles C. Maxfield.
901
902         LogicalSelectionOffsetCaches had some useful code regarding containing blocks etc
903         that should be used in more places, so move it into RenderElement.
904         
905         No behavior change.
906
907         * rendering/LogicalSelectionOffsetCaches.h:
908         (WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):
909         (WebCore::isContainingBlockCandidateForAbsolutelyPositionedObject): Deleted.
910         (WebCore::isNonRenderBlockInline): Deleted.
911         (WebCore::containingBlockForFixedPosition): Deleted.
912         (WebCore::containingBlockForAbsolutePosition): Deleted.
913         (WebCore::containingBlockForObjectInFlow): Deleted.
914         * rendering/RenderBlock.cpp: No need to initialize static data.
915         (WebCore::RenderBlock::positionedObjects): nullptr
916         * rendering/RenderElement.cpp:
917         (WebCore::RenderElement::containingBlockForFixedPosition):
918         (WebCore::RenderElement::containingBlockForAbsolutePosition):
919         (WebCore::isNonRenderBlockInline):
920         (WebCore::RenderElement::containingBlockForObjectInFlow):
921         * rendering/RenderElement.h:
922         (WebCore::RenderElement::canContainAbsolutelyPositionedObjects):
923         * rendering/RenderLayer.cpp:
924         (WebCore::isContainerForPositioned):
925         * rendering/RenderObject.cpp:
926         (WebCore::RenderObject::containingBlock):
927
928 2015-03-17  Alex Christensen  <achristensen@webkit.org>
929
930         [WinCairo] Unreviewed build fix after r181640.
931
932         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
933         Tell Windows how to find ShaderLang.h.
934
935 2015-03-17  Chris Dumez  <cdumez@apple.com>
936
937         'pageLoaded' diagnostic logging is too verbose
938         https://bugs.webkit.org/show_bug.cgi?id=142727
939         <rdar://problem/18937048>
940
941         Reviewed by Eric Carlson.
942
943         Make 'pageLoaded' diagnostic logging less verbose:
944         - Log once per main frame instead of once for subframe
945         - Apply sampling
946
947         * loader/FrameLoader.cpp:
948         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
949
950 2015-03-17  Carlos Garcia Campos  <cgarcia@igalia.com>
951
952         [GTK] Wrong transfer annotations used in GObject DOM bindings
953         https://bugs.webkit.org/show_bug.cgi?id=142780
954
955         Reviewed by Gustavo Noronha Silva.
956
957         We are using transfer none for all methods returning a GObject DOM
958         Object. That's not true. Only objects derived from Node are
959         automatically released by the DOM object cache and can be transfer
960         none. All other objects are added to the cache only to avoid
961         creating the same wrapper twice for the same core object, but
962         caller should release the returned reference.
963
964         * bindings/gobject/WebKitDOMCustomUnstable.h:
965         * bindings/scripts/CodeGeneratorGObject.pm:
966         (GetTransferTypeForReturnType):
967         (GenerateFunction):
968
969 2015-03-17  Carlos Garcia Campos  <cgarcia@igalia.com>
970
971         [GTK] WebKitDOM objects leaking
972         https://bugs.webkit.org/show_bug.cgi?id=118788
973
974         Reviewed by Darin Adler and Sergio Villar Senin.
975
976         Use a DOMwindowObserver class, derived from DOMWindowProperty to
977         be notified when the window object is detached from the frame to
978         clear the DOM objects associated to that frame in that case too.
979
980         * bindings/gobject/DOMObjectCache.cpp:
981
982 2015-03-17  Zan Dobersek  <zdobersek@igalia.com>
983
984         [CMake] Use a forwarding header for ANGLE's ShaderLang.h to avoid picking up ANGLE's EGL headers
985         https://bugs.webkit.org/show_bug.cgi?id=142530
986
987         Reviewed by Darin Adler.
988
989         Include the ANGLE's ShaderLang.h through the new forwarding header. This allows
990         us to not list Source/ThirdParty/ANGLE/include in the list of inclusion directories
991         and thus avoid ANGLE's EGL and GLES2/GLES3 headers, defaulting to the system-provided
992         headers instead.
993
994         Source/ThirdParty/ANGLE/include/KHR is still used because ANGLE's khrplatform.h is
995         required by the ShaderLang.h header. Source/ThirdParty/ANGLE/src is not used for the
996         whole WebCore library anymore, only the ANGLESupport library.
997
998         * CMakeLists.txt:
999         * platform/graphics/ANGLEWebKitBridge.h:
1000         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
1001
1002 2015-03-17  Matt Baker  <mattbaker@apple.com>
1003
1004         Web Inspector: Show rendering frames (and FPS) in Layout and Rendering timeline
1005         https://bugs.webkit.org/show_bug.cgi?id=142029
1006
1007         Reviewed by Timothy Hatcher.
1008
1009         Add new functionality to the Inspector timelines backend to add runloop data to timeline recordings.
1010
1011         * inspector/InspectorTimelineAgent.cpp:
1012         (WebCore::currentRunLoop):
1013         (WebCore::InspectorTimelineAgent::internalStart):
1014         (WebCore::InspectorTimelineAgent::internalStop):
1015         (WebCore::toProtocol):
1016         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
1017         Install observers for the begining and end of the runloop when recording begins. All other
1018         instrumented timeline events get added as children of the current runloop record, which is
1019         sent to the frontend once the runloop completes.
1020
1021         * inspector/InspectorTimelineAgent.h:
1022
1023         * platform/cf/RunLoopObserver.cpp:
1024         (WebCore::RunLoopObserver::schedule):
1025         Wrapper changed to allow observing arbitrary runloop activities.
1026
1027         * platform/cf/RunLoopObserver.h:
1028
1029 2015-03-17  Philippe Normand  <pnormand@igalia.com>
1030
1031         [GTK] basic OpenWebRTC build support
1032         https://bugs.webkit.org/show_bug.cgi?id=142393
1033
1034         Reviewed by Carlos Garcia Campos.
1035
1036         * PlatformGTK.cmake: Add OpenWebRTC CFLAGS and LDFLAGS.
1037
1038 2015-03-17  Joseph Pecoraro  <pecoraro@apple.com>
1039
1040         Remove never used "useLayerOnTop" bindings generator argument
1041         https://bugs.webkit.org/show_bug.cgi?id=142773
1042
1043         Reviewed by Darin Adler.
1044
1045         * bindings/scripts/CodeGenerator.pm:
1046         * bindings/scripts/CodeGeneratorJS.pm:
1047         * bindings/scripts/CodeGeneratorObjC.pm:
1048         * bindings/scripts/generate-bindings.pl:
1049
1050 2015-03-16  Ryosuke Niwa  <rniwa@webkit.org>
1051
1052         Enable ES6 classes by default
1053         https://bugs.webkit.org/show_bug.cgi?id=142774
1054
1055         Reviewed by Gavin Barraclough.
1056
1057         * Configurations/FeatureDefines.xcconfig:
1058
1059 2015-03-16  Simon Fraser  <simon.fraser@apple.com>
1060
1061         Update the debug overlays after layout
1062         https://bugs.webkit.org/show_bug.cgi?id=142768
1063
1064         Reviewed by Zalan Bujtas.
1065
1066         The debug overlays need to be updated after layout, in case elements with wheel event handlers
1067         moved around.
1068         
1069         DebugPageOverlays::didLayout() is cheap if there are no overlays.
1070         
1071         Call DebugPageOverlays::didLayout() for all frames, not just the main frame, since subframes can contribute
1072         to the main frame's event handler region.
1073
1074         * page/DebugPageOverlays.cpp:
1075         (WebCore::DebugPageOverlays::regionChanged):
1076         * page/DebugPageOverlays.h:
1077         (WebCore::DebugPageOverlays::didLayout):
1078         (WebCore::DebugPageOverlays::didChangeEventHandlers):
1079         * page/FrameView.cpp:
1080         (WebCore::FrameView::layout):
1081
1082 2015-03-16  Jon Lee  <jonlee@apple.com>
1083
1084         Unreviewed fix for crash after r181608.
1085
1086         * WebCore.xcodeproj/project.pbxproj: Include it in the WebCore framework.
1087
1088 2015-03-16  Simon Fraser  <simon.fraser@apple.com>
1089
1090         Generalize the Document code that maintains a set of nodes with event handlers
1091         https://bugs.webkit.org/show_bug.cgi?id=142762
1092
1093         Reviewed by Zalan Bujtas, Darin Adler.
1094
1095         Document.h defines a TouchEventTargetSet type, which will in future be used for
1096         other event types too (wheel events), so rename it to EventTargetSet.
1097         
1098         Take didRemoveEventTargetNode() outside the TOUCH_EVENTS #ifdef, and change it
1099         to take a reference.
1100
1101         * dom/Document.cpp:
1102         (WebCore::Document::prepareForDestruction): References
1103         (WebCore::Document::didAddTouchEventHandler): Ditto.
1104         (WebCore::Document::didRemoveEventTargetNode): Ditto.
1105         * dom/Document.h:
1106         (WebCore::Document::touchEventTargets): No-one calls this; just remove the non
1107         #ideffed one.
1108         * html/HTMLInputElement.cpp:
1109         (WebCore::HTMLInputElement::~HTMLInputElement): Pass a ref.
1110         (WebCore::HTMLInputElement::didMoveToNewDocument): Pass a ref.
1111         * page/DOMWindow.cpp:
1112         (WebCore::DOMWindow::removeAllEventListeners): Pass a ref.
1113
1114 2015-03-16  Joseph Pecoraro  <pecoraro@apple.com>
1115
1116         Web Inspector: Object Previews in Indexed DB tables
1117         https://bugs.webkit.org/show_bug.cgi?id=140813
1118
1119         Reviewed by Timothy Hatcher.
1120
1121         * inspector/InspectorIndexedDBAgent.cpp:
1122         Include previews with object store objects.
1123
1124 2015-03-16  Jer Noble  <jer.noble@apple.com>
1125
1126         [Mac] Update missing image UI
1127         https://bugs.webkit.org/show_bug.cgi?id=142592
1128
1129         Reviewed by Darin Adler.
1130
1131         Update the broken image glyphs with new art (including a 3x image).
1132
1133         Test: fast/hidpi/broken-image-icon-very-hidpi.html
1134
1135         * Resources/missingImage.png:
1136         * Resources/missingImage@2x.png:
1137         * Resources/missingImage@3x.png: Added.
1138         * WebCore.xcodeproj/project.pbxproj:
1139         * loader/cache/CachedImage.cpp:
1140         (WebCore::CachedImage::brokenImage):
1141
1142 2015-03-16  Dean Jackson  <dino@apple.com>
1143
1144         Parsing and Style Resolution of Container-based Animation Triggers
1145         https://bugs.webkit.org/show_bug.cgi?id=142687
1146         <rdar://problem/20170007>
1147
1148         Reviewed by Simon Fraser.
1149
1150         Take 2 after the previous patch was rolled out.
1151
1152         This is the beginning of a prototype implementation of
1153         CSS Animation Triggers, as described by
1154         https://lists.w3.org/Archives/Public/www-style/2014Sep/0135.html
1155
1156         In this patch we parse and resolve the value of a new
1157         CSS property "-webkit-animation-trigger". At the moment it
1158         only accepts one function value "container-scroll", which
1159         will trigger the animation at an absolute position within
1160         an element's scrolling container. We expect the syntax to
1161         change in the near future, as the spec is written.
1162
1163         Tests: animations/trigger-computed-style.html
1164                animations/trigger-parsing.html
1165
1166         * WebCore.xcodeproj/project.pbxproj: Add the new files.
1167
1168         * css/CSSAnimationTriggerScrollValue.cpp: Added.
1169         (WebCore::CSSAnimationTriggerScrollValue::customCSSText): Output text for computed style.
1170         (WebCore::CSSAnimationTriggerScrollValue::equals): Compare two values.
1171         * css/CSSAnimationTriggerScrollValue.h: Added. This holds the CSS side of the
1172         scroll trigger. This name may change in the future to better represent the
1173         type of trigger, but it is good enough for now.
1174         (WebCore::CSSAnimationTriggerScrollValue::create):
1175         (WebCore::CSSAnimationTriggerScrollValue::startValue):
1176         (WebCore::CSSAnimationTriggerScrollValue::endValue):
1177         (WebCore::CSSAnimationTriggerScrollValue::CSSAnimationTriggerScrollValue):
1178
1179         * css/CSSComputedStyleDeclaration.cpp:
1180         (WebCore::createAnimationTriggerValue): Maps an AnimationTrigger into a CSSValue.
1181         (WebCore::getAnimationTriggerValue): Gets the current computed style.
1182         (WebCore::ComputedStyleExtractor::propertyValue):
1183
1184         * css/CSSParser.cpp:
1185         (WebCore::CSSParser::parseValue):
1186         (WebCore::CSSParser::parseAnimationTrigger): Parse the "container-scroll" function
1187         and record the value as a CSSAnimationTriggerScrollValue.
1188         (WebCore::CSSParser::parseAnimationProperty): Handle the new property.
1189         * css/CSSParser.h:
1190
1191         * css/CSSPropertyNames.in: Add "-webkit-animation-trigger".
1192
1193         * css/CSSToStyleMap.cpp:
1194         (WebCore::CSSToStyleMap::mapAnimationTrigger): Map a CSSValue into a trigger value on
1195         an Animation object.
1196         * css/CSSToStyleMap.h:
1197
1198         * css/CSSValue.cpp: Handle the new CSSValue type.
1199         (WebCore::CSSValue::equals):
1200         (WebCore::CSSValue::cssText):
1201         (WebCore::CSSValue::destroy):
1202         * css/CSSValue.h:
1203         (WebCore::CSSValue::isAnimationTriggerScrollValue):
1204
1205         * platform/animation/Animation.cpp: Make sure to initialise m_trigger and m_triggerSet,
1206         and use them in the operator==.
1207         * platform/animation/Animation.h: Add AnimationTrigger as a new field.
1208         (WebCore::Animation::isTriggerSet):
1209         (WebCore::Animation::isEmpty):
1210
1211         * platform/animation/AnimationTrigger.h: Added. New base class and subclasses for
1212         "auto" and the scrolling trigger.
1213         (WebCore::AnimationTrigger::~AnimationTrigger):
1214         (WebCore::AnimationTrigger::type):
1215         (WebCore::AnimationTrigger::isAutoAnimationTrigger):
1216         (WebCore::AnimationTrigger::isScrollAnimationTrigger):
1217         (WebCore::AnimationTrigger::AnimationTrigger):
1218         (WebCore::AutoAnimationTrigger::create):
1219         (WebCore::AutoAnimationTrigger::~AutoAnimationTrigger):
1220         (WebCore::AutoAnimationTrigger::AutoAnimationTrigger):
1221         (WebCore::ScrollAnimationTrigger::create):
1222         (WebCore::ScrollAnimationTrigger::~ScrollAnimationTrigger):
1223         (WebCore::ScrollAnimationTrigger::startValue):
1224         (WebCore::ScrollAnimationTrigger::setStartValue):
1225         (WebCore::ScrollAnimationTrigger::endValue):
1226         (WebCore::ScrollAnimationTrigger::setEndValue):
1227         (WebCore::ScrollAnimationTrigger::hasEndValue):
1228         (WebCore::ScrollAnimationTrigger::setHasEndValue):
1229         (WebCore::ScrollAnimationTrigger::ScrollAnimationTrigger):
1230
1231 2015-03-16  Alex Christensen  <achristensen@webkit.org>
1232
1233         Progress towards CMake on Mac
1234         https://bugs.webkit.org/show_bug.cgi?id=142747
1235
1236         Reviewed by Chris Dumez.
1237
1238         * CMakeLists.txt:
1239         * PlatformMac.cmake:
1240         Added more directories, interfaces, and forwarding headers.
1241         Temporarily disabled the generating of ObjC bindings in CMake builds.
1242         * platform/mac/PasteboardMac.mm:
1243         Removed unused include.
1244
1245 2015-03-16  Joanmarie Diggs  <jdiggs@igalia.com>
1246
1247         AX: Crash viewing http://www.last.fm/
1248         https://bugs.webkit.org/show_bug.cgi?id=142309
1249
1250         Reviewed by Chris Fleizach.
1251
1252         The crash occurs when a not-yet-rendered object emits a children-changed
1253         signal. If an assistive technology is listening, AT-SPI2 will attempt to
1254         create and cache the state set for the child being added and the creation
1255         of the state set assumes a rendered object.
1256
1257         Test: platform/gtk/accessibility/no-notification-for-unrendered-iframe-children.html
1258
1259         * accessibility/atk/AXObjectCacheAtk.cpp:
1260         (WebCore::AXObjectCache::attachWrapper):
1261
1262 2015-03-16  Commit Queue  <commit-queue@webkit.org>
1263
1264         Unreviewed, rolling out r181492.
1265         https://bugs.webkit.org/show_bug.cgi?id=142756
1266
1267         May have regressed PLT (Requested by anttik on #webkit).
1268
1269         Reverted changeset:
1270
1271         "Cache glyph widths to GlyphPages"
1272         https://bugs.webkit.org/show_bug.cgi?id=142028
1273         http://trac.webkit.org/changeset/181492
1274
1275 2015-03-16  Roger Fong  <roger_fong@apple.com>
1276
1277         [WebGL2] Instancing draw calls.
1278         https://bugs.webkit.org/show_bug.cgi?id=126939.
1279         <rdar://problem/15002379>
1280
1281         Reviewed by Dean Jackson.
1282
1283         Tested by a modified version of the 1.0.3 conformance tests:
1284         conformance/extensions/angle-instanced-arrays.html
1285         conformance/extensions/angle-instanced-arrays-out-of-bounds.html
1286
1287         These tests will be landed along with other modified extension conformance tests
1288         once approval from Khronos is received.
1289
1290         * html/canvas/WebGL2RenderingContext.cpp:
1291         (WebCore::WebGL2RenderingContext::clear): Generate error if clearing an integer color buffer.
1292         (WebCore::WebGL2RenderingContext::vertexAttribDivisor): Call method from base class.
1293         (WebCore::WebGL2RenderingContext::drawArraysInstanced): Ditto.
1294         (WebCore::WebGL2RenderingContext::drawElementsInstanced): Ditto.
1295         (WebCore::WebGL2RenderingContext::isIntegerFormat): Ditto.
1296         (WebCore::WebGL2RenderingContext::validateDrawElements): Deleted. Move back to base class.
1297         * html/canvas/WebGL2RenderingContext.h:
1298         * html/canvas/WebGL2RenderingContext.idl: Add a missing enum.
1299         * html/canvas/WebGLRenderingContext.cpp:
1300         (WebCore::WebGLRenderingContext::clear): Copied from WebGLRenderingContextBase.
1301         (WebCore::WebGLRenderingContext::validateDrawElements): Deleted. Move back to base class.
1302         * html/canvas/WebGLRenderingContext.h:
1303         * html/canvas/WebGLRenderingContextBase.cpp: 
1304         (WebCore::WebGLRenderingContextBase::clear): Deleted. Moved to WebGLRenderingContext.
1305         (WebCore::WebGLRenderingContextBase::getVertexAttrib): Check for WebGL2 context.
1306         (WebCore::WebGLRenderingContext::validateDrawElements): Ditto.
1307         * html/canvas/WebGLRenderingContextBase.h:
1308
1309 2015-03-16  Commit Queue  <commit-queue@webkit.org>
1310
1311         Unreviewed, rolling out r181572.
1312         https://bugs.webkit.org/show_bug.cgi?id=142755
1313
1314         Caused weird test failures in transitions and animations
1315         (Requested by dino on #webkit).
1316
1317         Reverted changeset:
1318
1319         "Parsing and Style Resolution of Container-based Animation
1320         Triggers"
1321         https://bugs.webkit.org/show_bug.cgi?id=142687
1322         http://trac.webkit.org/changeset/181572
1323
1324 2015-03-16  Yoav Weiss  <yoav@yoav.ws>
1325
1326         Remove setCachedImage from HTMLImageElement since it is not used
1327         https://bugs.webkit.org/show_bug.cgi?id=142740
1328
1329         Reviewed by Chris Dumez.
1330
1331         No new tests since this patch is just removing dead code.
1332
1333         HTMLImageElement::setCachedImage is not being called by anyone.
1334         This patch removes it, since it's dead code.
1335
1336         * html/HTMLImageElement.h:
1337         (WebCore::HTMLImageElement::setCachedImage): Deleted.
1338
1339 2015-03-16  Brent Fulgham  <bfulgham@apple.com>
1340
1341         WebKit1 Clients Are Not Reliably Repainted
1342         https://bugs.webkit.org/show_bug.cgi?id=142750
1343         <rdar://problem/20042453>
1344
1345         Reviewed by Simon Fraser.
1346
1347         * page/FrameView.cpp:
1348         (WebCore::FrameView::paintContents): Move "Red Rect" debug painting before
1349         the early return so we can see when this happening in debug builds.
1350         * page/FrameView.h:
1351         (WebCore::FrameView::inPaintableState): Added.
1352
1353 2015-03-16  Chris Dumez  <cdumez@apple.com>
1354
1355         Make DatabaseContext suspendable if there is no pending database activity
1356         https://bugs.webkit.org/show_bug.cgi?id=142716
1357         <rdar://problem/19923085>
1358
1359         Reviewed by Andreas Kling.
1360
1361         Make DatabaseContext suspendable if there is no pending database
1362         activity, i.e:
1363         - No pending Database creation JS callback
1364         - No pending transaction(s)
1365
1366         Suspending is safe in this case because we are not going to interrupt
1367         any database activity, nor fire any JS event.
1368
1369         This greatly increases the likelihood of pages using websql to enter
1370         the PageCache.
1371
1372         Tests: fast/history/page-cache-webdatabase-no-transaction-db.html
1373                fast/history/page-cache-webdatabase-pending-transaction.html
1374
1375         * Modules/webdatabase/Database.cpp:
1376         (WebCore::Database::hasPendingTransaction):
1377         * Modules/webdatabase/Database.h:
1378         * Modules/webdatabase/DatabaseContext.cpp:
1379         (WebCore::DatabaseContext::canSuspend):
1380         * Modules/webdatabase/DatabaseManager.cpp:
1381         (WebCore::DatabaseManager::openDatabase):
1382         * Modules/webdatabase/DatabaseThread.cpp:
1383         (WebCore::DatabaseThread::hasPendingDatabaseActivity):
1384         * Modules/webdatabase/DatabaseThread.h:
1385
1386 2015-03-16  Brady Eidson  <beidson@apple.com>
1387
1388         Addressing additional review feedback after http://trac.webkit.org/changeset/181565
1389         https://bugs.webkit.org/show_bug.cgi?id=142733
1390
1391         Reviewed by Darin Adler.
1392
1393         * loader/icon/IconController.cpp:
1394         (WebCore::IconController::startLoader): Null check page()
1395
1396 2015-03-16  Roger Fong  <roger_fong@apple.com>
1397
1398         [Win] Unreviewed build fix attempt after r181571.
1399
1400         * WebCore.vcxproj/WebCore.vcxproj:
1401
1402 2015-03-16  Roger Fong  <roger_fong@apple.com>
1403
1404         [WebGL2] Multiple Render Targets.
1405         https://bugs.webkit.org/show_bug.cgi?id=126994.
1406         <rdar://problem/15815766>
1407
1408         Reviewed by Dean Jackson.
1409
1410         Tested by a modified version of the 1.0.3 conformance test:
1411         conformance/extensions/webgl-draw-buffers.html
1412         This test will be landed along with other modified extension conformance tests
1413         once approval from Khronos is received.
1414
1415         * html/canvas/WebGL2RenderingContext.cpp:
1416         (WebCore::WebGL2RenderingContext::drawBuffers): Mostly the same as WebGLDrawBuffers::drawBuffersWEBGL.
1417         Returns different error messages, uses non EXT enums.
1418         (WebCore::WebGL2RenderingContext::clearBufferiv): This actually does nothing for now but the validation has been implemented.
1419         (WebCore::WebGL2RenderingContext::clearBufferuiv): Ditto.
1420         (WebCore::WebGL2RenderingContext::clearBufferfv): Ditto.
1421         (WebCore::WebGL2RenderingContext::clearBufferfi): Ditto.
1422         (WebCore::WebGL2RenderingContext::validateFramebufferFuncParameters): Removes the extension object check.
1423         (WebCore::WebGL2RenderingContext::getMaxDrawBuffers):
1424         (WebCore::WebGL2RenderingContext::getMaxColorAttachments): Must return the same thing as getMaxDrawBuffers.
1425         (WebCore::WebGL2RenderingContext::getParameter): Remove extension object checks.
1426         * html/canvas/WebGL2RenderingContext.h:
1427         * html/canvas/WebGLFramebuffer.cpp:
1428         (WebCore::WebGLFramebuffer::drawBuffersIfNecessary):
1429         * html/canvas/WebGLRenderingContext.cpp:
1430         (WebCore::WebGLRenderingContext::validateFramebufferFuncParameters): Copied from WebGLRenderingContextBase.
1431         (WebCore::WebGLRenderingContext::getMaxDrawBuffers): Ditto.
1432         (WebCore::WebGLRenderingContext::getMaxColorAttachments): Ditto.
1433         * html/canvas/WebGLRenderingContext.h:
1434         * html/canvas/WebGLRenderingContextBase.cpp:
1435         (WebCore::WebGLRenderingContextBase::validateFramebufferFuncParameters): Deleted.
1436         * html/canvas/WebGLRenderingContextBase.h:
1437
1438 2015-03-16  Dean Jackson  <dino@apple.com>
1439
1440         Parsing and Style Resolution of Container-based Animation Triggers
1441         https://bugs.webkit.org/show_bug.cgi?id=142687
1442         <rdar://problem/20170007>
1443
1444         Reviewed by Simon Fraser.
1445
1446         This is the beginning of a prototype implementation of
1447         CSS Animation Triggers, as described by
1448         https://lists.w3.org/Archives/Public/www-style/2014Sep/0135.html
1449
1450         In this patch we parse and resolve the value of a new
1451         CSS property "-webkit-animation-trigger". At the moment it
1452         only accepts one function value "container-scroll", which
1453         will trigger the animation at an absolute position within
1454         an element's scrolling container. We expect the syntax to
1455         change in the near future, as the spec is written.
1456
1457         Tests: animations/trigger-computed-style.html
1458                animations/trigger-parsing.html
1459
1460         * WebCore.xcodeproj/project.pbxproj: Add the new files.
1461
1462         * css/CSSAnimationTriggerScrollValue.cpp: Added.
1463         (WebCore::CSSAnimationTriggerScrollValue::customCSSText): Output text for computed style.
1464         (WebCore::CSSAnimationTriggerScrollValue::equals): Compare two values.
1465         * css/CSSAnimationTriggerScrollValue.h: Added. This holds the CSS side of the
1466         scroll trigger. This name may change in the future to better represent the
1467         type of trigger, but it is good enough for now.
1468         (WebCore::CSSAnimationTriggerScrollValue::create):
1469         (WebCore::CSSAnimationTriggerScrollValue::startValue):
1470         (WebCore::CSSAnimationTriggerScrollValue::endValue):
1471         (WebCore::CSSAnimationTriggerScrollValue::CSSAnimationTriggerScrollValue):
1472
1473         * css/CSSComputedStyleDeclaration.cpp:
1474         (WebCore::createAnimationTriggerValue): Maps an AnimationTrigger into a CSSValue.
1475         (WebCore::getAnimationTriggerValue): Gets the current computed style.
1476         (WebCore::ComputedStyleExtractor::propertyValue):
1477
1478         * css/CSSParser.cpp:
1479         (WebCore::CSSParser::parseValue):
1480         (WebCore::CSSParser::parseAnimationTrigger): Parse the "container-scroll" function
1481         and record the value as a CSSAnimationTriggerScrollValue.
1482         (WebCore::CSSParser::parseAnimationProperty): Handle the new property.
1483         * css/CSSParser.h:
1484
1485         * css/CSSPropertyNames.in: Add "-webkit-animation-trigger".
1486
1487         * css/CSSToStyleMap.cpp:
1488         (WebCore::CSSToStyleMap::mapAnimationTrigger): Map a CSSValue into a trigger value on
1489         an Animation object.
1490         * css/CSSToStyleMap.h:
1491
1492         * css/CSSValue.cpp: Handle the new CSSValue type.
1493         (WebCore::CSSValue::equals):
1494         (WebCore::CSSValue::cssText):
1495         (WebCore::CSSValue::destroy):
1496         * css/CSSValue.h:
1497         (WebCore::CSSValue::isAnimationTriggerScrollValue):
1498
1499         * platform/animation/Animation.h: Add AnimationTrigger as a new field.
1500         (WebCore::Animation::isTriggerSet):
1501         (WebCore::Animation::isEmpty):
1502
1503         * platform/animation/AnimationTrigger.h: Added. New base class and subclasses for
1504         "auto" and the scrolling trigger.
1505         (WebCore::AnimationTrigger::~AnimationTrigger):
1506         (WebCore::AnimationTrigger::type):
1507         (WebCore::AnimationTrigger::isAutoAnimationTrigger):
1508         (WebCore::AnimationTrigger::isScrollAnimationTrigger):
1509         (WebCore::AnimationTrigger::AnimationTrigger):
1510         (WebCore::AutoAnimationTrigger::create):
1511         (WebCore::AutoAnimationTrigger::~AutoAnimationTrigger):
1512         (WebCore::AutoAnimationTrigger::AutoAnimationTrigger):
1513         (WebCore::ScrollAnimationTrigger::create):
1514         (WebCore::ScrollAnimationTrigger::~ScrollAnimationTrigger):
1515         (WebCore::ScrollAnimationTrigger::startValue):
1516         (WebCore::ScrollAnimationTrigger::setStartValue):
1517         (WebCore::ScrollAnimationTrigger::endValue):
1518         (WebCore::ScrollAnimationTrigger::setEndValue):
1519         (WebCore::ScrollAnimationTrigger::hasEndValue):
1520         (WebCore::ScrollAnimationTrigger::setHasEndValue):
1521         (WebCore::ScrollAnimationTrigger::ScrollAnimationTrigger):
1522
1523 2015-03-15  Roger Fong  <roger_fong@apple.com>
1524
1525         [WebGL2] Vertex Array Objects.
1526         https://bugs.webkit.org/show_bug.cgi?id=126944.
1527         <rdar://problem/15002455>
1528
1529         Reviewed by Dean Jackson.
1530
1531         Tested by a modified version of the 1.0.3 conformance test:
1532         conformance/extensions/oes-vertex-array-object.html
1533         This test will be landed along with other modified extension conformance tests
1534         once approval from Khronos is received.
1535
1536         * html/canvas/OESVertexArrayObject.cpp: Associate extension calls only with WebGLRenderingContext.
1537         (WebCore::OESVertexArrayObject::deleteVertexArrayOES):
1538         (WebCore::OESVertexArrayObject::bindVertexArrayOES):
1539         * html/canvas/WebGLRenderingContext.cpp:
1540         (WebCore::WebGLRenderingContext::initializeVertexArrayObjects):
1541         (WebCore::WebGLRenderingContext::getParameter):
1542         * html/canvas/WebGL2RenderingContext.cpp: Implement vertex array object calls as part WebGL2 context.
1543         (WebCore::WebGL2RenderingContext::createVertexArray):
1544         (WebCore::WebGL2RenderingContext::deleteVertexArray):
1545         (WebCore::WebGL2RenderingContext::isVertexArray):
1546         (WebCore::WebGL2RenderingContext::bindVertexArray):
1547         (WebCore::WebGL2RenderingContext::initializeVertexArrayObjects):
1548         (WebCore::WebGL2RenderingContext::getParameter):
1549
1550         Duplicate extension object vertex array object extension methods in GraphicsContext3D.
1551         Implementation may change after we upgrade to newer GL headers and profile.
1552         * platform/graphics/GraphicsContext3D.h:
1553         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1554         (WebCore::GraphicsContext3D::createVertexArray):
1555         (WebCore::GraphicsContext3D::deleteVertexArray):
1556         (WebCore::GraphicsContext3D::isVertexArray):
1557         (WebCore::GraphicsContext3D::bindVertexArray):
1558
1559         Have WebGLVertexArrayObjectOES and WebGLVertexArrayObject inherit from WebGLRenderingContextBase.
1560         * CMakeLists.txt:
1561         * WebCore.xcodeproj/project.pbxproj:
1562         * html/canvas/WebGLVertexArrayObject.cpp:
1563         (WebCore::WebGLVertexArrayObject::create):
1564         (WebCore::WebGLVertexArrayObject::WebGLVertexArrayObject): Use GraphicsContext3D implementation of createVertexArray.
1565         (WebCore::WebGLVertexArrayObject::deleteObjectImpl):
1566         * html/canvas/WebGLVertexArrayObject.h:
1567         * html/canvas/WebGLVertexArrayObjectBase.cpp: Added.
1568         (WebCore::WebGLVertexArrayObjectBase::WebGLVertexArrayObjectBase):
1569         (WebCore::WebGLVertexArrayObjectBase::setElementArrayBuffer):
1570         (WebCore::WebGLVertexArrayObjectBase::setVertexAttribState):
1571         (WebCore::WebGLVertexArrayObjectBase::unbindBuffer):
1572         (WebCore::WebGLVertexArrayObjectBase::setVertexAttribDivisor):
1573         * html/canvas/WebGLVertexArrayObjectBase.h: Added.
1574         (WebCore::WebGLVertexArrayObjectBase::~WebGLVertexArrayObjectBase):
1575         (WebCore::WebGLVertexArrayObjectBase::VertexAttribState::VertexAttribState):
1576         (WebCore::WebGLVertexArrayObjectBase::VertexAttribState::isBound):
1577         (WebCore::WebGLVertexArrayObjectBase::VertexAttribState::validateBinding):
1578         (WebCore::WebGLVertexArrayObjectBase::isDefaultObject):
1579         (WebCore::WebGLVertexArrayObjectBase::hasEverBeenBound):
1580         (WebCore::WebGLVertexArrayObjectBase::setHasEverBeenBound):
1581         (WebCore::WebGLVertexArrayObjectBase::getElementArrayBuffer):
1582         (WebCore::WebGLVertexArrayObjectBase::getVertexAttribState):
1583         * html/canvas/WebGLVertexArrayObjectOES.cpp:
1584         (WebCore::WebGLVertexArrayObjectOES::WebGLVertexArrayObjectOES):
1585         (WebCore::WebGLVertexArrayObjectOES::deleteObjectImpl):
1586         (WebCore::WebGLVertexArrayObjectOES::setElementArrayBuffer): Deleted.
1587         (WebCore::WebGLVertexArrayObjectOES::setVertexAttribState): Deleted.
1588         (WebCore::WebGLVertexArrayObjectOES::unbindBuffer): Deleted.
1589         (WebCore::WebGLVertexArrayObjectOES::setVertexAttribDivisor): Deleted.
1590         * html/canvas/WebGLVertexArrayObjectOES.h:
1591
1592         * html/canvas/WebGLRenderingContextBase.cpp: Use WebGLVertexArrayObjectBase class.
1593         (WebCore::WebGLRenderingContextBase::initializeNewContext):
1594         (WebCore::WebGLRenderingContextBase::disableVertexAttribArray):
1595         (WebCore::WebGLRenderingContextBase::validateVertexAttributes):
1596         (WebCore::WebGLRenderingContextBase::enableVertexAttribArray):
1597         (WebCore::WebGLRenderingContextBase::getVertexAttrib):
1598         (WebCore::WebGLRenderingContextBase::initVertexAttrib0):
1599         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0):
1600         (WebCore::WebGLRenderingContextBase::restoreStatesAfterVertexAttrib0Simulation):
1601         * html/canvas/WebGLRenderingContextBase.h:
1602         (WebCore::WebGLRenderingContextBase::setBoundVertexArrayObject):
1603
1604         Handle construction of WebGLGetInfo using WebGLVertexArrayObject.
1605         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
1606         (WebCore::toJS):
1607         * html/canvas/WebGLGetInfo.cpp:
1608         (WebCore::WebGLGetInfo::WebGLGetInfo):
1609         (WebCore::WebGLGetInfo::getWebGLVertexArrayObjectOES):
1610         (WebCore::WebGLGetInfo::getWebGLVertexArrayObject):
1611         * html/canvas/WebGLGetInfo.h:
1612
1613 2015-03-16  Brent Fulgham  <bfulgham@apple.com>
1614
1615         Potentially uninitialized Inspector values
1616         https://bugs.webkit.org/show_bug.cgi?id=142730
1617
1618         Reviewed by Joseph Pecoraro.
1619
1620         * inspector/InspectorDOMAgent.cpp:
1621         (WebCore::parseColor): Make sure color values are given an initial value.
1622
1623 2015-03-16  Brady Eidson  <beidson@apple.com>
1624
1625         URLs visited during private browsing show up in WebpageIcons.db
1626         rdar://problem/11254910 and https://bugs.webkit.org/show_bug.cgi?id=142733
1627
1628         Patch by Sam Weinig. Reviewed by Brady Eidson.
1629
1630         * loader/icon/IconController.cpp:
1631         (WebCore::IconController::startLoader): Bail early here if the page is using an ephemeral session.
1632         (WebCore::IconController::continueLoadWithDecision): Instead of here.
1633
1634 2015-03-16  Conrad Shultz  <conrad_shultz@apple.com>
1635
1636         Allow clients to selectively disable plug-ins
1637         https://bugs.webkit.org/show_bug.cgi?id=142506
1638
1639         Reviewed by Anders Carlsson.
1640
1641         Add new functionality allow clients to declaratively disable individual plug-ins (in a manner that conceals them
1642         from the page). As part of this:
1643
1644         1) Introduce the concept of web-visible plug-ins and related concepts, as distinct from the real underlying
1645            set of plug-ins.
1646
1647         2) Where applicable, plumb additional information about plug-ins (specifically, bundle identification) deeper
1648            down the stack.
1649
1650         3) Add generic functionality to PluginStrategy to support filtering plug-ins for visibility and introduce
1651            a concrete implementation thereof in WebPlatformStrategies in WebKit2.
1652
1653         4) Add messaging infrastructure to allow clients to set and clear plug-in policies.
1654
1655         While currently only used in a very limited manner, the new declarative plug-in policies are written generically
1656         so that they could be easily used in the future to reduce synchronous messaging to the client when loading plug-ins.
1657
1658         * dom/DOMImplementation.cpp:
1659         (WebCore::DOMImplementation::createDocument):
1660         Update to reflect function rename.
1661
1662         * loader/SubframeLoader.cpp:
1663         (WebCore::findPluginMIMETypeFromURL):
1664         Adopt getWebVisibleMimesAndPluginIndices().
1665         (WebCore::logPluginRequest):
1666         Update to reflect function rename.
1667         (WebCore::SubframeLoader::shouldUsePlugin):
1668         Ditto.
1669
1670         * platform/PlatformStrategies.h:
1671         Export platformStrategies(), since it is now used in WebProcess.cpp.
1672
1673         * plugins/DOMMimeType.cpp:
1674         (WebCore::DOMMimeType::type):
1675         (WebCore::DOMMimeType::description):
1676         (WebCore::DOMMimeType::mimeClassInfo):
1677         Adopt getWebVisibleMimesAndPluginIndices().
1678         (WebCore::DOMMimeType::enabledPlugin):
1679         Ditto.
1680
1681         * plugins/DOMMimeType.h:
1682         Don't return references in a few places where it is no longer safe to do so.
1683         (WebCore::DOMMimeType::mimeClassInfo): Deleted.
1684
1685         * plugins/DOMMimeTypeArray.cpp:
1686         (WebCore::DOMMimeTypeArray::length):
1687         Adopt getWebVisibleMimesAndPluginIndices().
1688         (WebCore::DOMMimeTypeArray::item):
1689         Ditto.
1690         (WebCore::DOMMimeTypeArray::canGetItemsForName):
1691         Ditto.
1692         (WebCore::DOMMimeTypeArray::namedItem):
1693         Ditto.
1694
1695         * plugins/DOMPlugin.cpp:
1696         (WebCore::DOMPlugin::pluginInfo):
1697         Adopt getWebVisiblePlugins().
1698         (WebCore::DOMPlugin::item):
1699         Adopt getWebVisibleMimesAndPluginIndices().
1700         (WebCore::DOMPlugin::canGetItemsForName):
1701         Ditto.
1702         (WebCore::DOMPlugin::namedItem):
1703         Ditto.
1704
1705         * plugins/DOMPlugin.h:
1706         (WebCore::DOMPlugin::pluginInfo): Deleted.
1707
1708         * plugins/DOMPluginArray.cpp:
1709         (WebCore::DOMPluginArray::length):
1710         Adopt getWebVisiblePlugins().
1711         (WebCore::DOMPluginArray::item):
1712         Ditto.
1713         (WebCore::DOMPluginArray::canGetItemsForName):
1714         Ditto.
1715         (WebCore::DOMPluginArray::namedItem):
1716         Ditto.
1717
1718         * plugins/PluginData.cpp:
1719         (WebCore::PluginData::PluginData):
1720         Stash the passed-in Page and call initPlugins().
1721         (WebCore::PluginData::getWebVisiblePlugins):
1722         New member function; call through to PluginStrategy::getWebVisiblePluginInfo().
1723         (WebCore::PluginData::getWebVisibleMimesAndPluginIndices):
1724         New member function; build up the mimes and mimePluginIndices vectors in the same manner as before, but
1725         limited to the web-visible plug-ins.
1726         (WebCore::PluginData::supportsWebVisibleMimeType):
1727         Renamed from supportsMimeType(); update to work in terms of web-visible plug-ins.
1728         (WebCore::PluginData::pluginInfoForWebVisibleMimeType):
1729         Renamed from pluginInfoForMimeType(); ditto.
1730         (WebCore::PluginData::pluginNameForWebVisibleMimeType):
1731         Renamed from pluginNameForMimeType(); ditto.
1732         (WebCore::PluginData::pluginFileForWebVisibleMimeType):
1733         Renamed from pluginFileForMimeType(); ditto.
1734         (WebCore::PluginData::initPlugins):
1735         (WebCore::PluginData::supportsMimeType): Deleted.
1736         (WebCore::PluginData::pluginInfoForMimeType): Deleted.
1737         (WebCore::PluginData::pluginNameForMimeType): Deleted.
1738         (WebCore::PluginData::pluginFileForMimeType): Deleted.
1739
1740         * plugins/PluginData.h:
1741         Add a member variable for the associate Page; declare the PluginLoadClientPolicy enumeration; add
1742         new members to PluginInfo for the clientLoadPolicy and bundle information.
1743         (WebCore::PluginData::PluginData):
1744         Replace some member functions with new ones that will hide plug-ins upon request from the client;
1745         (WebCore::PluginData::mimes): Deleted.
1746         (WebCore::PluginData::mimePluginIndices): Deleted.
1747
1748         * plugins/PluginStrategy.h:
1749         Declare new member functions for retrieving web-visible plug-ins and setting/clearing plug-in policies.
1750
1751         * replay/SerializationMethods.cpp:
1752         (JSC::EncodingTraits<PluginData>::encodeValue):
1753         Remove now-obsolete code for handling MIME types and add a FIXME.
1754         (JSC::DeserializedPluginData::DeserializedPluginData):
1755         (JSC::EncodingTraits<PluginData>::decodeValue):
1756         Ditto.
1757         (JSC::EncodingTraits<PluginInfo>::encodeValue):
1758         Handle the new members in PluginInfo.
1759         (JSC::EncodingTraits<PluginInfo>::decodeValue):
1760         Ditto.
1761
1762         * replay/WebInputs.json:
1763         Teach Replay about PluginLoadClientPolicy.
1764
1765 2015-03-16  Max Stepin  <maxstepin@gmail.com>
1766
1767         Add APNG support
1768         https://bugs.webkit.org/show_bug.cgi?id=17022
1769
1770         Reviewed by Carlos Garcia Campos.
1771
1772         Test: fast/images/animated-png.html
1773
1774         * platform/image-decoders/ImageDecoder.h:
1775         (WebCore::ImageFrame::divide255):
1776         (WebCore::ImageFrame::overRGBA):
1777         * platform/image-decoders/png/PNGImageDecoder.cpp:
1778         (WebCore::frameHeader):
1779         (WebCore::readChunks):
1780         (WebCore::PNGImageReader::PNGImageReader):
1781         (WebCore::PNGImageDecoder::PNGImageDecoder):
1782         (WebCore::PNGImageDecoder::frameBufferAtIndex):
1783         (WebCore::PNGImageDecoder::headerAvailable):
1784         (WebCore::PNGImageDecoder::rowAvailable):
1785         (WebCore::PNGImageDecoder::pngComplete):
1786         (WebCore::PNGImageDecoder::readChunks):
1787         (WebCore::PNGImageDecoder::frameHeader):
1788         (WebCore::PNGImageDecoder::init):
1789         (WebCore::PNGImageDecoder::clearFrameBufferCache):
1790         (WebCore::PNGImageDecoder::initFrameBuffer):
1791         (WebCore::PNGImageDecoder::frameComplete):
1792         (WebCore::PNGImageDecoder::processingStart):
1793         (WebCore::PNGImageDecoder::processingFinish):
1794         (WebCore::PNGImageDecoder::fallbackNotAnimated):
1795         * platform/image-decoders/png/PNGImageDecoder.h:
1796         (WebCore::PNGImageDecoder::frameCount):
1797         (WebCore::PNGImageDecoder::repetitionCount):
1798         (WebCore::PNGImageDecoder::isComplete):
1799
1800 2015-03-15  Benjamin Poulain  <benjamin@webkit.org>
1801
1802         CSS: fix the case-insensitive matching of the attribute selectors Begin, End and Hyphen
1803         https://bugs.webkit.org/show_bug.cgi?id=142715
1804
1805         Reviewed by Brent Fulgham.
1806
1807         Fix attribute matching with:
1808         -Begin: [a^=b].
1809         -End: [a$=b].
1810         -Hyphen: [a|=b].
1811
1812         Tests: fast/selectors/attribute-endswith-value-matching-is-ascii-case-insensitive.html
1813                fast/selectors/attribute-hyphen-value-matching-is-ascii-case-insensitive.html
1814                fast/selectors/attribute-startswith-value-matching-is-ascii-case-insensitive.html
1815
1816         * css/SelectorChecker.cpp:
1817         (WebCore::attributeValueMatches):
1818         I forgot to change CSSSelector::Exact in my last patch.
1819         The tests could not catch that since we use the CSS JIT almost everywhere.
1820
1821         * cssjit/SelectorCompiler.cpp:
1822         (WebCore::SelectorCompiler::attributeValueBeginsWith):
1823         (WebCore::SelectorCompiler::attributeValueEndsWith):
1824         (WebCore::SelectorCompiler::attributeValueMatchHyphenRule):
1825
1826 2015-03-15  Dan Bernstein  <mitz@apple.com>
1827
1828         Fixed the iOS build after r181522.
1829
1830         * page/FrameView.cpp:
1831         (WebCore::FrameView::performPostLayoutTasks):
1832
1833 2015-03-15  Andy Estes  <aestes@apple.com>
1834
1835         [Content Filtering] Adopt new NEFilterSource SPI
1836         https://bugs.webkit.org/show_bug.cgi?id=142710
1837         rdar://problem/19023855
1838
1839         Reviewed by Dan Bernstein.
1840
1841         Teach NetworkExtensionContentFilter to use a new, alternate NEFilterSource SPI on platforms where it is available.
1842
1843         * platform/ContentFilter.cpp:
1844         (WebCore::ContentFilter::types): Renamed HAVE(NE_FILTER_SOURCE) to HAVE(NETWORK_EXTENSION).
1845         * platform/cocoa/NetworkExtensionContentFilter.h: Renamed member variables to remove redundancy, forward-declared NEFilterSourceStatus,
1846         added a dispatch_semaphore member variable to avoid creating and destroying multiple semaphores, and made m_originalData a SharedBuffer.
1847         * platform/cocoa/NetworkExtensionContentFilter.mm:
1848         (decisionInfoReplacementData): Returned the replacement data from a decision handler info dictionary.
1849         (WebCore::createNEFilterSource): Created either an old-style or new-style NEFilterSource object.
1850         (WebCore::NetworkExtensionContentFilter::NetworkExtensionContentFilter): Called receivedResponse:decisionHandler: when using the new SPI.
1851         (WebCore::NetworkExtensionContentFilter::~NetworkExtensionContentFilter): Released the dispatch_semaphore.
1852         (WebCore::NetworkExtensionContentFilter::addData): Appended the copied NSData to m_originalData, avoiding an additional copy previously
1853         being made by NSMutableData. Used the new receivedData:decisionHandler: SPI when appropriate.
1854         (WebCore::NetworkExtensionContentFilter::finishedAddingData): Used the new finishedLoadingWithDecisionHandler: SPI when appropriate.
1855         (WebCore::NetworkExtensionContentFilter::needsMoreData): Changed m_neFilterSourceStatus to m_status.
1856         (WebCore::NetworkExtensionContentFilter::didBlockData): Ditto.
1857         (WebCore::NetworkExtensionContentFilter::getReplacementData): Returned the replacement data from NEFilterSource if the load was blocked.
1858         Otherwise, returned the original data.
1859         (WebCore::NetworkExtensionContentFilter::handleDecision): Added a helper to set m_status and m_replacementData, and to signal m_semaphore.
1860         * platform/spi/cocoa/NEFilterSourceSPI.h: Declared the new NEFilterSource SPI on platforms that support it.
1861
1862 2015-03-15  Brent Fulgham  <bfulgham@apple.com>
1863
1864         Scroll snap points are not supported on iframe content
1865         https://bugs.webkit.org/show_bug.cgi?id=142582
1866         <rdar://problem/20121319>
1867
1868         Tested by css3/scroll-snap/scroll-snap-iframe.html
1869
1870         Reviewed by Simon Fraser.
1871
1872         The scroll snap points were not being applied to the iframe contents because the code
1873         that sets up the scroll snap point content is not called for iframes.
1874
1875         To correct this, we need to make sure the snap offsets are set during post-frame layout
1876         for iframes. We also need to make sure (on Mac) that the scroll animator and timers are updated.
1877
1878         * page/FrameView.cpp:
1879         (WebCore::FrameView::performPostLayoutTasks): Call 'updateSnapOffsets' if the frame is not a
1880         MainFrame. Also notify scroll animators they need to update their snap point settings.
1881
1882 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
1883
1884         Add the same is<RenderBox> test to KeyframeAnimation::computeExtentOfTransformAnimation()
1885         that ImplicitAnimation::computeExtentOfTransformAnimation() has, and change the latter
1886         to the more canonical is<RenderBox>() form.
1887         
1888         Fixes an assertion in animations/animation-on-inline-crash.html
1889
1890         * page/animation/ImplicitAnimation.cpp:
1891         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation):
1892         * page/animation/KeyframeAnimation.cpp:
1893         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
1894
1895 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
1896
1897         And another fix. Thanks to Hunseop Jeong for the fix.
1898
1899         * html/HTMLInputElement.cpp:
1900         (WebCore::HTMLInputElement::runPostTypeUpdateTasks):
1901         (WebCore::HTMLInputElement::didMoveToNewDocument):
1902
1903 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
1904
1905         Fix the touch-event build.
1906
1907         * dom/Document.cpp:
1908         (WebCore::Document::didAddTouchEventHandler):
1909         (WebCore::Document::didRemoveTouchEventHandler):
1910
1911 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
1912
1913         Reduce the side-effects of animations turning off overlap testing
1914         https://bugs.webkit.org/show_bug.cgi?id=92791
1915
1916         Reviewed by Dean Jackson.
1917         
1918         When a layer is running a transition or animation of the transform property,
1919         we would simply disable overlap testing for later layers, which had the side-effect
1920         of promoting lots of unrelated elements into layers temporarily.
1921         
1922         Fix by maintaining overlap, but computing an overlap extent that takes the animation
1923         into account.
1924         
1925         Rotations are currently treated as full rotations. If an extent for the overlap is
1926         hard to compute (e.g. 3d transforms, or matrix animations with a rotation component),
1927         then we fall back to the current behavior.
1928
1929         Tests: compositing/layer-creation/mismatched-rotated-transform-animation-overlap.html
1930                compositing/layer-creation/mismatched-rotated-transform-transition-overlap.html
1931                compositing/layer-creation/mismatched-transform-transition-overlap.html
1932                compositing/layer-creation/multiple-keyframes-animation-overlap.html
1933                compositing/layer-creation/scale-rotation-animation-overlap.html
1934                compositing/layer-creation/scale-rotation-transition-overlap.html
1935                compositing/layer-creation/translate-animation-overlap.html
1936                compositing/layer-creation/translate-scale-animation-overlap.html
1937                compositing/layer-creation/translate-scale-transition-overlap.html
1938                compositing/layer-creation/translate-transition-overlap.html
1939
1940         * page/animation/AnimationBase.cpp:
1941         (WebCore::containsRotation):
1942         (WebCore::AnimationBase::computeTransformedExtentViaTransformList): When we have matched
1943         transform lists, we can map a rectangle through the various operations. Transform-origin
1944         is used to shift the origin of the box first, and then unshift after. If we encounter
1945         a rotation, for now assume it's a full rotation (a future patch could tighten this up).
1946         (WebCore::AnimationBase::computeTransformedExtentViaMatrix): If we're using matrix
1947         interpolation, we have to decompose the matrix to see if there's any rotation component,
1948         and, if there is, fall back to current behavior.
1949         * page/animation/AnimationBase.h:
1950         * page/animation/AnimationController.cpp:
1951         (WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
1952         (WebCore::AnimationController::computeExtentOfAnimation):
1953         * page/animation/AnimationController.h:
1954         * page/animation/AnimationControllerPrivate.h:
1955         * page/animation/CompositeAnimation.cpp:
1956         (WebCore::CompositeAnimation::computeExtentOfTransformAnimation): Ask active keyframe
1957         animations and transitions to compute the bounds extent.
1958         * page/animation/CompositeAnimation.h:
1959         * page/animation/ImplicitAnimation.cpp:
1960         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation): Compute the extent
1961         of the start and end transforms, and union them.
1962         * page/animation/ImplicitAnimation.h:
1963         * page/animation/KeyframeAnimation.cpp:
1964         (WebCore::KeyframeAnimation::animate):
1965         (WebCore::KeyframeAnimation::getAnimatedStyle): Some nullptr goodness.
1966         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation): Compute an extent
1967         for each keyframe, and take their union.
1968         * page/animation/KeyframeAnimation.h:
1969         * platform/graphics/GeometryUtilities.cpp:
1970         (WebCore::euclidianDistance): Use Pythagoras to compute a distance.
1971         (WebCore::boundsOfRotatingRect): Given a rect whose location is relative
1972         to the rotation origin, compute a bounds for the rotated rect by computing
1973         the furthest corner from the origin, and sweeping out a circle.
1974         * platform/graphics/GeometryUtilities.h:
1975         * platform/graphics/transforms/Matrix3DTransformOperation.h:
1976         * platform/graphics/transforms/MatrixTransformOperation.h:
1977         * platform/graphics/transforms/PerspectiveTransformOperation.h:
1978         * platform/graphics/transforms/RotateTransformOperation.h:
1979         * platform/graphics/transforms/ScaleTransformOperation.h:
1980         * platform/graphics/transforms/SkewTransformOperation.h:
1981         * platform/graphics/transforms/TransformOperation.h:
1982         (WebCore::TransformOperation::isAffectedByTransformOrigin):
1983         * platform/graphics/transforms/TransformOperations.cpp:
1984         (WebCore::TransformOperations::affectedByTransformOrigin): Ask all the operations if
1985         they are affected by transform-origin.
1986         (WebCore::TransformOperations::blendByMatchingOperations): nullptr.
1987         * platform/graphics/transforms/TransformOperations.h:
1988         * rendering/RenderBox.cpp:
1989         (WebCore::RenderBox::pushMappingToContainer): Comment fix. Only take transforms into account
1990         if the geometry map says so (which is most of the time).
1991         * rendering/RenderGeometryMap.cpp:
1992         (WebCore::RenderGeometryMap::mapToContainer): RenderLayerCompositor is now using the
1993         geometry map in a way that is incompatible with this assertion; it deliberately ignores
1994         transforms sometimes, so we can't easily verify that the mapping matches mapping through
1995         renderers.
1996         (WebCore::RenderGeometryMap::pushMappingsToAncestor): Save and restore the UseTransforms
1997         bit.
1998         * rendering/RenderGeometryMap.h:
1999         * rendering/RenderLayer.cpp:
2000         (WebCore::RenderLayer::boundingBox): Whitespace.
2001         (WebCore::RenderLayer::getOverlapBoundsIncludingChildrenAccountingForTransformAnimations): Helper
2002         function to get the bounds of a layer, including descendants, when a transform animation is running.
2003         * rendering/RenderLayer.h:
2004         * rendering/RenderLayerCompositor.cpp:
2005         (WebCore::RenderLayerCompositor::CompositingState::CompositingState): Add a ancestorHasTransformAnimation
2006         flag to detect nested animated transforms.
2007         (WebCore::RenderLayerCompositor::OverlapExtent::knownToBeHaveExtentUncertainty): This returns true when
2008         the layer is animating transform, and the transition/animation is such that we can't easily compute the
2009         bounds of the animation.
2010         (WebCore::RenderLayerCompositor::computeExtent): const RenderLayer&.
2011         Compute the animated bounds if there's a transform animation running.
2012         (WebCore::RenderLayerCompositor::addToOverlapMap): const RenderLayer&
2013         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive): const RenderLayer&
2014         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2015         Delay the call to pushMappingsToAncestor() until knowing if there's a transform animation running, and
2016         if there is, push the mapping while ignoring transforms (since the transform is implicitly taken into account
2017         for overlap via the computed animated bounds).
2018         If this layer is running a transform animation, set the childState.ancestorHasTransformAnimation flag so
2019         that descendants will know (nested transform animations fall back to current behavior).
2020         The if (.... && isRunningAcceleratedTransformAnimation()) is what previously caused us to turn off overlap
2021         testing in the face of animations. That now only happens if we were unable to easily compute the animation bounds.
2022         (WebCore::RenderLayerCompositor::isRunningTransformAnimation): This previously tested whether an accelerated animation
2023         was running, but that's timing sensitive; AnimationController can start the transform animation, but it's not yet
2024         considered accelerated until we get an async callback from GraphicsLayer, yet this code needed to know if the
2025         animation was running.
2026         Since transform animations are always accelerated, we can just test for a running transform animation.
2027         (WebCore::RenderLayerCompositor::isRunningAcceleratedTransformAnimation): Deleted.
2028         * rendering/RenderLayerCompositor.h:
2029         * rendering/style/RenderStyle.cpp:
2030         (WebCore::requireTransformOrigin): Some FIXME comments.
2031
2032 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
2033
2034         Clean up related to wheelEvent names
2035         https://bugs.webkit.org/show_bug.cgi?id=142713
2036
2037         Reviewed by Anders Carlsson.
2038
2039         Add EventNames::isWheelEventType() and use it in places that test for the
2040         two wheel event names.
2041
2042         * dom/Document.cpp:
2043         (WebCore::Document::didAddWheelEventHandler):
2044         (WebCore::Document::didRemoveWheelEventHandler):
2045         * dom/Document.h: No need for exports (I grepped). Pass the Node*, which
2046         will be used in a later patch.
2047         * dom/EventNames.h:
2048         (WebCore::EventNames::isWheelEventType):
2049         * dom/Node.cpp:
2050         (WebCore::Node::didMoveToNewDocument):
2051         (WebCore::tryAddEventListener):
2052         (WebCore::tryRemoveEventListener):
2053         (WebCore::Node::defaultEventHandler):
2054         * html/shadow/MediaControlsApple.cpp:
2055         (WebCore::MediaControlsAppleEventListener::handleEvent):
2056         * page/DOMWindow.cpp:
2057         (WebCore::DOMWindow::addEventListener):
2058         (WebCore::DOMWindow::removeEventListener):
2059         * page/ios/FrameIOS.mm:
2060         (WebCore::ancestorRespondingToScrollWheelEvents): Remove dead code.
2061
2062 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
2063
2064         Remove a redundant repaint when a layer becomes composited
2065         https://bugs.webkit.org/show_bug.cgi?id=142711
2066
2067         Reviewed by Anders Carlsson.
2068
2069         RenderLayerCompositor::computeCompositingRequirements() doesn't need to call
2070         repaintOnCompositingChange() when a layer is going to become composited,
2071         because updateBacking() does exactly the same thing. I used an assertion
2072         and ran the tests to ensure this wasn't a behavior change.
2073
2074         * rendering/RenderLayerCompositor.cpp:
2075         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2076
2077 2015-03-15  Benjamin Poulain  <bpoulain@apple.com>
2078
2079         Change the exact attribute matching to be ASCII case-insensitive
2080         https://bugs.webkit.org/show_bug.cgi?id=142609
2081
2082         Reviewed by Darin Adler.
2083
2084         In CSS, testing attribute values should be ASCII case-insensitive,
2085         previously we were using full unicode case conversion.
2086
2087         Test: fast/selectors/attribute-exact-value-match-is-ascii-case-insensitive.html
2088
2089         * css/CSSParser.cpp:
2090         (WebCore::CSSParser::parseKeyframeSelector):
2091         The CSS parser has its own fast version for ASCII case insensitive.
2092         This code was using the general equalIgnoringASCIICase() which was causing name conflicts,
2093         change that to the normal CSS parser version.
2094
2095         * css/SelectorCheckerTestFunctions.h:
2096         (WebCore::equalIgnoringASCIICase): Deleted.
2097         * cssjit/SelectorCompiler.cpp:
2098         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
2099
2100 2015-03-15  Brent Fulgham  <bfulgham@apple.com>
2101
2102         scroll snap points do not properly account for zoomed pages
2103         https://bugs.webkit.org/show_bug.cgi?id=142706
2104         <rdar://problem/20165771>
2105
2106         Reviewed by Anders Carlsson.
2107
2108         When a WebView is zoomed (such that it has a non-unity pageScaleFactor), we need to account for this
2109         scaling value when selecting our correct scroll snap point target, as well as when specifying the
2110         pixel location for our animation to target.
2111
2112         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2113         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2114         (WebCore::ScrollingTreeFrameScrollingNodeMac::pageScaleFactor): Added new delegate method.
2115         * platform/cocoa/ScrollController.h:
2116         (WebCore::ScrollControllerClient::pageScaleFactor): Added new default delegate.
2117         * platform/cocoa/ScrollController.mm:
2118         (WebCore::ScrollController::beginScrollSnapAnimation): Calculate the correct scroll target
2119         based on the page scale factor.
2120
2121 2015-03-15  Csaba Osztrogonác  <ossy@webkit.org>
2122
2123         Fix run-bindings-tests on the WinCairo bot
2124         https://bugs.webkit.org/show_bug.cgi?id=142588
2125
2126         Reviewed by Alex Christensen.
2127
2128         * bindings/scripts/test/JS/JSFloat64Array.cpp: Added property svn:eol-style.
2129         * bindings/scripts/test/JS/JSFloat64Array.h: Added property svn:eol-style.
2130         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: Added property svn:eol-style.
2131         * bindings/scripts/test/JS/JSTestActiveDOMObject.h: Modified property svn:eol-style.
2132         * bindings/scripts/test/JS/JSTestCallback.cpp: Modified property svn:eol-style.
2133         * bindings/scripts/test/JS/JSTestCallback.h: Modified property svn:eol-style.
2134         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: Added property svn:eol-style.
2135         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h: Modified property svn:eol-style.
2136         * bindings/scripts/test/JS/JSTestEventConstructor.cpp: Added property svn:eol-style.
2137         * bindings/scripts/test/JS/JSTestEventConstructor.h: Added property svn:eol-style.
2138         * bindings/scripts/test/JS/JSTestEventTarget.cpp: Added property svn:eol-style.
2139         * bindings/scripts/test/JS/JSTestEventTarget.h: Modified property svn:eol-style.
2140         * bindings/scripts/test/JS/JSTestException.cpp: Added property svn:eol-style.
2141         * bindings/scripts/test/JS/JSTestException.h: Added property svn:eol-style.
2142         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: Added property svn:eol-style.
2143         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h: Added property svn:eol-style.
2144         * bindings/scripts/test/JS/JSTestImplements.cpp: Added property svn:eol-style.
2145         * bindings/scripts/test/JS/JSTestImplements.h: Added property svn:eol-style.
2146         * bindings/scripts/test/JS/JSTestInterface.cpp: Modified property svn:eol-style.
2147         * bindings/scripts/test/JS/JSTestInterface.h: Modified property svn:eol-style.
2148         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: Modified property svn:eol-style.
2149         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h: Modified property svn:eol-style.
2150         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: Added property svn:eol-style.
2151         * bindings/scripts/test/JS/JSTestNamedConstructor.h: Added property svn:eol-style.
2152         * bindings/scripts/test/JS/JSTestNondeterministic.cpp: Added property svn:eol-style.
2153         * bindings/scripts/test/JS/JSTestNondeterministic.h: Added property svn:eol-style.
2154         * bindings/scripts/test/JS/JSTestObj.cpp: Modified property svn:eol-style.
2155         * bindings/scripts/test/JS/JSTestObj.h: Modified property svn:eol-style.
2156         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: Added property svn:eol-style.
2157         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h: Added property svn:eol-style.
2158         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: Modified property svn:eol-style.
2159         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h: Modified property svn:eol-style.
2160         * bindings/scripts/test/JS/JSTestSupplemental.cpp: Added property svn:eol-style.
2161         * bindings/scripts/test/JS/JSTestSupplemental.h: Added property svn:eol-style.
2162         * bindings/scripts/test/JS/JSTestTypedefs.cpp: Added property svn:eol-style.
2163         * bindings/scripts/test/JS/JSTestTypedefs.h: Added property svn:eol-style.
2164         * bindings/scripts/test/JS/JSattribute.cpp: Added property svn:eol-style.
2165         * bindings/scripts/test/JS/JSattribute.h: Added property svn:eol-style.
2166         * bindings/scripts/test/JS/JSreadonly.cpp: Added property svn:eol-style.
2167         * bindings/scripts/test/JS/JSreadonly.h: Added property svn:eol-style.
2168
2169 2015-03-14  Darin Adler  <darin@apple.com>
2170
2171         More event handler improvements
2172         https://bugs.webkit.org/show_bug.cgi?id=142701
2173
2174         Reviewed by Anders Carlsson.
2175
2176         These are the improvements:
2177
2178         - Use EventHandler rather than EventListener as the the type for event handler
2179           attributes. This matches the HTML specification, and also makes sense, since
2180           EventListener means something else (and we use it to mean that!). Also renamed
2181           JSWindowEventListener to WindowEventHandler. Even though this only affects the
2182           JavaScript code generated, it's not really a JavaScript-specific flag.
2183
2184         - Tweak formatting on addEventListener/removeEventListener/dispatchEvent in
2185           all the IDL files where the appear. This includes changing the spelling from
2186           "evt" to "event". Some day we should fix this so these functions only need to
2187           appear in EventTarget.idl.
2188
2189         - Tweak formatting a bit on the IDL files we had to modify anyway.
2190
2191         - Use [Conditional] more often and #if less often in IDL files.
2192
2193         - Added a new [DocumentEventHandler] attribute for the selectionchange event.
2194           This involved adding new event handler attribute functions to JSEventListener.h
2195           for use by the JavaScript bindings.
2196
2197         - Removed a little unused code from the JavaScript code bindings generator.
2198
2199         - Improved the mechanism used by HTMLElement and SVGElement to share the list of
2200           content attributes that are event handlers so there is only one map rather than
2201           two. Made a similar mechanism so that HTMLBodyElement and HTMLFrameSetElement
2202           can share the list of window event handlers.
2203
2204         - Followed the HTML specification by putting all the event handler support in
2205           the HTMLElement class rather than having event handlers apply only a the
2206           particular element that uses those events. We already did this for most of
2207           our event handlers, but we are now doing it for all of them.
2208
2209         * Modules/battery/BatteryManager.idl: Use EventHandler instead of EventListener
2210         as appropriate. Also reformatted addEventListener/removeEventListener/dispatchEvent.
2211         * Modules/encryptedmedia/MediaKeySession.idl: Ditto.
2212         * Modules/indexeddb/IDBDatabase.idl: Ditto.
2213         * Modules/indexeddb/IDBOpenDBRequest.idl: Ditto.
2214         * Modules/indexeddb/IDBRequest.idl: Ditto.
2215         * Modules/indexeddb/IDBTransaction.idl: Ditto.
2216         * Modules/mediastream/MediaStream.idl: Ditto.
2217         * Modules/mediastream/MediaStreamTrack.idl: Ditto.
2218         * Modules/mediastream/RTCDTMFSender.idl: Ditto.
2219         * Modules/mediastream/RTCDataChannel.idl: Ditto.
2220         * Modules/mediastream/RTCPeerConnection.idl: Ditto.
2221         * Modules/speech/SpeechSynthesisUtterance.idl: Ditto.
2222         * Modules/webaudio/AudioBufferSourceNode.idl: Ditto.
2223         * Modules/webaudio/AudioContext.idl: Ditto.
2224         * Modules/webaudio/OscillatorNode.idl: Ditto.
2225         * Modules/webaudio/ScriptProcessorNode.idl: Ditto.
2226         * Modules/websockets/WebSocket.idl: Ditto.
2227         * css/FontLoader.idl: Ditto.
2228         * dom/EventListener.idl: Ditto.
2229         * dom/EventTarget.idl: Ditto.
2230         * dom/MessagePort.idl: Ditto.
2231         * dom/Node.idl: Ditto.
2232         * dom/WebKitNamedFlow.idl: Ditto.
2233         * fileapi/FileReader.idl: Ditto.
2234         * html/MediaController.idl: Ditto.
2235         * html/track/AudioTrackList.idl: Ditto.
2236         * html/track/TextTrackCue.idl: Ditto.
2237         * html/track/TextTrackList.idl: Ditto.
2238         * html/track/VideoTrackList.idl: Ditto.
2239         * loader/appcache/DOMApplicationCache.idl: Ditto.
2240         * page/EventSource.idl: Ditto.
2241         * page/Performance.idl: Ditto.
2242         * workers/AbstractWorker.idl: Ditto.
2243         * workers/DedicatedWorkerGlobalScope.idl: Ditto.
2244         * workers/Worker.idl: Ditto.
2245         * workers/WorkerGlobalScope.idl: Ditto.
2246         * xml/XMLHttpRequest.idl: Ditto.
2247         * xml/XMLHttpRequestUpload.idl: Ditto.
2248
2249         * Modules/notifications/Notification.idl: Did the above, but also used
2250         [Conditional] instead of #if throughout.
2251         * html/track/TextTrack.idl: Ditto.
2252
2253         * Modules/webaudio/AudioNode.idl: Tweaked paragraphing of this file.
2254
2255         * bindings/js/JSEventListener.cpp:
2256         (WebCore::windowEventHandlerAttribute): Renamed to take the word "forwarded"
2257         out of this. More closely matches the terminology used in IDL files and the
2258         HTML specification.
2259         (WebCore::setWindowEventHandlerAttribute): Ditto.
2260         (WebCore::documentEventHandlerAttribute): Added.
2261         (WebCore::setDocumentEventHandlerAttribute): Added.
2262         * bindings/js/JSEventListener.h: Updated for above changes.
2263
2264         * bindings/objc/PublicDOMInterfaces.h: Renamed argument from "evt" to "event".
2265
2266         * bindings/scripts/CodeGeneratorGObject.pm:
2267         (SkipAttribute): Skip attributes of type "EventHandler" rather than attributes
2268         of type "EventListener".
2269         * bindings/scripts/CodeGeneratorObjC.pm:
2270         (SkipAttribute): Ditto.
2271
2272         * bindings/scripts/CodeGeneratorJS.pm:
2273         (GenerateImplementation): Look for the type EventHandler instead of the type
2274         EventListener for event handler attributes. Also added code to handle the new
2275         DocumentEventHandler, and use the name WindowEventHandler instead of the name
2276         JSWindowEventListener. Removed unneeded preflight check to see if we have
2277         writable attributes; it was not doing us any good. (That caused a lot of code
2278         to be un-indented and makes the diff hard to read.)
2279
2280         * bindings/scripts/IDLAttributes.txt: Removed JSWindowEventListener, and added
2281         WindowEventHandler and DocumentEventHandler.
2282
2283         * bindings/scripts/test/TestObj.idl: Use the type EventHandler instead of the
2284         type EventListener. The test output is unchanged, though.
2285
2286         * dom/Document.idl: Got rid of the conditionals and merged all the event handler
2287         attributes into a single sorted, unconditional list. Added some that were missing,
2288         as detected by the event-handler-attributes.html test.
2289
2290         * dom/Element.idl: Ditto. This includes moving attributes here that were formerly
2291         only in certain element classes. Note that the script event handler attribute
2292         support is still here, even though it should be in HTMLElement and SVGElement
2293         instead. There's a FIXME about that, but no real urgency in fixing it.
2294
2295         * html/HTMLAttributeNames.in: Added onmessage. Previously, the support for this
2296         was from the script attribute only, not the content attribute.
2297
2298         * html/HTMLBodyElement.cpp:
2299         (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap): Added. This
2300         contains the list of all the window event handlers that can be set on a body
2301         or frameset element and which are triggered by events on the window.
2302         (WebCore::HTMLBodyElement::eventNameForWindowEventHandlerAttribute): Added.
2303         This is the function to call to use the map above. Given an attribute, it
2304         returns either null if it is not a window event handler attribute, or the
2305         event type if it is one.
2306         (WebCore::HTMLBodyElement::parseAttribute): Updated to use the new
2307         functions above. Handling of these attributes is now unconditional, but
2308         also we don't have to keep the nested if statements here up to date, just
2309         the list of event handler attributes names in the map create function above.
2310
2311         * html/HTMLBodyElement.h: Added public eventNameForWindowEventHandlerAttribute
2312         and private createWindowEventHandlerNameMap functions.
2313
2314         * html/HTMLBodyElement.idl: Updated to use WindowEventHandler, DocumentEventHandler,
2315         and EventHandler. Also made everything unconditional. Also filled out the list here
2316         to match the list handled as content attributes. All covered by the test.
2317
2318         * html/HTMLElement.cpp:
2319         (WebCore::HTMLElement::createEventHandlerNameMap): Added. Replaces the old
2320         populate function. Changed the list of event handler attributes to be a bit more
2321         complete, and to be entirely unconditional. Also refactored this function to use
2322         a new populateEventHandlerNameMap helper, shared with HTMLBodyElement.
2323         (WebCore::HTMLElement::populateEventHandlerNameMap): Added. Factors out the code
2324         that both this class and HTMLBodyElement use to build event handler name maps.
2325         (WebCore::HTMLElement::eventNameForEventHandlerAttribute): Added. This is the
2326         function that call to use the map above. Given an attribute it returns either
2327         null if it is not an event handler attribute, or the event type if it is one.
2328         This is actually two functions. One is a protected function for use by both this
2329         class and HTMLBodyElement so they can share things like the optimization to look
2330         for the "on" prefix. The other is the public function that we actually use in
2331         HTMLElement and SVGElement.
2332         (WebCore::HTMLElement::editabilityFromContentEditableAttr): Tweaked and refactored
2333         to use lineageOfType. Would have been even simpler if this took an element instead
2334         of a node. Unrelated to the event handler changes.
2335         (WebCore::HTMLElement::parseAttribute): Removed long-obsolete code that decided
2336         whether to call through to the base class. The base class function is empty and
2337         never needs to be called, and in any case there is no value in doing work to
2338         decide whether to call through to an empty function. Changed the style of the
2339         function to use early return instead of else. Worth considering whether we want
2340         to return early or call through to base class in this family of functions. It's
2341         more efficient to return early, but doesn't work well if both the derived class
2342         and base class want to respond to changes to the same attribute. The new logic
2343         for event handler attributes is more straightforward than the old, since the
2344         eventNameForEventHandlerAttribute has the logic.
2345         (WebCore::HTMLElement::textToFragment): Tweaked and refactored a bit, and also
2346         changed to return a Ref since this never fails and needs to return null.
2347
2348         * html/HTMLElement.h: Updated for above changes. This includes a template version
2349         of populateEventHandlerNameMap that extracts the array size at compile time and
2350         passes it to the non-template function that does the work.
2351
2352         * html/HTMLFrameElementBase.cpp:
2353         (WebCore::HTMLFrameElementBase::parseAttribute): Removed unneeded code to handle
2354         event handler attributes handled by HTMLElement.
2355         * html/HTMLImageElement.cpp:
2356         (WebCore::HTMLImageElement::parseAttribute): Ditto.
2357         * html/HTMLLinkElement.cpp:
2358         (WebCore::HTMLLinkElement::parseAttribute): Ditto.
2359         * html/HTMLObjectElement.cpp:
2360         (WebCore::HTMLObjectElement::parseAttribute): Ditto.
2361         * html/HTMLScriptElement.cpp:
2362         (WebCore::HTMLScriptElement::parseAttribute): Ditto.
2363
2364         * html/HTMLFrameSetElement.cpp:
2365         (WebCore::HTMLFrameSetElement::parseAttribute): Changed function to early return
2366         style, and added FIXMEs about the many problems in the attribute handling code.
2367         Replaced all the code to handle window event handlers with a new bit of code that
2368         calls HTMLBodyElement::eventNameForWindowEventHandlerAttribute.
2369
2370         * html/HTMLFrameSetElement.idl: Changed to match the list of window event handlers
2371         in HTMLBodyElement.idl, although I did not add the document event handler here.
2372         As in the various other cases, having some extra event handlers does not seem to
2373         do harm and this is covered by the event-handler-attributes.html test.
2374
2375         * html/HTMLMarqueeElement.idl: Renamed EventListener to EventHandler in comment.
2376
2377         * page/DOMWindow.idl: As with Element and Document, removed conditionals, and
2378         filled out the list of event handlers so all the tests in
2379         event-handler-attributes.html will pass.
2380
2381         * svg/SVGElement.cpp:
2382         (WebCore::SVGElement::parseAttribute): Changed code to the early return style,
2383         and replaced the event handler attribute code with new much simpler code that
2384         uses the new HTMLElement::eventNameForEventHandlerAttribute. Also changed the
2385         way we call through to base classes. Just call through to the
2386         SVGLangSpace::parseAttribute function unconditionally, and don't try to use
2387         early return style to arbitrate among base classes. We should make this
2388         simplification throughout the SVG code; there's no need for the complexity
2389         that was there before just to cut down slightly on calls through to base
2390         class parseAttribute functions.
2391
2392         * svg/SVGSVGElement.cpp:
2393         (WebCore::SVGSVGElement::parseAttribute): Changed some of this code to the
2394         early return style and corrected some comments about the window event handler
2395         attributes here. These could use some further testing and might later need to be
2396         properly supported when the attributes are set in script, not just in content.
2397
2398         * svg/SVGScriptElement.cpp:
2399         (WebCore::SVGScriptElement::isSupportedAttribute): Deleted.
2400         (WebCore::SVGScriptElement::parseAttribute): Changed this function to use the
2401         early return style and also to call through to all three base classes. This is
2402         a pattern we should follow elsewhere in SVG to simplify the code. There is no
2403         need for the supportedAttributes sets like the one in this calass, and the code
2404         is unnecessarily complex, perhaps in an attempt to optimize performance. I'm
2405         pretty sure the old code was slower than this new code will be. No need for the
2406         extra hash table lookup every time. Also removed handling of event handler
2407         attribute which is taken care of by SVGElement now.
2408         (WebCore::SVGScriptElement::svgAttributeChanged): Made similar changes for
2409         the same reason as in parseAttribute. This function really needs a new name:
2410         It's the same as parseAttribute, except it's also used when implementing
2411         changes due to SVG animation.
2412
2413         * svg/SVGScriptElement.h: Removed isSupportedAttribute.
2414
2415 2015-03-14  Simon Fraser  <simon.fraser@apple.com>
2416
2417         Clean up use of flags in localToContainer-type functions
2418         https://bugs.webkit.org/show_bug.cgi?id=142704
2419
2420         Reviewed by Alexey Proskuryakov.
2421         
2422         RenderObject::localToContainerQuad() had the questionable behavior of always
2423         enforcing UseTransforms in the flags. However, a future patch will need to call
2424         localToContainerQuad() without this flag.
2425         
2426         Fix by requiring callers of localToAbsoluteQuad(), localToContainerQuad(), localToContainerPoint(),
2427         and absoluteToLocalQuad() to pass the UseTransforms flag in, providing it as a default argument.
2428         
2429         The default value of the MapCoordinatesFlags parameter to mapLocalToContainer(),
2430         a lower-level function, is removed.
2431         
2432         Sprinkle a few more nullptrs around.
2433         
2434         No behavior change.
2435
2436         * rendering/RenderBlock.cpp:
2437         (WebCore::RenderBlock::selectionGapRectsForRepaint): call the higher-level localToContainerPoint()
2438         instead of mapLocalToContainer().
2439         (WebCore::RenderBlock::absoluteQuads): Pass UseTransforms.
2440         * rendering/RenderBox.cpp:
2441         (WebCore::RenderBox::absoluteQuads): Ditto.
2442         * rendering/RenderBox.h:
2443         * rendering/RenderFlowThread.h:
2444         * rendering/RenderGeometryMap.h:
2445         (WebCore::RenderGeometryMap::absolutePoint):
2446         (WebCore::RenderGeometryMap::absoluteRect):
2447         * rendering/RenderImage.cpp:
2448         (WebCore::RenderImage::collectSelectionRects): This function was erroneously passing
2449         'false' as flags. Pass UseTransforms instead (but no behavior change since
2450         UseTransforms was forced on lower down).
2451         * rendering/RenderInline.h:
2452         * rendering/RenderLayer.cpp:
2453         (WebCore::RenderLayer::scrollRectToVisible): UseTransforms is the parameter default, remove it.
2454         * rendering/RenderLineBreak.cpp:
2455         (WebCore::RenderLineBreak::absoluteQuads):
2456         (WebCore::RenderLineBreak::collectSelectionRects): Another erroneous 'false'.
2457         * rendering/RenderNamedFlowFragment.cpp:
2458         (WebCore::RenderNamedFlowFragment::absoluteQuadsForBoxInRegion):
2459         * rendering/RenderObject.cpp:
2460         (WebCore::RenderObject::localToContainerQuad): Here's where we no longer force
2461         the UseTransforms bit.
2462         (WebCore::RenderObject::localToContainerPoint): Also here.
2463         * rendering/RenderObject.h: I prefer bit flags lined up. Makes it easier to spot errors.
2464         (WebCore::RenderObject::localToAbsoluteQuad):
2465         * rendering/RenderText.cpp:
2466         (WebCore::RenderText::collectSelectionRects): Another bad 'false'.
2467         * rendering/RenderTextLineBoxes.cpp:
2468         (WebCore::RenderTextLineBoxes::absoluteRectsForRange):
2469         (WebCore::RenderTextLineBoxes::absoluteQuads):
2470         (WebCore::RenderTextLineBoxes::absoluteQuadsForRange):
2471         * rendering/RenderView.h:
2472         * rendering/SimpleLineLayoutFunctions.cpp:
2473         (WebCore::SimpleLineLayout::collectAbsoluteQuads):
2474         * rendering/svg/RenderSVGForeignObject.h:
2475         * rendering/svg/RenderSVGInline.cpp:
2476         (WebCore::RenderSVGInline::absoluteQuads): Another bad 'false'.
2477         * rendering/svg/RenderSVGInline.h:
2478         * rendering/svg/RenderSVGModelObject.cpp:
2479         (WebCore::RenderSVGModelObject::absoluteQuads):
2480         * rendering/svg/RenderSVGModelObject.h:
2481         * rendering/svg/RenderSVGRoot.h:
2482         * rendering/svg/RenderSVGText.cpp:
2483         (WebCore::RenderSVGText::absoluteQuads):
2484         * rendering/svg/RenderSVGText.h:
2485         * rendering/svg/SVGRenderSupport.h:
2486
2487 2015-03-14  Brent Fulgham  <bfulgham@apple.com>
2488
2489         [iOS] scroll snap points are animating to the wrong positions...
2490         https://bugs.webkit.org/show_bug.cgi?id=142705
2491         <rdar://problem/20136946>
2492
2493         Reviewed by Simon Fraser.
2494
2495         Avoid adding an extra '0' snap point to our set. We always start with one zero; this
2496         extra append just forces us to do more steps in our search for nearest snap point.
2497
2498         * page/scrolling/AxisScrollSnapOffsets.cpp:
2499         (WebCore::updateFromStyle): Remove extra '0' appended to offsets.
2500
2501 2015-03-14  Dean Jackson  <dino@apple.com>
2502
2503         Feature flag for Animations Level 2
2504         https://bugs.webkit.org/show_bug.cgi?id=142699
2505         <rdar://problem/20165097>
2506
2507         Reviewed by Brent Fulgham.
2508
2509         Add ENABLE_CSS_ANIMATIONS_LEVEL_2 and a runtime flag animationTriggersEnabled.
2510
2511         * Configurations/FeatureDefines.xcconfig:
2512         * bindings/generic/RuntimeEnabledFeatures.cpp:
2513         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
2514         * bindings/generic/RuntimeEnabledFeatures.h:
2515         (WebCore::RuntimeEnabledFeatures::setAnimationTriggersEnabled):
2516         (WebCore::RuntimeEnabledFeatures::animationTriggersEnabled):
2517
2518 2015-03-14  Adenilson Cavalcanti  <cavalcantii@gmail.com>
2519
2520         RenderBlock::imageChange() calling const methods on exit
2521         https://bugs.webkit.org/show_bug.cgi?id=142648
2522
2523         Reviewed by Brent Fulgham.
2524
2525         No new tests, no change on behavior.
2526
2527         * rendering/RenderBlock.cpp:
2528         (WebCore::RenderBlock::imageChanged): Deleted.
2529         * rendering/RenderBlock.h:
2530
2531 2015-03-14  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
2532
2533         [GStreamer] share GL context in pipeline
2534         https://bugs.webkit.org/show_bug.cgi?id=142693
2535
2536         Reviewed by Philippe Normand.
2537
2538         GstGL elements in a pipeline need to be aware of the application's
2539         display and its GL context. This information is shared through context
2540         messages between the pipeline and the browser.
2541
2542         This patch shares this context through a GStreamer's synchronous
2543         message, using the GL information held in the web process.
2544
2545         This patch is based on the work of Philippe Normand for Bug 138562.
2546
2547         No new tests because this is platform specific and it depends in the
2548         run-time availability and configurations of GstGL elements.
2549
2550         * PlatformGTK.cmake: appends the GstGL header files in the include
2551         directories. Also its library directory is appended.
2552         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2553         (WebCore::mediaPlayerPrivateSyncMessageCallback): New callback function.
2554         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
2555         Initialize the new class attributes.
2556         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): New method
2557         for handling synchronous messages from the pipeline. This method
2558         currently only handles the GL context sharing.
2559         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Configures
2560         the pipeline's bus to handle the synchronous messages.
2561         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add new
2562         class methods and attributes.
2563
2564 2015-03-13  Alex Christensen  <achristensen@webkit.org>
2565
2566         Progress towards CMake on Mac.
2567         https://bugs.webkit.org/show_bug.cgi?id=142680
2568
2569         Reviewed by Gyuyoung Kim.
2570
2571         * PlatformMac.cmake:
2572         Added new include directories and removed old source files.
2573
2574 2015-03-13  Commit Queue  <commit-queue@webkit.org>
2575
2576         Unreviewed, rolling out r181483.
2577         https://bugs.webkit.org/show_bug.cgi?id=142688
2578
2579         Caused use-after-free on many tests (Requested by ap on
2580         #webkit).
2581
2582         Reverted changeset:
2583
2584         "Allow clients to selectively disable plug-ins"
2585         https://bugs.webkit.org/show_bug.cgi?id=142506
2586         http://trac.webkit.org/changeset/181483
2587
2588 2015-03-13  Antti Koivisto  <antti@apple.com>
2589
2590         Cache glyph widths to GlyphPages
2591         https://bugs.webkit.org/show_bug.cgi?id=142028
2592
2593         Reviewed by Andreas Kling.
2594
2595         Currently we have a separate cache in Font for glyph widths. In practice we always need
2596         the widths so we can just cache them in GlyphPages. This simplifies the code and removes
2597         a per-character hash lookup from WidthIterator.
2598
2599         * platform/graphics/Font.cpp:
2600         (WebCore::Font::Font):
2601         (WebCore::Font::initCharWidths):
2602         (WebCore::Font::platformGlyphInit):
2603         (WebCore::createAndFillGlyphPage):
2604         (WebCore::Font::computeWidthForGlyph):
2605
2606             Rename to make it clear this doesn't cache.
2607
2608         (WebCore::GlyphPage::setGlyphDataForIndex):
2609
2610             Initialize the width.
2611             This could go to GlyphPage.cpp if we had one.
2612
2613         * platform/graphics/Font.h:
2614         (WebCore::Font::glyphZeroWidth):
2615         (WebCore::Font::isZeroWidthSpaceGlyph):
2616         (WebCore::Font::zeroGlyph): Deleted.
2617         (WebCore::Font::setZeroGlyph): Deleted.
2618         (WebCore::Font::widthForGlyph): Deleted.
2619         * platform/graphics/FontCascade.cpp:
2620         (WebCore::offsetToMiddleOfGlyph):
2621         * platform/graphics/FontCascadeFonts.cpp:
2622         (WebCore::FontCascadeFonts::glyphDataForCharacter):
2623         * platform/graphics/GlyphPage.h:
2624         (WebCore::GlyphData::GlyphData):
2625
2626             Return width too as part of GlyphData.
2627
2628         (WebCore::GlyphPage::glyphDataForIndex):
2629         (WebCore::GlyphPage::setGlyphDataForCharacter):
2630         (WebCore::GlyphPage::setGlyphDataForIndex):
2631         (WebCore::GlyphPage::GlyphPage):
2632         * platform/graphics/WidthIterator.cpp:
2633         (WebCore::WidthIterator::advanceInternal):
2634
2635             No need to lookup width separately now.
2636
2637         * platform/graphics/mac/ComplexTextController.cpp:
2638         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
2639         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
2640         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
2641         * rendering/mathml/RenderMathMLOperator.cpp:
2642         (WebCore::RenderMathMLOperator::advanceForGlyph):
2643         * rendering/svg/SVGTextRunRenderingContext.cpp:
2644         (WebCore::missingGlyphForFont):
2645         * svg/SVGFontData.cpp:
2646         (WebCore::SVGFontData::initializeFont):
2647
2648 2015-03-13  Eric Carlson  <eric.carlson@apple.com>
2649
2650         [Mac] Enable WIRELESS_PLAYBACK_TARGET
2651         https://bugs.webkit.org/show_bug.cgi?id=142635
2652
2653         Reviewed by Darin Adler.
2654
2655         * Configurations/FeatureDefines.xcconfig:
2656
2657 2015-03-13  Jeremy Jones  <jeremyj@apple.com>
2658
2659         Fix typo restoreUserInterfaceForOptimizedFullscreeStopWithCompletionHandler.
2660         https://bugs.webkit.org/show_bug.cgi?id=142678
2661
2662         Reviewed by Eric Carlson.
2663
2664         Add the missing 'n' in "fullscreen".
2665
2666         * platform/spi/ios/AVKitSPI.h:
2667
2668 2015-03-13  Timothy Horton  <timothy_horton@apple.com>
2669
2670         Sites that use a device-width viewport but don't have enough height to fill the view are scaled up
2671         https://bugs.webkit.org/show_bug.cgi?id=142664
2672         <rdar://problem/18859470>
2673
2674         Reviewed by Benjamin Poulain.
2675
2676         * page/ViewportConfiguration.cpp:
2677         (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints):
2678         (WebCore::ViewportConfiguration::shouldIgnoreVerticalScalingConstraints):
2679         (WebCore::ViewportConfiguration::shouldIgnoreScalingConstraints):
2680         Split shouldIgnoreScalingConstraints into one for each dimension.
2681
2682         (WebCore::ViewportConfiguration::initialScale):
2683         (WebCore::ViewportConfiguration::minimumScale):
2684         Don't force the initial and minimum scales to cover the whole view if the
2685         page claims to want to lay out to device width but then lays out too big.
2686         This will allow pages that misbehave in this way to scale down further
2687         than they previously could, but will result in a region of empty background
2688         color being exposed at the initial/minimum scale.
2689
2690         (WebCore::ViewportConfiguration::description):
2691         Update the logging to show each dimension separately.
2692
2693         * page/ViewportConfiguration.h:
2694
2695 2015-03-13  Mark Lam  <mark.lam@apple.com>
2696
2697         Replace TCSpinLock with a new WTF::SpinLock based on WTF::Atomic.
2698         <https://webkit.org/b/142674>
2699
2700         Reviewed by Filip Pizlo.
2701
2702         No new tests because there is no new functionality. This is a refactoring effort.
2703
2704         * bindings/objc/WebScriptObject.mm:
2705         * platform/ios/wak/WAKWindow.mm:
2706         (-[WAKWindow initWithLayer:]):
2707         (-[WAKWindow initWithFrame:]):
2708
2709 2015-03-13  Doug Russell  <d_russell@apple.com>
2710
2711         AX: Provide API for assistive tech to ignore DOM key event handlers
2712         https://bugs.webkit.org/show_bug.cgi?id=142059
2713
2714         Reviewed by Beth Dakin.
2715
2716         Assistive technology applications on the desktop are heavily dependent on keyboard navigation being reliable. This is greatly hindered by sites that handle key events without updating keyboard selection and then consume the event. It is important for assistive technology apps to allow users to decide to ignore these handlers that are incorrect for their purposes.
2717
2718         This can be fixed by exposing, via a new accessibility attribute, a way to decide, for a given WebCore::Frame, to pre-empt DOM dispatch and instead let accessibility caret browsing take place.
2719
2720         Test: platform/mac/accessibility/prevent-keyboard-event-dispatch.html
2721
2722         * accessibility/AccessibilityObject.cpp:
2723         (WebCore::AccessibilityObject::preventKeyboardDOMEventDispatch):
2724         (WebCore::AccessibilityObject::setPreventKeyboardDOMEventDispatch):
2725         * accessibility/AccessibilityObject.h:
2726         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2727         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
2728         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2729         (-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
2730         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
2731         * dom/Element.cpp:
2732         (WebCore::Element::dispatchKeyEvent):
2733         * page/EventHandler.cpp:
2734         (WebCore::EventHandler::keyEvent):
2735         (WebCore::handleKeyboardSelectionMovement):
2736         (WebCore::EventHandler::handleKeyboardSelectionMovementForAccessibility):
2737         * page/EventHandler.h:
2738         * page/Settings.in:
2739
2740 2015-03-09  Conrad Shultz  <conrad_shultz@apple.com>
2741
2742         Allow clients to selectively disable plug-ins
2743         https://bugs.webkit.org/show_bug.cgi?id=142506
2744
2745         Reviewed by Anders Carlsson.
2746
2747         Add new functionality allow clients to declaratively disable individual plug-ins (in a manner that conceals them
2748         from the page). As part of this:
2749
2750         1) Introduce the concept of web-visible plug-ins and related concepts, as distinct from the real underlying
2751            set of plug-ins.
2752
2753         2) Where applicable, plumb additional information about plug-ins (specifically, bundle identification) deeper
2754            down the stack.
2755
2756         3) Add generic functionality to PluginStrategy to support filtering plug-ins for visibility and introduce
2757            a concrete implementation thereof in WebPlatformStrategies in WebKit2.
2758
2759         4) Add messaging infrastructure to allow clients to set and clear plug-in policies.
2760
2761         While currently only used in a very limited manner, the new declarative plug-in policies are written generically
2762         so that they could be easily used in the future to reduce synchronous messaging to the client when loading plug-ins.
2763
2764         * dom/DOMImplementation.cpp:
2765         (WebCore::DOMImplementation::createDocument):
2766         Update to reflect function rename.
2767
2768         * loader/SubframeLoader.cpp:
2769         (WebCore::findPluginMIMETypeFromURL):
2770         Adopt getWebVisibleMimesAndPluginIndices().
2771         (WebCore::logPluginRequest):
2772         Update to reflect function rename.
2773         (WebCore::SubframeLoader::shouldUsePlugin):
2774         Ditto.
2775
2776         * platform/PlatformStrategies.h:
2777         Export platformStrategies(), since it is now used in WebProcess.cpp.
2778
2779         * plugins/DOMMimeType.cpp:
2780         (WebCore::DOMMimeType::type):
2781         (WebCore::DOMMimeType::description):
2782         (WebCore::DOMMimeType::mimeClassInfo):
2783         Adopt getWebVisibleMimesAndPluginIndices().
2784         (WebCore::DOMMimeType::enabledPlugin):
2785         Ditto.
2786
2787         * plugins/DOMMimeType.h:
2788         Don't return references in a few places where it is no longer safe to do so.
2789         (WebCore::DOMMimeType::mimeClassInfo): Deleted.
2790
2791         * plugins/DOMMimeTypeArray.cpp:
2792         (WebCore::DOMMimeTypeArray::length):
2793         Adopt getWebVisibleMimesAndPluginIndices().
2794         (WebCore::DOMMimeTypeArray::item):
2795         Ditto.
2796         (WebCore::DOMMimeTypeArray::canGetItemsForName):
2797         Ditto.
2798         (WebCore::DOMMimeTypeArray::namedItem):
2799         Ditto.
2800
2801         * plugins/DOMPlugin.cpp:
2802         (WebCore::DOMPlugin::pluginInfo):
2803         Adopt getWebVisiblePlugins().
2804         (WebCore::DOMPlugin::item):
2805         Adopt getWebVisibleMimesAndPluginIndices().
2806         (WebCore::DOMPlugin::canGetItemsForName):
2807         Ditto.
2808         (WebCore::DOMPlugin::namedItem):
2809         Ditto.
2810
2811         * plugins/DOMPlugin.h:
2812         (WebCore::DOMPlugin::pluginInfo): Deleted.
2813
2814         * plugins/DOMPluginArray.cpp:
2815         (WebCore::DOMPluginArray::length):
2816         Adopt getWebVisiblePlugins().
2817         (WebCore::DOMPluginArray::item):
2818         Ditto.
2819         (WebCore::DOMPluginArray::canGetItemsForName):
2820         Ditto.
2821         (WebCore::DOMPluginArray::namedItem):
2822         Ditto.
2823
2824         * plugins/PluginData.cpp:
2825         (WebCore::PluginData::PluginData):
2826         Stash the passed-in Page and call initPlugins().
2827         (WebCore::PluginData::getWebVisiblePlugins):
2828         New member function; call through to PluginStrategy::getWebVisiblePluginInfo().
2829         (WebCore::PluginData::getWebVisibleMimesAndPluginIndices):
2830         New member function; build up the mimes and mimePluginIndices vectors in the same manner as before, but
2831         limited to the web-visible plug-ins.
2832         (WebCore::PluginData::supportsWebVisibleMimeType):
2833         Renamed from supportsMimeType(); update to work in terms of web-visible plug-ins.
2834         (WebCore::PluginData::pluginInfoForWebVisibleMimeType):
2835         Renamed from pluginInfoForMimeType(); ditto.
2836         (WebCore::PluginData::pluginNameForWebVisibleMimeType):
2837         Renamed from pluginNameForMimeType(); ditto.
2838         (WebCore::PluginData::pluginFileForWebVisibleMimeType):
2839         Renamed from pluginFileForMimeType(); ditto.
2840         (WebCore::PluginData::initPlugins):
2841         (WebCore::PluginData::supportsMimeType): Deleted.
2842         (WebCore::PluginData::pluginInfoForMimeType): Deleted.
2843         (WebCore::PluginData::pluginNameForMimeType): Deleted.
2844         (WebCore::PluginData::pluginFileForMimeType): Deleted.
2845
2846         * plugins/PluginData.h:
2847         Add a member variable for the associate Page; declare the PluginLoadClientPolicy enumeration; add
2848         new members to PluginInfo for the clientLoadPolicy and bundle information.
2849         (WebCore::PluginData::PluginData):
2850         Replace some member functions with new ones that will hide plug-ins upon request from the client;
2851         (WebCore::PluginData::mimes): Deleted.
2852         (WebCore::PluginData::mimePluginIndices): Deleted.
2853
2854         * plugins/PluginStrategy.h:
2855         Declare new member functions for retrieving web-visible plug-ins and setting/clearing plug-in policies.
2856
2857         * replay/SerializationMethods.cpp:
2858         (JSC::EncodingTraits<PluginData>::encodeValue):
2859         Remove now-obsolete code for handling MIME types and add a FIXME.
2860         (JSC::DeserializedPluginData::DeserializedPluginData):
2861         (JSC::EncodingTraits<PluginData>::decodeValue):
2862         Ditto.
2863         (JSC::EncodingTraits<PluginInfo>::encodeValue):
2864         Handle the new members in PluginInfo.
2865         (JSC::EncodingTraits<PluginInfo>::decodeValue):
2866         Ditto.
2867
2868         * replay/WebInputs.json:
2869         Teach Replay about PluginLoadClientPolicy.
2870
2871 2015-03-13  Chris Dumez  <cdumez@apple.com>
2872
2873         XMLHttpRequests should not prevent a page from entering PageCache
2874         https://bugs.webkit.org/show_bug.cgi?id=142612
2875         <rdar://problem/19923085>
2876
2877         Reviewed by Alexey Proskuryakov.
2878
2879         Make XMLHttpRequest ActiveDOMObjects suspendable in most cases to
2880         drastically improve the likelihood of pages using them to enter
2881         PageCache. XMLHttpRequest used to be only suspendable when not
2882         loading. After this patch, if the XMLHttpRequest is loading when
2883         navigating away from the page, it will be aborted and the page
2884         will enter the PageCache. Upon restoring the page from PageCache,
2885         the XMLHttpRequests' error handlers will be executed to give them
2886         a chance to reload if they want to.
2887
2888         Test: http/tests/navigation/page-cache-xhr.html
2889
2890         * history/PageCache.cpp:
2891         (WebCore::logCanCacheFrameDecision):
2892         (WebCore::PageCache::canCachePageContainingThisFrame):
2893         Do not prevent a page to enter the page cache ff the main document has
2894         an error that is a cancellation and all remaining subresource loaders
2895         are for XHR. We extend the pre-existing mechanism used on iOS, which
2896         allowed PageCaching if the remaining resource loads are for images.
2897
2898         * loader/DocumentLoader.cpp:
2899         (WebCore::areAllLoadersPageCacheAcceptable):
2900         Mark XHR loaders as PageCache acceptable.
2901
2902         * loader/DocumentThreadableLoader.cpp:
2903         (WebCore::DocumentThreadableLoader::isXMLHttpRequest):
2904         * loader/DocumentThreadableLoader.h:
2905         * loader/ThreadableLoader.h:
2906         * loader/cache/CachedResource.cpp:
2907         (WebCore::CachedResource::areAllClientsXMLHttpRequests):
2908         * loader/cache/CachedResource.h:
2909         * loader/cache/CachedResourceClient.h:
2910         (WebCore::CachedResourceClient::isXMLHttpRequest):
2911         * xml/XMLHttpRequest.cpp:
2912         (WebCore::XMLHttpRequest::XMLHttpRequest):
2913         (WebCore::XMLHttpRequest::createRequest):
2914         (WebCore::XMLHttpRequest::canSuspend):
2915         Report that we can suspend XMLHttpRequests as long as the window load
2916         event has already fired. If the window load event has not fired yet,
2917         it would be unsafe to cancel the load in suspend() as it would
2918         potentially cause arbitrary JS execution while suspending.
2919
2920         (WebCore::XMLHttpRequest::suspend):
2921         If suspending for PageCache and the request is currently loading, abort
2922         the load and mark that we should fire the error event upon restoring
2923         from PageCache.
2924
2925         (WebCore::XMLHttpRequest::resume):
2926         (WebCore::XMLHttpRequest::resumeTimerFired):
2927         Upon resuming, fire the error event in a timer if the load was aborted
2928         for suspending. We need to do this in a timer because we are not allowed
2929         to execute arbitrary JS inside resume().
2930
2931         (WebCore::XMLHttpRequest::stop):
2932         Add a assertion to make sure we are not firing event inside stop() as
2933         this would potentially cause arbitrary JS execution and it would be
2934         unsafe. It seems to me that our code is currently unsafe but the
2935         assertion does not seem to be hit by our current layout tests. I am
2936         adding the assertion as it would make it clear we have a bug and we
2937         need to fix it.
2938
2939         * xml/XMLHttpRequest.h:
2940
2941 2015-03-13  Joonghun Park  <jh718.park@samsung.com>
2942
2943         Fix Debug build error 'comparison is always true due to limited range of data type [-Werror=type-limits]'
2944         https://bugs.webkit.org/show_bug.cgi?id=142652
2945
2946         Reviewed by Csaba Osztrogonác.
2947
2948         No new tests, no behavior changes.
2949
2950         Now CSSPropertyID type is uint16_t, so propertyID >= 0 check is needed no more.
2951
2952         * css/CSSPrimitiveValue.cpp:
2953         (WebCore::propertyName):
2954         * css/makeprop.pl:
2955
2956 2015-03-12  Zan Dobersek  <zdobersek@igalia.com>
2957
2958         Remove DrawingBuffer
2959         https://bugs.webkit.org/show_bug.cgi?id=142641
2960
2961         Reviewed by Darin Adler.
2962
2963         Remove the DrawingBuffer class. Objects of this type were only held in the
2964         WebGLRenderingContext (later renamed to WebGLRenderingContextBase) on the
2965         Chromium port, with the relevant code removed in r147888. Since then, the
2966         m_drawingBuffer member variable has always been null.
2967
2968         * CMakeLists.txt:
2969         * PlatformEfl.cmake:
2970         * PlatformGTK.cmake:
2971         * WebCore.vcxproj/WebCore.vcxproj:
2972         * WebCore.vcxproj/WebCore.vcxproj.filters:
2973         * WebCore.xcodeproj/project.pbxproj:
2974         * html/canvas/WebGL2RenderingContext.cpp:
2975         (WebCore::WebGL2RenderingContext::copyTexImage2D):
2976         * html/canvas/WebGLRenderingContext.cpp:
2977         (WebCore::WebGLRenderingContext::copyTexImage2D):
2978         * html/canvas/WebGLRenderingContextBase.cpp:
2979         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
2980         (WebCore::WebGLRenderingContextBase::initializeNewContext):
2981         (WebCore::WebGLRenderingContextBase::destroyGraphicsContext3D):
2982         (WebCore::WebGLRenderingContextBase::markContextChanged):
2983         (WebCore::WebGLRenderingContextBase::clearIfComposited):
2984         (WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas):
2985         (WebCore::WebGLRenderingContextBase::paintRenderingResultsToImageData):
2986         (WebCore::WebGLRenderingContextBase::reshape):
2987         (WebCore::WebGLRenderingContextBase::drawingBufferWidth):
2988         (WebCore::WebGLRenderingContextBase::drawingBufferHeight):
2989         (WebCore::WebGLRenderingContextBase::activeTexture):
2990         (WebCore::WebGLRenderingContextBase::bindFramebuffer):
2991         (WebCore::WebGLRenderingContextBase::bindTexture):
2992         (WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
2993         (WebCore::WebGLRenderingContextBase::deleteFramebuffer):
2994         (WebCore::WebGLRenderingContextBase::disable):
2995         (WebCore::WebGLRenderingContextBase::enable):
2996         (WebCore::WebGLRenderingContextBase::getContextAttributes):
2997         (WebCore::WebGLRenderingContextBase::readPixels):
2998         (WebCore::WebGLRenderingContextBase::loseContextImpl):
2999         (WebCore::WebGLRenderingContextBase::getBoundFramebufferWidth):
3000         (WebCore::WebGLRenderingContextBase::getBoundFramebufferHeight):
3001         (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
3002         * html/canvas/WebGLRenderingContextBase.h:
3003         (WebCore::ScopedDrawingBufferBinder::ScopedDrawingBufferBinder): Deleted.
3004         (WebCore::ScopedDrawingBufferBinder::~ScopedDrawingBufferBinder): Deleted.
3005         * platform/graphics/GraphicsContext.h:
3006         * platform/graphics/GraphicsContext3D.h:
3007         * platform/graphics/cairo/DrawingBufferCairo.cpp: Removed.
3008         * platform/graphics/gpu/DrawingBuffer.cpp: Removed.
3009         * platform/graphics/gpu/DrawingBuffer.h: Removed.
3010         * platform/graphics/gpu/mac/DrawingBufferMac.mm: Removed.
3011         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3012         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
3013         (WebCore::GraphicsContext3D::paintRenderingResultsToImageData):
3014
3015 2015-03-12  Ryosuke Niwa  <rniwa@webkit.org>
3016
3017         REGRESSION(r180726): Removing an empty line at the end of textarea clears the entire texture
3018         https://bugs.webkit.org/show_bug.cgi?id=142646
3019
3020         Reviewed by Darin Adler.
3021
3022         The bug was caused by TypingCommand::deleteKeyPressed erroneously determining the editable root to be empty because
3023         Position::atStartOfTree returns true when it's anchored at a BR that is immediately below the root editable element.
3024
3025         Fixed the bug by replacing the use of the deprecated atFirstEditingPositionForNode by a code that understands modern
3026         position types such as PositionIsBeforeAnchor in atStartOfTree and atEndOfTree. These two functions will no longer
3027         return true when anchored before or after BR after this patch.
3028
3029         Test: editing/deleting/delete-empty-line-breaks-at-end-of-textarea.html
3030
3031         * dom/Position.cpp:
3032         (WebCore::Position::atStartOfTree):
3033         (WebCore::Position::atEndOfTree):
3034
3035 2015-03-12  Yusuke Suzuki  <utatane.tea@gmail.com>
3036
3037         Integrate MapData into JSMap and JSSet
3038         https://bugs.webkit.org/show_bug.cgi?id=142556
3039
3040         Reviewed by Filip Pizlo.
3041
3042         Now Set has SetData and it's different from MapData.
3043         And MapData/SetData are completely integrated into JSSet and JSMap.
3044         Structured-cloning algorithm need to be aware of these changes.
3045         And in the case of JSSet, since JSSet doesn't need dummy value for construction,
3046         Structured-cloning only serialize the keys in JSSet.
3047
3048         * ForwardingHeaders/runtime/MapDataInlines.h: Added.
3049         * bindings/js/SerializedScriptValue.cpp:
3050         (WebCore::CloneSerializer::serialize):
3051         (WebCore::CloneDeserializer::consumeCollectionDataTerminationIfPossible):
3052         (WebCore::CloneDeserializer::deserialize):
3053         (WebCore::CloneDeserializer::consumeMapDataTerminationIfPossible): Deleted.
3054
3055 2015-03-12  Dan Bernstein  <mitz@apple.com>
3056
3057         Finish up <rdar://problem/20086546> [Cocoa] Add an option to treat certificate chains with SHA1-signed certificates as insecure
3058
3059         Added back OS X bits that I couldn’t land initially in r181317 or had to remove in r181327.
3060
3061         * platform/network/mac/CertificateInfoMac.mm:
3062         (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
3063         * platform/spi/cocoa/SecuritySPI.h:
3064
3065 2015-03-12  Geoffrey Garen  <ggaren@apple.com>
3066
3067         REGRESSION: Crash under Heap::reportExtraMemoryAllocatedSlowCase for media element
3068         https://bugs.webkit.org/show_bug.cgi?id=142636
3069
3070         Reviewed by Mark Hahnenberg.
3071
3072         This was a pre-existing bug that I made a lot worse in
3073         <https://trac.webkit.org/changeset/181411>.
3074
3075         * html/HTMLMediaElement.cpp:
3076         (WebCore::HTMLMediaElement::parseAttribute): Compare size before
3077         subtracting rather than subtracting and then comparing to zero. The
3078         latter technique is not valid for unsigned integers, which will happily
3079         underflow into giant numbers.
3080
3081         * Modules/mediasource/SourceBuffer.cpp:
3082         (WebCore::SourceBuffer::reportExtraMemoryAllocated): This code was
3083          technically correct, but I took the opportunity to clean it up a bit.
3084          There's no need to do two checks here, and it smells bad to check for
3085          a negative unsigned integer.
3086
3087 2015-03-12  Sebastian Dröge  <sebastian@centricular.com>
3088
3089         Stop using single-include headers that are only available since GStreamer >= 1.2.
3090
3091         https://bugs.webkit.org/show_bug.cgi?id=142537
3092
3093         Reviewed by Philippe Normand.
3094
3095         * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
3096         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
3097         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
3098         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
3099         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
3100         * platform/graphics/gstreamer/GStreamerUtilities.h:
3101         * platform/graphics/gstreamer/ImageGStreamer.h:
3102         Instead of using single-include headers for the GStreamer libraries,
3103         directly include the headers we need. The single-include headers were
3104         only added in 1.2, and this would be the only reason why we would
3105         depend on 1.2.
3106
3107 2015-03-12  Eric Carlson  <eric.carlson@apple.com>
3108
3109         [Mac] Update AirPlay handling
3110         https://bugs.webkit.org/show_bug.cgi?id=142541
3111
3112         Unreviewed, respond to post-review comments.
3113
3114         * dom/Document.cpp:
3115         (WebCore::Document::didChoosePlaybackTarget):
3116         * page/ChromeClient.h:
3117         * page/Page.cpp:
3118         (WebCore::Page::showPlaybackTargetPicker):
3119         (WebCore::Page::didChoosePlaybackTarget):
3120         (WebCore::Page::configurePlaybackTargetMonitoring):
3121
3122 2015-03-12  Csaba Osztrogonác  <ossy@webkit.org>
3123
3124         Fix the !ENABLE(PICTURE_SIZES) build
3125         https://bugs.webkit.org/show_bug.cgi?id=142617
3126
3127         Reviewed by Darin Adler.
3128
3129         * html/parser/HTMLPreloadScanner.cpp:
3130         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
3131
3132 2015-03-11  Joseph Pecoraro  <pecoraro@apple.com>
3133
3134         Unreviewed follow-up fix to r181426. Initialize TextPosition with zeros in case it gets used.
3135
3136         Address ASSERT in LayoutTests/printing/page-format-data.html.
3137
3138         * dom/InlineStyleSheetOwner.cpp:
3139         (WebCore::InlineStyleSheetOwner::InlineStyleSheetOwner):
3140         In case the TextPosition gets used because it wasn't created by a parser,
3141         zeros are more realistic values then beforeFirst.
3142
3143 2015-03-11  Roger Fong  <roger_fong@apple.com>
3144
3145         Media element time no longer updates while scrubbing following r181279.
3146         https://bugs.webkit.org/show_bug.cgi?id=142606.
3147         <rdar://problem/20131014>
3148
3149         Reviewed by Eric Carlson.
3150
3151         * Modules/mediacontrols/mediaControlsApple.js:
3152         (Controller.prototype.handleWrapperMouseMove):
3153         Update time as a result of a mouse move if we are scrubbing.
3154
3155 2015-03-11  Joseph Pecoraro  <pecoraro@apple.com>
3156
3157         Web Inspector: CSS parser errors in the console should include column numbers
3158         https://bugs.webkit.org/show_bug.cgi?id=114313
3159
3160         Reviewed by Darin Adler.
3161
3162         Test: inspector-protocol/console/warnings-errors.html
3163
3164         * css/CSSParser.h:
3165         (WebCore::CSSParser::currentCharacterOffset):
3166         Get the current character offset depending on the source type.
3167         Add instance variables to track column position and start
3168         line / column for inline stylesheets.
3169
3170         * css/CSSParser.cpp:
3171         (WebCore::CSSParser::CSSParser):
3172         (WebCore::CSSParser::parseSheet):
3173         Initialize new instance variables.
3174
3175         (WebCore::CSSParser::currentLocation):
3176         Update to include column information for the token. Also, if we are on the
3177         first line we may need to take into account a start column offset as well.
3178
3179         (WebCore::CSSParser::realLex):
3180         Set the token's start column.
3181         When bumping the line number, reset the column offset for the next
3182         line with the next character.
3183
3184         (WebCore::CSSParser::syntaxError):
3185         (WebCore::CSSParser::logError):
3186         Include column information.
3187
3188         * css/StyleSheetContents.cpp:
3189         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
3190         (WebCore::StyleSheetContents::parseString):
3191         (WebCore::StyleSheetContents::parseStringAtPosition):
3192         Include column information.
3193
3194         * css/StyleSheetContents.h:
3195         * dom/InlineStyleSheetOwner.cpp:
3196         (WebCore::InlineStyleSheetOwner::InlineStyleSheetOwner):
3197         (WebCore::InlineStyleSheetOwner::createSheet):
3198         Save and use column information later on.
3199
3200         * dom/InlineStyleSheetOwner.h:
3201         * inspector/InspectorStyleSheet.cpp:
3202         (WebCore::InspectorStyleSheet::ensureSourceData):
3203         Updated parser signature needs starting column and no longer has optional parameters.
3204
3205 2015-03-11  Eric Carlson  <eric.carlson@apple.com>
3206
3207         [Mac] Update AirPlay handling
3208         https://bugs.webkit.org/show_bug.cgi?id=142541
3209
3210         Reviewed by Sam Weinig.
3211
3212         * WebCore.xcodeproj/project.pbxproj:
3213         * dom/Document.cpp:
3214         (WebCore::Document::showPlaybackTargetPicker):
3215         (WebCore::Document::addPlaybackTargetPickerClient):
3216         (WebCore::Document::removePlaybackTargetPickerClient):
3217         (WebCore::Document::configurePlaybackTargetMonitoring):
3218         (WebCore::Document::requiresPlaybackTargetRouteMonitoring):
3219         (WebCore::Document::playbackTargetAvailabilityDidChange):
3220         (WebCore::Document::didChoosePlaybackTarget):
3221         * dom/Document.h:
3222         * html/HTMLMediaElement.cpp:
3223         (WebCore::HTMLMediaElement::registerWithDocument):
3224         (WebCore::HTMLMediaElement::unregisterWithDocument):
3225         (WebCore::HTMLMediaElement::parseAttribute):
3226         * html/HTMLMediaElement.h:
3227         * html/HTMLMediaSession.cpp:
3228         (WebCore::HTMLMediaSession::HTMLMediaSession):
3229         (WebCore::HTMLMediaSession::registerWithDocument):
3230         (WebCore::HTMLMediaSession::unregisterWithDocument):
3231         (WebCore::HTMLMediaSession::showPlaybackTargetPicker):
3232         (WebCore::HTMLMediaSession::hasWirelessPlaybackTargets):
3233         (WebCore::HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners):
3234         (WebCore::HTMLMediaSession::didChoosePlaybackTarget):
3235         (WebCore::HTMLMediaSession::externalOutputDeviceAvailableDidChange):
3236         (WebCore::HTMLMediaSession::requiresPlaybackTargetRouteMonitoring):
3237         * html/HTMLMediaSession.h:
3238         * page/ChromeClient.h:
3239         * page/Page.cpp:
3240         (WebCore::Page::didChoosePlaybackTarget):
3241         (WebCore::Page::playbackTargetAvailabilityDidChange):
3242         (WebCore::Page::configurePlaybackTargetMonitoring):
3243         * page/Page.h:
3244         (WebCore::Page::hasWirelessPlaybackTarget):
3245         (WebCore::Page::playbackTarget):
3246         * platform/audio/MediaSession.cpp:
3247         (WebCore::MediaSession::clientDataBufferingTimerFired):
3248         (WebCore::MediaSession::wirelessRoutesAvailableDidChange): Deleted.
3249         * platform/audio/MediaSession.h:
3250         (WebCore::MediaSession::didChoosePlaybackTarget):
3251         (WebCore::MediaSession::externalOutputDeviceAvailableDidChange):
3252         (WebCore::MediaSession::requiresPlaybackTargetRouteMonitoring):
3253         (WebCore::MediaSessionClient::setWirelessPlaybackTarget):
3254         * platform/audio/MediaSessionManager.cpp:
3255         (WebCore::MediaSessionManager::wirelessRoutesAvailableChanged): Deleted.
3256         * platform/audio/MediaSessionManager.h:
3257         (WebCore::MediaSessionManager::configureWireLessTargetMonitoring):
3258         * platform/audio/ios/MediaSessionManagerIOS.h:
3259         * platform/audio/ios/MediaSessionManagerIOS.mm:
3260         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
3261         (-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]):
3262         * platform/graphics/AVPlaybackTarget.h: Added.
3263         (WebCore::AVPlaybackTarget::~AVPlaybackTarget):
3264         (WebCore::AVPlaybackTarget::AVPlaybackTarget):
3265         (WebCore::AVPlaybackTarget::setDevicePickerContext):
3266         (WebCore::AVPlaybackTarget::devicePickerContext):
3267         * platform/graphics/AVPlaybackTargetPickerClient.h: Added.
3268         (WebCore::AVPlaybackTargetPickerClient::~AVPlaybackTargetPickerClient):
3269         * platform/graphics/MediaPlayer.cpp:
3270         (WebCore::MediaPlayer::setWirelessPlaybackTarget):
3271         * platform/graphics/MediaPlayer.h:
3272         * platform/graphics/MediaPlayerPrivate.h:
3273         (WebCore::MediaPlayerPrivateInterface::setWirelessPlaybackTarget):
3274         * platform/graphics/avfoundation/AVPlaybackTargetMac.mm: Added.
3275         (WebCore::AVPlaybackTarget::encode):
3276         (WebCore::AVPlaybackTarget::decode):
3277         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3278         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3279         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
3280         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
3281         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
3282         (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless):
3283         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType):
3284         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled):
3285         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled):
3286         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
3287         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
3288         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
3289
3290 2015-03-11  Alex Christensen  <achristensen@webkit.org>
3291
3292         [Content Extensions] Add resource type and load type triggers.
3293         https://bugs.webkit.org/show_bug.cgi?id=142422
3294
3295         Reviewed by Benjamin Poulain.
3296
3297         New API tests.
3298
3299         * WebCore.xcodeproj/project.pbxproj:
3300         * contentextensions/ContentExtensionCompiler.cpp:
3301         (WebCore::ContentExtensions::compileRuleList):
3302         * contentextensions/ContentExtensionParser.cpp:
3303         (WebCore::ContentExtensions::getTypeFlags):
3304         (WebCore::ContentExtensions::loadTrigger):
3305         * contentextensions/ContentExtensionRule.h:
3306         * contentextensions/ContentExtensionsBackend.cpp:
3307         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
3308         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL): Deleted.
3309         * contentextensions/ContentExtensionsBackend.h:
3310         * contentextensions/DFABytecode.h:
3311         (WebCore::ContentExtensions::instructionSizeWithArguments):
3312         * contentextensions/DFABytecodeCompiler.cpp:
3313         (WebCore::ContentExtensions::DFABytecodeCompiler::emitAppendConditionalAction):
3314         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
3315         * contentextensions/DFABytecodeCompiler.h:
3316         * contentextensions/DFABytecodeInterpreter.cpp:
3317         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
3318         * contentextensions/DFABytecodeInterpreter.h:
3319         * loader/ResourceLoadInfo.cpp: Added.
3320         (WebCore::toResourceType):
3321         (WebCore::readResourceType):
3322         (WebCore::readLoadType):
3323         (WebCore::ResourceLoadInfo::isThirdParty):
3324         (WebCore::ResourceLoadInfo::getResourceFlags):
3325         * loader/ResourceLoadInfo.h: Added.
3326         * loader/cache/CachedResourceLoader.cpp:
3327         (WebCore::CachedResourceLoader::requestResource):
3328         * page/UserContentController.cpp:
3329         (WebCore::UserContentController::actionsForResourceLoad):
3330         (WebCore::UserContentController::actionsForURL): Deleted.
3331         * page/UserContentController.h:
3332
3333 2015-03-11  Tim Horton  <timothy_horton@apple.com>
3334
3335         Fix the build.
3336
3337         * page/EventHandler.cpp:
3338         (WebCore::EventHandler::selectClosestWordFromHitTestResult):
3339         (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent):
3340         (WebCore::EventHandler::handleMousePressEventTripleClick):
3341         (WebCore::EventHandler::handleMousePressEventSingleClick):
3342
3343 2015-03-11  Timothy Horton  <timothy_horton@apple.com>
3344
3345         <attachment> shouldn't use "user-select: all"
3346         https://bugs.webkit.org/show_bug.cgi?id=142453
3347
3348         Reviewed by Darin Adler.
3349
3350         It turns out that "user-select: all" is rife with bugs; in lieu of fixing them
3351         all (at least for now), let's not use "user-select: all" in the default stylesheet
3352         for <attachment>. It's really overkill anyway, since <attachment> can't have children.
3353         The only "user-select: all" behavior we actually want is select-on-click.
3354         So, we'll implement that in a slightly different way.
3355
3356         Tests: fast/attachment/attachment-select-on-click-inside-user-select-all.html
3357                fast/attachment/attachment-select-on-click.html
3358
3359         * css/html.css:
3360         (attachment):
3361         No more "user-select: all".
3362
3363         (attachment:focus): Deleted.
3364         We stopped using attachment focus a while back and forgot to remove this.
3365
3366         * dom/Node.h:
3367         (WebCore::Node::shouldSelectOnMouseDown):
3368         Add a virtual function that Node subclasses can override to indicate they
3369         should be selected on mouse down.
3370
3371         * html/HTMLAttachmentElement.h:
3372         Override the aforementioned virtual function; <attachment> should always
3373         be selected on mouse down.
3374
3375         * page/EventHandler.cpp:
3376         (WebCore::nodeToSelectOnMouseDownForNode):
3377         Determine which node should be selected when a mousedown hits the given node.
3378         If there's any "user-select: all", we go with the outermost "user-select: all".
3379         Otherwise, we give the node a chance to say that it wants to be selected itself.
3380
3381         (WebCore::expandSelectionToRespectSelectOnMouseDown):