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