808d458ff9f361daf7aedceb044197be3881a778
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2013-05-30  Seokju Kwon  <seokju.kwon@gmail.com>
2
3         Remove obsolete forward declaration from InspectorFrontendHost.h
4         https://bugs.webkit.org/show_bug.cgi?id=117017
5
6         Reviewed by Joseph Pecoraro.
7
8         Remove obsolete forward declaration and fix style issue as well.
9
10         No change in behavior, no new tests.
11
12         * inspector/InspectorFrontendHost.h:
13         (WebCore):
14         (InspectorFrontendHost):
15
16 2013-05-29  Tim Horton  <timothy_horton@apple.com>
17
18         Expose incrementalRenderingSuppressionTimeout via WK2
19         https://bugs.webkit.org/show_bug.cgi?id=117015
20         <rdar://problem/13992853>
21
22         Reviewed by Darin Adler.
23
24         * dom/Document.cpp:
25         (WebCore::Document::setVisualUpdatesAllowed):
26         Inform the FrameLoader that we're ready to transition the page, if
27         nothing else already has. This will be forwarded to the FrameLoaderClient,
28         and WebKit2's implementation will go ahead and un-freeze the layer tree,
29         so that the incremental rendering suppression watchdog timer actually works.
30
31         (WebCore::Document::setVisualUpdatesAllowedByClient):
32         Make incremental rendering suppression extension tokens play nice with the
33         watchdog timer; allow setVisualUpdatesAllowedByClient=true to re-enable updates
34         if either the page is in the "completed" state or the watchdog has already fired.
35
36         * loader/FrameLoader.cpp:
37         * loader/FrameLoader.h:
38         (WebCore::FrameLoader::forcePageTransitionIfNeeded): Added.
39         Forward to the client.
40
41         * loader/FrameLoaderClient.h:
42         (WebCore::FrameLoaderClient::forcePageTransitionIfNeeded): Added.
43
44 2013-05-29  Praveen R Jadhav  <praveen.j@samsung.com>
45
46         ProgressEvent should not be cancelable
47         https://bugs.webkit.org/show_bug.cgi?id=114444
48
49         Reviewed by Darin Adler.
50
51         Parameter "cancelable" in ProgressEvent is set to false, by default, as mentioned in the specification. The spec link is given below.
52
53         Spec: http://www.w3.org/TR/2011/CR-progress-events-20110922/#suggested-names-for-events-using-the-progressevent-interface
54
55         No new tests. file-reader-event-listener.html and infoOnProgressEvent-expected.txt are updated.
56
57         * dom/ProgressEvent.cpp:
58         (WebCore::ProgressEvent::ProgressEvent):
59         (WebCore):
60
61 2013-05-29  Simon Fraser  <simon.fraser@apple.com>
62
63         Fix paint-related milestones to not fire when the layer tree is frozen
64         https://bugs.webkit.org/show_bug.cgi?id=117012
65
66         Reviewed by Tim Horton.
67
68         In the previous code, it was possible to paint some layer and schedule
69         the m_paintRelatedMilestonesTimer, but then the layer tree was put into
70         a frozen state because the page redirected. However, the paint-related
71         milestones timer would still fire. This caused woes with header/footer
72         banners.
73         
74         Fix by not firing paint-related milestones if the layer tree is frozen,
75         which we know via a new ChromeClient callback. When unfrozen, we'll
76         paint again, and fire the timer later.
77
78         * page/ChromeClient.h:
79         (WebCore::ChromeClient::layerTreeStateIsFrozen):
80         * rendering/RenderLayerCompositor.cpp:
81         (WebCore::RenderLayerCompositor::paintRelatedMilestonesTimerFired):
82
83 2013-05-29  Ryosuke Niwa  <rniwa@webkit.org>
84
85         Store form control list with RefPtr
86         https://bugs.webkit.org/show_bug.cgi?id=116910
87
88         Reviewed by Kent Tamura.
89
90         Merge https://chromium.googlesource.com/chromium/blink/+/582132773280455ead1d42b0073be37efdeaf989.
91
92         Unfortunately, the Blink change doesn't provide much insight as to what kind of crashes are fixed
93         by this code change but it cleans up the way form elements with state are registered to the form
94         controller so it seems benefitial to merge it anyway.
95
96         * dom/Document.cpp:
97         (WebCore::Document::dispose):
98         * html/FormController.cpp:
99         (WebCore::FormController::createSavedFormStateMap):
100         (WebCore::FormController::registerFormElementWithState):
101         (WebCore::FormController::unregisterFormElementWithState):
102         (WebCore):
103         * html/FormController.h:
104         (FormController):
105         * html/HTMLFormControlElementWithState.cpp:
106         (WebCore::HTMLFormControlElementWithState::HTMLFormControlElementWithState):
107         (WebCore::HTMLFormControlElementWithState::~HTMLFormControlElementWithState):
108         (WebCore::HTMLFormControlElementWithState::insertedInto):
109         (WebCore):
110         (WebCore::HTMLFormControlElementWithState::removedFrom):
111         * html/HTMLFormControlElementWithState.h:
112         (HTMLFormControlElementWithState):
113         * html/HTMLTextFormControlElement.cpp:
114         (WebCore::HTMLTextFormControlElement::insertedInto):
115
116 2013-05-29  Andreas Kling  <akling@apple.com>
117
118         Take ComputedStyleExtractor for a spin.
119         <http://webkit.org/b/116968>
120
121         Reviewed by Antti Koivisto.
122
123         Convert some editing and SVG code to use ComputedStyleExtractor instead of creating full
124         blown CSSComputedStyleDeclaration objects.
125
126         * editing/ApplyStyleCommand.cpp:
127         (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
128         (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
129         (WebCore::highestEmbeddingAncestor):
130         (WebCore::ApplyStyleCommand::computedFontSize):
131         * editing/EditingStyle.cpp:
132         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
133         (WebCore::EditingStyle::textDirectionForSelection):
134         (WebCore::getIdentifierValue):
135         (WebCore::backgroundColorInEffect):
136         * editing/EditingStyle.h:
137         * svg/SVGAnimationElement.cpp:
138         (WebCore::SVGAnimationElement::computeCSSPropertyValue):
139
140 2013-05-29  Benjamin Poulain  <bpoulain@apple.com>
141
142         Add a special case for SelectorDataList::execute when there is only one selector
143         https://bugs.webkit.org/show_bug.cgi?id=116891
144
145         Reviewed by Andreas Kling.
146
147         In the vast majority of cases, querySelector is called with a single selector.
148
149         This patch takes that input into account to improve the performance of
150         SelectorDataList::execute(). For the case of a single selector, we avoid three
151         branches executed for every node of the traversal.
152
153         This improves QuerySelector's time by 2.3%.
154
155         * dom/SelectorQuery.cpp:
156         (WebCore::SelectorDataList::execute):
157
158 2013-05-29  Dean Jackson  <dino@apple.com>
159
160         -webkit-text-underline-position should not be inherited
161         https://bugs.webkit.org/show_bug.cgi?id=116363
162
163         Reverting http://trac.webkit.org/changeset/150366
164         It was an incorrect fix referring to an old specification.
165
166         * css/CSSProperty.cpp:
167         (WebCore::CSSProperty::isInheritedProperty):
168         * rendering/style/RenderStyle.h:
169         * rendering/style/StyleRareInheritedData.cpp:
170         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
171         (WebCore::StyleRareInheritedData::operator==):
172         * rendering/style/StyleRareInheritedData.h:
173         (StyleRareInheritedData):
174         * rendering/style/StyleRareNonInheritedData.cpp:
175         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
176         (WebCore::StyleRareNonInheritedData::operator==):
177         * rendering/style/StyleRareNonInheritedData.h:
178         (StyleRareNonInheritedData):
179
180 2013-05-29  Ryuan Choi  <ryuan.choi@samsung.com>
181
182         [CMAKE] cmake errors when CMAKE_BUILD_TYPE is not specified.
183         https://bugs.webkit.org/show_bug.cgi?id=116899
184
185         Reviewed by Laszlo Gombos.
186
187         * CMakeLists.txt: Fixed if statement to escape when find command fails.
188
189 2013-05-28  Oliver Hunt  <oliver@apple.com>
190
191         Add more accurate activity state tracking
192         https://bugs.webkit.org/show_bug.cgi?id=116893
193
194         Reviewed by Gavin Barraclough.
195
196         Add a hysteresis to Page activity throttling.  We do this
197         through a PageThrottler class that now handles entering and
198         exiting throttling state, and adds a hysteresis to we can
199         limit the amount of on/off bouncing on the throttle.
200
201         Media elements now make use of this to disable timer throttling
202         while they are playing, and plugins use it to momentarily bounce
203         from throttled to unthrottled state.
204
205         * CMakeLists.txt:
206         * GNUmakefile.list.am:
207         * Target.pri:
208         * WebCore.exp.in:
209         * WebCore.vcproj/WebCore.vcproj:
210         * WebCore.vcxproj/WebCore.vcxproj:
211         * WebCore.vcxproj/WebCore.vcxproj.filters:
212         * WebCore.xcodeproj/project.pbxproj:
213         * html/HTMLMediaElement.cpp:
214         (WebCore::HTMLMediaElement::~HTMLMediaElement):
215         (WebCore::HTMLMediaElement::pageThrottlerIfPossible):
216         (WebCore):
217         (WebCore::HTMLMediaElement::playInternal):
218         (WebCore::HTMLMediaElement::pauseInternal):
219         * html/HTMLMediaElement.h:
220         (WebCore):
221         * html/MediaController.cpp:
222         (MediaController::unpause):
223         * page/ChromeClient.h:
224         (WebCore::ChromeClient::incrementActivePageCount):
225         (WebCore::ChromeClient::decrementActivePageCount):
226         (ChromeClient):
227         * page/Page.cpp:
228         (WebCore::Page::Page):
229         (WebCore::Page::~Page):
230         (WebCore::Page::setThrottled):
231         * page/Page.h:
232         (WebCore):
233         (Page):
234         (WebCore::Page::pageThrottler):
235         * page/PageThrottleState.h: Added.
236         * page/PageThrottler.cpp: Added.
237         (WebCore):
238         (WebCore::PageThrottler::PageThrottler):
239         (WebCore::PageThrottler::~PageThrottler):
240         (WebCore::PageThrottler::clearPage):
241         (WebCore::PageThrottler::throttlePage):
242         (WebCore::PageThrottler::unthrottlePage):
243         (WebCore::PageThrottler::setThrottled):
244         (WebCore::PageThrottler::preventThrottling):
245         (WebCore::PageThrottler::allowThrottling):
246         (WebCore::PageThrottler::stopThrottleHysteresisTimer):
247         (WebCore::PageThrottler::reportInterestingEvent):
248         (WebCore::PageThrottler::startThrottleHysteresisTimer):
249         (WebCore::PageThrottler::throttleHysteresisTimerFired):
250         * page/PageThrottler.h: Added.
251         (WebCore):
252         (PageThrottler):
253         (WebCore::PageThrottler::create):
254         (WebCore::PageThrottler::shouldThrottleAnimations):
255         (WebCore::PageThrottler::shouldThrottleTimers):
256
257 2013-05-29  Kent Tamura  <tkent@chromium.org>
258
259         Remove leftover files for ENABLE_PAGE_POPUP and ENABLE_CALENDAR_PICKER
260         https://bugs.webkit.org/show_bug.cgi?id=116999
261
262         Reviewed by Anders Carlsson.
263
264         * Resources/pagepopups/colorSuggestionPicker.css: Removed.
265         * Resources/pagepopups/colorSuggestionPicker.js: Removed.
266         * Resources/pagepopups/pickerCommon.css: Removed.
267         * Resources/pagepopups/pickerCommon.js: Removed.
268         * Resources/pagepopups/suggestionPicker.css: Removed.
269         * Resources/pagepopups/suggestionPicker.js: Removed.
270
271 2013-05-29  Jer Noble  <jer.noble@apple.com>
272
273         Unreviewed build fix; remove unintentional semicolon.
274
275         * Modules/webaudio/AudioScheduledSourceNode.cpp:
276         (WebCore::AudioScheduledSourceNode::finish):
277
278 2013-05-29  Anders Carlsson  <andersca@apple.com>
279
280         Merge PODArea::Chunk into PODFreeListArena::FreeListChunk
281         https://bugs.webkit.org/show_bug.cgi?id=117000
282
283         Reviewed by Oliver Hunt.
284
285         * platform/PODArena.h:
286         (WebCore::PODArena::roundUp):
287         * platform/PODFreeListArena.h:
288         (PODFreeListArena):
289         (WebCore::PODFreeListArena::FreeListChunk::FreeListChunk):
290         (FreeListChunk):
291         (WebCore::PODFreeListArena::FreeListChunk::~FreeListChunk):
292         (WebCore::PODFreeListArena::FreeListChunk::allocate):
293
294 2013-05-29  Anders Carlsson  <andersca@apple.com>
295
296         Move some PODArena members to PODFreeListArena
297         https://bugs.webkit.org/show_bug.cgi?id=116993
298
299         Reviewed by Sam Weinig.
300
301         This is more work towards merging the two classes.
302
303         * platform/PODArena.h:
304         (PODArena):
305         * platform/PODFreeListArena.h:
306         (PODFreeListArena):
307         (WebCore::PODFreeListArena::PODFreeListArena):
308
309 2013-05-29  Jer Noble  <jer.noble@apple.com>
310
311         [Mac] Scrubbing long movie files results in timeline snapping back to 0 during scrub.
312         https://bugs.webkit.org/show_bug.cgi?id=116986
313
314         Reviewed by Eric Carlson.
315
316         Keep a count of the number of in-flight seek requests, and only issue a timeupdate
317         (which triggers a "seeked" event) when the final seek completes.
318
319         Test: media/video-seek-multiple.html
320
321         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
322         (WebCore::MediaPlayerPrivateAVFoundation::seek):
323         (WebCore::MediaPlayerPrivateAVFoundation::seekCompleted):
324         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
325         (MediaPlayerPrivateAVFoundation):
326
327 2013-05-29  Anders Carlsson  <andersca@apple.com>
328
329         Remove unused code from PODArena
330         https://bugs.webkit.org/show_bug.cgi?id=116990
331
332         Reviewed by Sam Weinig.
333
334         PODArena is only used as a base class of PODFreeListArena so remove unused member functions and make all
335         members protected to make it impossible to use it without subclassing.
336
337         PODArena is a risky class to use since it doesn't return memory to the system unless the arena object is destroyed.
338         This was the reason why PODFreeListArea was added. An upcoming patch will merge PODArena with PODFreeListArena and
339         this is a small step towards that goal.
340
341         * platform/PODArena.h:
342
343 2013-05-29  Darin Adler  <darin@apple.com>
344
345         Remove custom binding for Clipboard setDragImage function
346         https://bugs.webkit.org/show_bug.cgi?id=116422
347
348         Reviewed by Sam Weinig.
349
350         * bindings/js/JSClipboardCustom.cpp: Removed setDragImage binding.
351
352         * dom/Clipboard.cpp:
353         (WebCore::Clipboard::canSetDragImage): Added a condition that this is a drag
354         and drop clipboard. That used to be checked in the setDragImage binding.
355         (WebCore::Clipboard::setDragImage): Added a version that takes an Element
356         and calls through to the existing functions (in the legacy code path), or handles
357         both the Element and HTMLImageElement not-in-document cases (in the new code path).
358
359         * dom/Clipboard.h: Updated for changes above.
360
361         * dom/Clipboard.idl: Removed [Custom] from setDragImage.
362
363         * page/EventHandler.cpp:
364         (WebCore::EventHandler::handleDrag): Call the new setDragImage instead of the
365         old setDragImageElement.
366
367 2013-05-29  Praveen R Jadhav  <praveen.j@samsung.com>
368
369         Cleanup AudioSourceNode.idl from WebKit build.
370         https://bugs.webkit.org/show_bug.cgi?id=116905.
371
372         Reviewed by Darin Adler.
373
374         AudioSourceNode.idl is not part of WebAudio Specifications anymore.
375         AudioNode is inherited directly in all the audio source nodes.
376
377         No new tests. Current test cases will cover all the scenarios.
378
379         * CMakeLists.txt:
380         * DerivedSources.make:
381         * DerivedSources.pri:
382         * GNUmakefile.list.am:
383         * Modules/webaudio/AudioBufferSourceNode.h:
384         * Modules/webaudio/AudioBufferSourceNode.idl:
385         * Modules/webaudio/AudioScheduledSourceNode.cpp:
386         (WebCore::AudioScheduledSourceNode::AudioScheduledSourceNode):
387         * Modules/webaudio/AudioScheduledSourceNode.h:
388         * Modules/webaudio/AudioSourceNode.h: Removed.
389         * Modules/webaudio/AudioSourceNode.idl: Removed.
390         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
391         (WebCore::MediaElementAudioSourceNode::MediaElementAudioSourceNode):
392         * Modules/webaudio/MediaElementAudioSourceNode.h:
393         (MediaElementAudioSourceNode):
394         * Modules/webaudio/MediaElementAudioSourceNode.idl:
395         * Modules/webaudio/MediaStreamAudioDestinationNode.idl:
396         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
397         (WebCore::MediaStreamAudioSourceNode::MediaStreamAudioSourceNode):
398         * Modules/webaudio/MediaStreamAudioSourceNode.h:
399         (MediaStreamAudioSourceNode):
400         * Modules/webaudio/MediaStreamAudioSourceNode.idl:
401         * Modules/webaudio/OscillatorNode.h:
402         * Modules/webaudio/OscillatorNode.idl:
403         * Target.pri:
404         * WebCore.xcodeproj/project.pbxproj:
405
406 2013-05-29  Adam Barth  <abarth@webkit.org>
407
408         Optimize RenderText::offsetNext for 8 bit strings
409         https://bugs.webkit.org/show_bug.cgi?id=116877
410
411         Reviewed by Darin Adler.
412
413         Previously, this function was always upconverting strings to 16 bits in
414         order to create a cursorMovementIterator. This patch adds a fast path
415         for ASCII and Latin-1 strings, which don't need this complicated cursor
416         movement logic.
417
418         I ran into this code because nextOffset showed up as a memory pig on a
419         memory profile of Mobile Gmail.
420
421         Test: editing/selection/move-by-character-brute-force.html
422
423         * rendering/RenderText.cpp:
424         (WebCore::RenderText::previousOffset):
425         (WebCore::RenderText::nextOffset):
426
427 2013-05-29  Brent Fulgham  <bfulgham@apple.com>
428
429         [Windows] Correct copy command (form versus forms)
430
431         * WebCore.vcproj/copyForwardingHeaders.cmd:
432         * WebCore.vcxproj/copyForwardingHeaders.cmd:
433
434 2013-05-29  Bem Jones-Bey  <bjonesbe@adobe.com>
435
436         [CSS Shapes] Fix style issues in BasicShapes
437         https://bugs.webkit.org/show_bug.cgi?id=116734
438
439         Reviewed by Alexandru Chiculita.
440
441         Fix indentation in BasicShapes.cpp, and change enums to respect the
442         style rules CamelCase instead of HAVING_UNDERSCORES.
443
444         No new tests, only style changes.
445
446         * css/BasicShapeFunctions.cpp:
447         (WebCore::valueForBasicShape):
448         (WebCore::basicShapeForValue):
449         * css/CSSBasicShapes.cpp:
450         (WebCore::buildRectangleString):
451         (WebCore::CSSBasicShapeRectangle::equals):
452         (WebCore::CSSBasicShapeCircle::equals):
453         (WebCore::CSSBasicShapeEllipse::equals):
454         (WebCore::CSSBasicShapePolygon::equals):
455         (WebCore::CSSBasicShapeInsetRectangle::equals):
456         * css/CSSBasicShapes.h:
457         (WebCore::CSSBasicShapeRectangle::type):
458         (WebCore::CSSBasicShapeInsetRectangle::type):
459         (WebCore::CSSBasicShapeCircle::type):
460         (WebCore::CSSBasicShapeEllipse::type):
461         (WebCore::CSSBasicShapePolygon::type):
462         * rendering/ExclusionShape.cpp:
463         (WebCore::ExclusionShape::createExclusionShape):
464         * rendering/ExclusionShapeInsideInfo.cpp:
465         (WebCore::ExclusionShapeInsideInfo::isEnabledFor):
466         * rendering/ExclusionShapeOutsideInfo.cpp:
467         (WebCore::ExclusionShapeOutsideInfo::isEnabledFor):
468         * rendering/style/BasicShapes.cpp:
469         (WebCore::BasicShape::canBlend):
470         (WebCore::BasicShapeRectangle::path):
471         (WebCore::BasicShapeCircle::path):
472         (WebCore::BasicShapeEllipse::path):
473         (WebCore::BasicShapeInsetRectangle::path):
474         * rendering/style/BasicShapes.h:
475         (WebCore::BasicShapeRectangle::type):
476         (WebCore::BasicShapeCircle::type):
477         (WebCore::BasicShapeEllipse::type):
478         (WebCore::BasicShapePolygon::type):
479         (WebCore::BasicShapeInsetRectangle::type):
480
481 2013-05-29  Otto Derek Cheung  <otcheung@rim.com>
482
483         [BlackBerry] Handle Host-Only cookies
484         https://bugs.webkit.org/show_bug.cgi?id=116969
485
486         PR 338809
487         Reviewed by Rob Buis.
488         Internally Reviewed by Joe Mason.
489
490         Adding support for host-only cookies (cookies with no
491         specified domains). These cookies should only be returned
492         when the host matches the cookie domain exactly.
493
494         Tested using Opera and Browser cookie test suite. Tested
495         that host cookies are being stored in it's own map using
496         Web Inspector.
497
498         * platform/blackberry/CookieManager.cpp:
499         (WebCore::CookieManager::getRawCookies):
500         (WebCore::CookieManager::checkAndTreatCookie):
501         (WebCore::CookieManager::findOrCreateCookieMap):
502         * platform/blackberry/CookieParser.cpp:
503         (WebCore::CookieParser::CookieParser):
504         (WebCore::CookieParser::parseOneCookie):
505         * platform/blackberry/ParsedCookie.h:
506         (WebCore::ParsedCookie::isHostOnly):
507         (ParsedCookie):
508
509 2013-05-29  Ryosuke Niwa  <rniwa@webkit.org>
510
511         Remove the size of DataVector in HTMLToken
512         https://bugs.webkit.org/show_bug.cgi?id=116931
513
514         Reviewed by Sam Weinig.
515
516         Merge https://chromium.googlesource.com/chromium/blink/+/7977721e62c471bfa17b84d82cd5d8243a4eb9a9.
517
518         Shink HTMLToken by 1.5 kB
519
520         HTMLToken has an inline vector for buffering characters during tokenization. We
521         originally picked the inline capacity of this buffer somewhat arbitrarily. This
522         CL tunes the number based on a somewhat non-scientific browse of a number of
523         popular web sites.
524
525         I (abarth) instrumented content_shell to log the length of each complete DataVector. I
526         then browsed around a variety of web sites to collect data. The 99% percentile
527         of DataVector lengths was just shy of 250 characters. I rounded that up to 256
528         because powers of two are pretty. That means we'll malloc an external buffer
529         less than 1% of the time, which seems fine.
530
531         * html/parser/HTMLToken.h:
532         (HTMLToken):
533
534 2013-05-29  Brent Fulgham  <bfulgham@apple.com>
535
536         [Windows] Build correction after r150837
537
538         New 'forms' sub-folder of html needs to be included in
539         copy operations.
540
541         * WebCore.vcproj/copyForwardingHeaders.cmd: copy html/forms.
542         * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: Use correct
543         'obj32' folder for build output.
544         * WebCore.vcxproj/copyForwardingHeaders.cmd: copy html/forms.
545
546 2013-05-29  Tiancheng Jiang  <tijiang@rim.com>
547
548         [BlackBerry] Radio Button UX updates.
549         https://bugs.webkit.org/show_bug.cgi?id=116881
550
551         Reviewed by Rob Buis.
552
553         BlackBerry PR 342322.
554         Internally Reviewed by Jeff Rogers.
555         Change images.
556
557         * platform/blackberry/RenderThemeBlackBerry.cpp:
558         (WebCore::RenderThemeBlackBerry::paintRadio):
559
560 2013-05-29  Tiancheng Jiang  <tijiang@rim.com>
561
562         [BlackBerry] Datetime string is not centred in form controls.
563         https://bugs.webkit.org/show_bug.cgi?id=100760
564
565         Reviewed by Rob Buis.
566
567         BlackBerry PR 343512
568         Internally Reviewed by Jeff Rogers.
569
570         Adjust margin for inner text node of datetime form controls.
571
572         * css/themeBlackBerry.css:
573         (input::-webkit-date-and-time-value):
574
575 2013-05-29  Brent Fulgham  <bfulgham@apple.com>
576
577         [Windows] Build correction after r150876
578
579         A clean build will now fail because the BaseMultipleFieldsDateAndTimeInputType sources have
580         been removed, but are still referenced in the project file.
581
582         * WebCore.vcxproj/WebCore.vcxproj: Remove reference to BaseMultipleFieldsDateAndTimeInputType
583         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto
584
585 2013-05-28  Jer Noble  <jer.noble@apple.com>
586
587         Support the 'onended' EventListener property for AudioBufferSourceNode and OscillatorNode.
588         https://bugs.webkit.org/show_bug.cgi?id=116798
589
590         Reviewed by Eric Carlson.
591
592         Tests: webaudio/audiobuffersource-ended.html
593                webaudio/oscillator-ended.html
594
595         * Modules/webaudio/AudioScheduledSourceNode.cpp:
596         (WebCore::AudioScheduledSourceNode::AudioScheduledSourceNode):
597         (WebCore::AudioScheduledSourceNode::setOnended): Set m_hasEndedListener.
598         (WebCore::AudioScheduledSourceNode::finish): Call notifyEndedDispatch on the main thread.
599         (WebCore::AudioScheduledSourceNode::notifyEndedDispatch): Call notifyEnded().
600         (WebCore::AudioScheduledSourceNode::notifyEnded): Call the onended event listener.
601         * Modules/webaudio/AudioScheduledSourceNode.h:
602         (WebCore::AudioScheduledSourceNode::onended): Added boilerplate.
603         * Modules/webaudio/AudioBufferSourceNode.idl: Added the onerror attribute.
604         * Modules/webaudio/OscillatorNode.idl: Ditto.
605
606 2013-05-29  Bem Jones-Bey  <bjonesbe@adobe.com>
607
608         [CSS Shapes] Support parsing inset-rectangle shapes
609         https://bugs.webkit.org/show_bug.cgi?id=116638
610
611         Reviewed by Dean Jackson.
612
613         Add parsing for inset-rectangle. It's very similar to parsing for
614         rectangle.
615
616         No new tests, updated existing tests to cover this.
617
618         * css/BasicShapeFunctions.cpp:
619         (WebCore::valueForBasicShape): Add support for inset rectangles.
620         (WebCore::basicShapeForValue): Add support for inset rectangles.
621         * css/CSSBasicShapes.cpp:
622         (WebCore::buildInsetRectangleString): Create an inset-rectangle css
623             string.
624         (WebCore::CSSBasicShapeInsetRectangle::cssText): Convert inset
625             rectangle shape to a CSS string.
626         (WebCore::CSSBasicShapeInsetRectangle::equals): Compare two inset
627             rectangles.
628         (WebCore::CSSBasicShapeInsetRectangle::serializeResolvingVariables):
629             Create an inset rectangle string, with CSS variables resolved.
630         (WebCore::CSSBasicShapeInsetRectangle::hasVariableReference):
631             Determine if this inset rectangle has any CSS Variable references.
632         * css/CSSBasicShapes.h:
633         (CSSBasicShapeInsetRectangle): Add inset rectangle class. This is a
634             direct representation of the CSS property. All the methods below
635             are just simple getters and setters, along with a construtor and a
636             factory method.
637         (WebCore::CSSBasicShapeInsetRectangle::create): 
638         (WebCore::CSSBasicShapeInsetRectangle::top): 
639         (WebCore::CSSBasicShapeInsetRectangle::right):
640         (WebCore::CSSBasicShapeInsetRectangle::bottom):
641         (WebCore::CSSBasicShapeInsetRectangle::left):
642         (WebCore::CSSBasicShapeInsetRectangle::radiusX):
643         (WebCore::CSSBasicShapeInsetRectangle::radiusY):
644         (WebCore::CSSBasicShapeInsetRectangle::setTop):
645         (WebCore::CSSBasicShapeInsetRectangle::setRight):
646         (WebCore::CSSBasicShapeInsetRectangle::setBottom):
647         (WebCore::CSSBasicShapeInsetRectangle::setLeft):
648         (WebCore::CSSBasicShapeInsetRectangle::setRadiusX):
649         (WebCore::CSSBasicShapeInsetRectangle::setRadiusY):
650         (WebCore::CSSBasicShapeInsetRectangle::type):
651         (WebCore::CSSBasicShapeInsetRectangle::CSSBasicShapeInsetRectangle):
652         (WebCore):
653         * css/CSSParser.cpp:
654         (WebCore::CSSParser::parseBasicShapeInsetRectangle): Parse the
655             inset-rectangle CSS property and create a
656             CSSBasicShapeInsetRectangle.
657         (WebCore::CSSParser::parseBasicShape): Add a call to parse
658             inset-rectangle.
659         * rendering/ExclusionShapeInsideInfo.cpp:
660         (WebCore::ExclusionShapeInsideInfo::isEnabledFor): Disable
661             inset-rectangles, since only the parsing has been implemented so
662             far.
663         * rendering/ExclusionShapeOutsideInfo.cpp:
664         (WebCore::ExclusionShapeOutsideInfo::isEnabledFor): Disable
665             inset-rectangles, since only the parsing has been implemented so
666             far.
667         * rendering/style/BasicShapes.cpp:
668         (WebCore::BasicShapeInsetRectangle::path): Calculate the Path for an
669             inset-rectangle.
670         (WebCore::BasicShapeInsetRectangle::blend): Blend two inset rectangles
671             together at a point depending on the "progress" and return the
672             blended rectangle.
673         * rendering/style/BasicShapes.h:
674         (BasicShapeInsetRectangle): Add higher level inset rectangle class.
675             This is used outside of the CSS representation. The methods below
676             are just simple getters and setters, along with a constructor and
677             a factory method.
678         (WebCore::BasicShapeInsetRectangle::create):
679         (WebCore::BasicShapeInsetRectangle::top):
680         (WebCore::BasicShapeInsetRectangle::right):
681         (WebCore::BasicShapeInsetRectangle::bottom):
682         (WebCore::BasicShapeInsetRectangle::left):
683         (WebCore::BasicShapeInsetRectangle::cornerRadiusX):
684         (WebCore::BasicShapeInsetRectangle::cornerRadiusY):
685         (WebCore::BasicShapeInsetRectangle::setTop):
686         (WebCore::BasicShapeInsetRectangle::setRight):
687         (WebCore::BasicShapeInsetRectangle::setBottom):
688         (WebCore::BasicShapeInsetRectangle::setLeft):
689         (WebCore::BasicShapeInsetRectangle::setCornerRadiusX):
690         (WebCore::BasicShapeInsetRectangle::setCornerRadiusY):
691         (WebCore::BasicShapeInsetRectangle::type):
692         (WebCore::BasicShapeInsetRectangle::BasicShapeInsetRectangle):
693
694 2013-05-29  Andreas Kling  <akling@apple.com>
695
696         Move computed style extraction out of CSSComputedStyleDeclaration.
697         <http://webkit.org/b/116965>
698
699         Reviewed by Antti Koivisto.
700
701         Make it possible to get computed CSSValues from a Node without creating a CSSOM
702         style declaration object.
703
704         The bulk of the logic moves to a new class; ComputedStyleExtractor, which can be created
705         on the stack, and takes the same setup variables as CSSComputedStyleDeclaration.
706
707         This is prep to enable futuristic optimizations in editing and elsewhere.
708
709         * css/CSSComputedStyleDeclaration.h:
710         * css/CSSComputedStyleDeclaration.cpp:
711         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
712
713             Create a ComputedStyleExtractor to do the work!
714
715         (WebCore::ComputedStyleExtractor::currentColorOrValidColor):
716         (WebCore::ComputedStyleExtractor::valueForFilter):
717         (WebCore::ComputedStyleExtractor::ComputedStyleExtractor):
718         (WebCore::ComputedStyleExtractor::valueForShadow):
719         (WebCore::ComputedStyleExtractor::styledNode):
720         (WebCore::ComputedStyleExtractor::propertyValue):
721         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties):
722         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand):
723         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand):
724         (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
725         * css/SVGCSSComputedStyleDeclaration.cpp:
726         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor):
727         (WebCore::ComputedStyleExtractor::svgPropertyValue):
728
729             Moved all of these from CSSComputedStyleDeclaration to the new class.
730
731         * rendering/style/RenderStyle.h:
732         * svg/SVGPaint.h:
733
734             Have these two befriend ComputedStyleExtractor.
735
736 2013-05-29  Antti Koivisto  <antti@apple.com>
737
738         Another attempt to fix windows build.
739         
740         Not reviewed.
741
742         * css/CSSFontSelector.h:
743
744 2013-05-29  Antti Koivisto  <antti@apple.com>
745
746         Try to fix window build.
747         
748         Not reviewed.
749
750         * platform/graphics/FontCache.h:
751         (WebCore::FontDescriptionFontDataCacheKey::computeHash):
752
753 2013-05-29  Simon Fraser  <simon.fraser@apple.com>
754
755         Fix the firing of m_paintRelatedMilestonesTimer
756         https://bugs.webkit.org/show_bug.cgi?id=116919
757
758         Reviewed by Tim Horton.
759
760         r150671 intended to change things so that paint-related milestones
761         only fire when painting has actually happened, so that WebKit clients
762         are notified when we actually have bits to present.
763         
764         However, it made an incorrect assumption that painting would happen
765         inside of flushCompositingState(). This is not the case; flushCompositingState()
766         will just dirty CALayers, and later on Core Animation will ask us to paint them.
767         
768         This incorrect assumption meant that we would never start the
769         m_paintRelatedMilestonesTimer, so never fire the milestones.
770         
771         Fix by starting the m_paintRelatedMilestonesTimer via the RenderLayerBacking
772         paintContents call back. At this time we know we're painting, so we can both
773         set the FrameView's last paint time, and start up the timer. We also only
774         want to start the timer if there are pending milestones.
775
776         * rendering/RenderLayerBacking.cpp:
777         (WebCore::RenderLayerBacking::paintIntoLayer):
778         (WebCore::RenderLayerBacking::paintContents):
779         * rendering/RenderLayerCompositor.cpp:
780         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
781         (WebCore::RenderLayerCompositor::didPaintBacking):
782         * rendering/RenderLayerCompositor.h:
783         (RenderLayerCompositor):
784
785 2013-05-29  Antti Koivisto  <antti@apple.com>
786
787         Share FontGlyphs
788         https://bugs.webkit.org/show_bug.cgi?id=116863
789
790         Reviewed by Anreas Kling.
791
792         Style system generates many Font objects that are identical or similar enough to have identical FontGlyphs. 
793         We can figure out that the FontGlyphs are going to be the same and share them. This reduces memory usage.
794         It also improves performance as the glyph cache and the width cache hang from FontGlyphs and their hit rate
795         increases.
796         
797         On PLT3 this takes the number of live FontGlyphs at the end from 40k+ to <1k. Width cache hit rate improves
798         from ~42% to ~55%.
799
800         * css/CSSFontSelector.cpp:
801         (WebCore::CSSFontSelector::CSSFontSelector):
802         
803             Add unique id we can use in cache key.
804
805         (WebCore::CSSFontSelector::dispatchInvalidationCallbacks):
806         
807             Bump the version number on invalidation so we don't reuse cache entries after web font is loaded.
808
809         (WebCore::CSSFontSelector::resolvesFamilyFor):
810         
811             Test if FontSelector is needed for resolving a particular FontDescription.
812
813         * css/CSSFontSelector.h:
814         * page/Settings.cpp:
815         (WebCore::setGenericFontFamilyMap):
816         
817             Invalidate the cache if standard font settings change.
818
819         * platform/graphics/Font.cpp:
820         (FontGlyphsCacheKey):
821         (FontGlyphsCacheEntry):
822         (WebCore::operator==):
823         (WebCore::fontGlyphsCache):
824         (WebCore::invalidateFontGlyphsCache):
825         (WebCore::makeFontSelectorFlags):
826         (WebCore::makeFontGlyphsCacheKey):
827         
828             The cache key consists of
829             
830             - all families.
831             - shared key with the lower level FontData cache (FontCache), guaranteeing FontDatas would be identical.
832             - font selector specific keys.
833
834             These guarantee the FontData will be identical.
835
836         (WebCore::computeFontGlyphsCacheHash):
837         (WebCore::pruneUnreferencedFromFontGlyphsCache):
838         
839             Don't accumulate unused entries.
840
841         (WebCore::retrieveOrAddCachedFontGlyphs):
842         (WebCore::Font::update):
843         * platform/graphics/Font.h:
844         * platform/graphics/FontCache.cpp:
845         (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
846         (WebCore::FontPlatformDataCacheKey::isHashTableDeletedValue):
847         (WebCore::FontPlatformDataCacheKey::operator==):
848         (FontPlatformDataCacheKey):
849         (WebCore::computeHash):
850         (WebCore::FontCache::getCachedFontPlatformData):
851         (WebCore::FontCache::purgeInactiveFontData):
852         (WebCore::FontCache::invalidate):
853         * platform/graphics/FontCache.h:
854         (WebCore::FontDescriptionFontDataCacheKey::FontDescriptionFontDataCacheKey):
855         (WebCore::FontDescriptionFontDataCacheKey::makeFlagKey):
856         (WebCore::FontDescriptionFontDataCacheKey::operator==):
857         (WebCore::FontDescriptionFontDataCacheKey::operator!=):
858         (WebCore::FontDescriptionFontDataCacheKey::computeHash):
859         
860             Separate part of the key for sharing.
861
862         (FontDescriptionFontDataCacheKey):
863         * platform/graphics/FontFallbackList.cpp:
864         (WebCore::FontGlyphs::FontGlyphs):
865         (WebCore::FontGlyphs::releaseFontData):
866         * platform/graphics/FontFallbackList.h:
867         (WebCore::FontGlyphs::create):
868         (WebCore::FontGlyphs::~FontGlyphs):
869         
870             Remove invalidate(). If FontGlyphs needs invalidation it is reconstructed.
871
872         * platform/graphics/FontSelector.h:
873
874 2013-05-29  Nico Weber  <thakis@chromium.org>
875
876         Remove unused file PlatformGestureEvent.cpp
877         https://bugs.webkit.org/show_bug.cgi?id=116894
878
879         Reviewed by Darin Adler.
880
881         This was added in https://bugs.webkit.org/show_bug.cgi?id=49345 but
882         not removed in https://bugs.webkit.org/show_bug.cgi?id=77492 which
883         removed most of that code again.
884         
885         * platform/PlatformGestureRecognizer.cpp: Removed.
886
887 2013-05-29  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
888
889         [texmap][GStreamer][GTK] Composited Video support
890         https://bugs.webkit.org/show_bug.cgi?id=86410
891
892         Reviewed by Noam Rosenthal.
893
894         Enable the video accelerated compositing using the WebKit's
895         TextureMapper.
896
897         This patch does not use hardware accelerated video decoding. It
898         provides a generic path for system memory buffers.
899
900         This new functionality is only available when the coordinated graphics
901         system is not used.
902
903         No new tests, already covered by existing tests.
904
905         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
906         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
907         (WebCore):
908         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): update the
909         texture content with the new received video buffer.
910         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint): choose to
911         use the accelerated compositing or the normal code path
912         (WebCore::MediaPlayerPrivateGStreamerBase::paint): if accelerated
913         compositing is used this method is halted.
914         (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper): get
915         a texture from the pool and draws it if it is already available.
916         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
917         (MediaPlayerPrivateGStreamerBase):
918         (WebCore::MediaPlayerPrivateGStreamerBase::platformLayer): returns itself
919         (WebCore::MediaPlayerPrivateGStreamerBase::supportsAcceleratedRendering):
920         returns true
921
922 2013-05-29  Peter Gal  <galpeter@inf.u-szeged.hu>
923
924         [Qt] Missing files from build after r150853
925         https://bugs.webkit.org/show_bug.cgi?id=116932
926
927         Reviewed by Csaba Osztrogonác.
928
929         * Target.pri: Added missing include path.
930
931 2013-05-29  Mihai Maerean  <mmaerean@adobe.com>
932
933         [CSS Regions] Content that has overflow: scroll cannot be scrolled by dragging the scroll thumbs with the mouse
934         https://bugs.webkit.org/show_bug.cgi?id=113703
935
936         Reviewed by Darin Adler.
937
938         The point inside a box that's inside a region has its coordinates relative to the region, not the FlowThread
939         that is its container in the RenderObject tree.
940
941         Previously, the coordinates were computed relatively to the FlowThread which doesn't really have a location in
942         the page.
943
944         Tests: fast/regions/drag-scrollbars-of-content.html
945                fast/regions/hover-in-second-region.html
946
947         * rendering/RenderBox.cpp:
948         (WebCore::RenderBox::offsetFromContainer):
949         * rendering/RenderBoxModelObject.cpp:
950         (WebCore::RenderBoxModelObject::mapAbsoluteToLocalPoint):
951
952 2013-05-29  Andreas Kling  <akling@apple.com>
953
954         Fix dumb typo in r150879.
955
956         * editing/htmlediting.cpp:
957         (WebCore::nextLeafNode):
958
959 2013-05-29  Andreas Kling  <akling@apple.com>
960
961         Move leaf Node traversal helpers to htmlediting.cpp
962         <http://webkit.org/b/116940>
963
964         Reviewed by Antti Koivisto.
965
966         Move Node::previousLeafNode() and Node::nextLeafNode() to htmlediting.cpp along with their helpers.
967         Fixes an 8-year old FIXME. \o/
968
969         * dom/Node.h:
970         * dom/Node.cpp:
971         * dom/Position.cpp:
972         (WebCore::nextRenderedEditable):
973         (WebCore::previousRenderedEditable):
974         * editing/VisibleUnits.cpp:
975         (WebCore::previousLeafWithSameEditability):
976         (WebCore::nextLeafWithSameEditability):
977         * editing/htmlediting.h:
978         * editing/htmlediting.cpp:
979         (WebCore::previousNodeConsideringAtomicNodes):
980         (WebCore::nextNodeConsideringAtomicNodes):
981         (WebCore::previousLeafNode):
982         (WebCore::nextLeafNode):
983
984 2013-05-29  Peter Gal  <galpeter@inf.u-szeged.hu>
985
986         [Qt] Missing files from build after r150853
987         https://bugs.webkit.org/show_bug.cgi?id=116932
988
989         Reviewed by Csaba Osztrogonác.
990
991         * Target.pri: Added the CFURLExtras.{cpp,h} files to the projectfile.
992
993 2013-05-29  Ryosuke Niwa  <rniwa@webkit.org>
994
995         PresentationAttributeCacheCleaner::m_hitCount is never initialized
996         https://bugs.webkit.org/show_bug.cgi?id=116946
997
998         Reviewed by Andreas Kling.
999
1000         Merge https://chromium.googlesource.com/chromium/blink/+/70be7ddc41141ef6dec7795d37842c27dab2e194.
1001
1002         * dom/StyledElement.cpp:
1003         (WebCore::PresentationAttributeCacheCleaner::PresentationAttributeCacheCleaner):
1004
1005 2013-05-29  Kent Tamura  <tkent@chromium.org>
1006
1007         Remove ENABLE_INPUT_MULTIPLE_FIELDS_UI.
1008         https://bugs.webkit.org/show_bug.cgi?id=116796
1009
1010         Reviewed by Ryosuke Niwa.
1011
1012         This feature was used only by Chromium port.
1013
1014         * CMakeLists.txt:
1015         * GNUmakefile.list.am:
1016         * Target.pri:
1017         * WebCore.vcproj/WebCore.vcproj:
1018         * WebCore.vcxproj/WebCore.vcxproj:
1019         * WebCore.vcxproj/WebCore.vcxproj.filters:
1020         * WebCore.xcodeproj/project.pbxproj:
1021         * css/html.css:
1022         (input::-webkit-date-and-time-value):
1023         * dom/Element.cpp:
1024         * dom/Element.h:
1025         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
1026         * html/BaseChooserOnlyDateAndTimeInputType.h:
1027         * html/BaseMultipleFieldsDateAndTimeInputType.cpp: Removed.
1028         * html/BaseMultipleFieldsDateAndTimeInputType.h: Removed.
1029         * html/DateInputType.cpp:
1030         * html/DateInputType.h:
1031         (DateInputType):
1032         * html/DateTimeFieldsState.cpp: Removed.
1033         * html/DateTimeFieldsState.h: Removed.
1034         * html/DateTimeInputType.cpp:
1035         * html/DateTimeInputType.h:
1036         (DateTimeInputType):
1037         * html/DateTimeLocalInputType.cpp:
1038         * html/DateTimeLocalInputType.h:
1039         (DateTimeLocalInputType):
1040         * html/HTMLInputElement.cpp:
1041         (WebCore::HTMLInputElement::HTMLInputElement):
1042         (WebCore):
1043         * html/HTMLInputElement.h:
1044         (HTMLInputElement):
1045         * html/InputType.cpp:
1046         * html/InputType.h:
1047         (InputType):
1048         * html/MonthInputType.cpp:
1049         * html/MonthInputType.h:
1050         (MonthInputType):
1051         * html/TimeInputType.cpp:
1052         * html/TimeInputType.h:
1053         (TimeInputType):
1054         * html/WeekInputType.cpp:
1055         * html/WeekInputType.h:
1056         (WeekInputType):
1057         * html/shadow/ClearButtonElement.cpp: Removed.
1058         * html/shadow/ClearButtonElement.h: Removed.
1059         * html/shadow/DateTimeEditElement.cpp: Removed.
1060         * html/shadow/DateTimeEditElement.h: Removed.
1061         * html/shadow/DateTimeFieldElement.cpp: Removed.
1062         * html/shadow/DateTimeFieldElement.h: Removed.
1063         * html/shadow/DateTimeFieldElements.cpp: Removed.
1064         * html/shadow/DateTimeFieldElements.h: Removed.
1065         * html/shadow/DateTimeNumericFieldElement.cpp: Removed.
1066         * html/shadow/DateTimeNumericFieldElement.h: Removed.
1067         * html/shadow/DateTimeSymbolicFieldElement.cpp: Removed.
1068         * html/shadow/DateTimeSymbolicFieldElement.h: Removed.
1069         * html/shadow/PickerIndicatorElement.cpp: Removed.
1070         * html/shadow/PickerIndicatorElement.h: Removed.
1071         * page/ChromeClient.h:
1072         (ChromeClient):
1073         * platform/LocalizedStrings.h:
1074         (WebCore):
1075         * platform/text/PlatformLocale.cpp:
1076         * platform/text/PlatformLocale.h:
1077         (Locale):
1078         * rendering/RenderDetailsMarker.cpp:
1079         * rendering/RenderDetailsMarker.h:
1080         * rendering/RenderObject.h:
1081         (RenderObject):
1082
1083 2013-05-29  Ryosuke Niwa  <rniwa@webkit.org>
1084
1085         Remove setFullScreenRendererSize and setFullScreenRendererBackgroundColor
1086         https://bugs.webkit.org/show_bug.cgi?id=116914
1087
1088         Reviewed by Benjamin Poulain.
1089
1090         Merge https://chromium.googlesource.com/chromium/blink/+/508eb21a07f69ed38b9be9ff92fe75dcb907861f
1091
1092         * dom/Document.cpp:
1093         * dom/Document.h:
1094
1095 2013-05-29  Ryosuke Niwa  <rniwa@webkit.org>
1096
1097         Make WidgetHierarchyUpdatesSuspensionScope use swap instead of copy
1098         https://bugs.webkit.org/show_bug.cgi?id=116927
1099
1100         Reviewed by Andreas Kling.
1101
1102         Merge https://chromium.googlesource.com/chromium/blink/+/1d577e1fd5c5716a06e4007e04fc3d9d0a88f5e4
1103
1104         This is equivalent behavior code that is unambiguously better performance. swap is O(1) time and memory,
1105         copying a hash table is at least linear with the number of elements.
1106
1107         * rendering/RenderWidget.cpp:
1108         (WebCore::WidgetHierarchyUpdatesSuspensionScope::moveWidgets):
1109
1110 2013-05-29  Andreas Kling  <akling@apple.com>
1111
1112         Remove Document::nodeAbsIndex() and Document::nodeWithAbsIndex().
1113
1114         Rubber-stamped by Antti "Lucky" Koivisto.
1115
1116         * dom/Document.h:
1117         * dom/Document.cpp:
1118
1119 2013-05-28  Andreas Kling  <akling@apple.com>
1120
1121         FocusController should operate on Elements internally.
1122         <http://webkit.org/b/116781>
1123
1124         Reviewed by Antti Koivisto.
1125
1126         Switch from Node* to Element* as much as possible inside FocusController.
1127         Mostly mechanical, gets rid of some unnecessary isElementNode() checks and casts.
1128
1129         * page/FocusController.h:
1130         * page/FocusController.cpp:
1131         (WebCore::dispatchEventsOnWindowAndFocusedElement):
1132         (WebCore::isNonFocusableShadowHost):
1133         (WebCore::adjustedTabIndex):
1134         (WebCore::shouldVisit):
1135         (WebCore::FocusController::setFocused):
1136         (WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument):
1137         (WebCore::FocusController::advanceFocusInDocumentOrder):
1138         (WebCore::FocusController::findFocusableElementAcrossFocusScope):
1139         (WebCore::FocusController::findFocusableElementRecursively):
1140         (WebCore::FocusController::findFocusableElement):
1141         (WebCore::FocusController::nextFocusableElement):
1142         (WebCore::FocusController::previousFocusableElement):
1143         (WebCore::FocusController::setActive):
1144
1145 2013-05-29  Radu Stavila  <stavila@adobe.com>
1146
1147         [CSS Regions] Mouse over an element does not trigger :hover state for parent when the element is flowed in a region
1148         https://bugs.webkit.org/show_bug.cgi?id=111749
1149
1150         Reviewed by Antti Koivisto.
1151
1152         When searching for the hover ancestor and encountering a named flow thread,
1153         the search will continue with the DOM ancestor of the top-most element
1154         in the named flow thread.
1155
1156         Tests: fast/regions/hover-in-region-grandparent.html
1157                fast/regions/hover-in-region-parent-skip.html
1158                fast/regions/hover-in-region-parent-skip-inlines-anonymous.html
1159                fast/regions/hover-on-child-in-region.html
1160                fast/regions/hover-on-child-in-region-in-region.html
1161
1162         * rendering/RenderObject.cpp:
1163         (WebCore::RenderObject::hoverAncestor):
1164         * rendering/RenderObject.h:
1165
1166 2013-05-28  Nate Chapin  <japhet@chromium.org>
1167
1168         Crash in WebCore::SubresourceLoader::releaseResources when connection fails
1169         https://bugs.webkit.org/show_bug.cgi?id=87743
1170
1171         Don't do anything complicated in SubresourceLoader::releaseResources(),
1172         just clear variables. With this patch, releaseResources() will still
1173         assert in debug builds if it is called twice, but it will safely execute
1174         in release.
1175
1176         Reviewed by Darin Adler.
1177
1178         * loader/ResourceLoader.cpp:
1179         (WebCore::ResourceLoader::cleanupForError): Pull shared cleanup code out of didFail()
1180             and cancel() into a helper.
1181         (WebCore::ResourceLoader::cancel): Merge a couple variables into an enum, check for
1182             reentrancy from within didCancel().
1183         * loader/ResourceLoader.h: Replace m_calledWillCancel and m_cancelled with an enum.
1184         * loader/SubresourceLoader.cpp:
1185         (WebCore::SubresourceLoader::didFinishLoading): Don't call ResourceLoader::didFinishLoading(),
1186             put finish() in the middle of the process.
1187         (WebCore::SubresourceLoader::didFail): Don't call ResourceLoader::didFail(), put finish()
1188             in the middle of the process.
1189         (WebCore::SubresourceLoader::didCancel):
1190         (WebCore::SubresourceLoader::notifyDone): Do the non-trivial work previous done in releaseResources(),
1191             most importantly calling loadDone().
1192         (WebCore::SubresourceLoader::releaseResources): Only do simple variable clearing here.
1193         * loader/SubresourceLoader.h:
1194         (SubresourceLoader):
1195         * loader/cache/CachedResource.cpp: Split stopLoading() into cancelLoad() (which notifies clients)
1196             and clearLoader() (which just nulls m_loader).
1197         * loader/cache/CachedResource.h:
1198         * loader/chromium/ResourceLoaderChromium.cpp:
1199
1200 2013-05-28  Seokju Kwon  <seokju.kwon@gmail.com>
1201
1202         [GTK] Build fix after r150837
1203         https://bugs.webkit.org/show_bug.cgi?id=116904
1204
1205         Unreviewed build fix.
1206
1207         * GNUmakefile.am:
1208
1209 2013-05-28  Andy Estes  <aestes@apple.com>
1210
1211         REGRESSION (r150169): Images from file: URLs display after a delay even though they were preloaded by JavaScript
1212         https://bugs.webkit.org/show_bug.cgi?id=116906
1213         <rdar://problem/13991927>
1214
1215         Reviewed by Andreas Kling.
1216
1217         Writing a test for this is blocked on https://webkit.org/b/116199.
1218
1219         Some WebKit clients use JavaScript to preload images from disk so that
1220         subsequent loads will display immediately from the memory cache. By not
1221         caching non-HTTP sub-resources in memory, we break this common pattern.
1222         This change restricts r150169 to only apply to cached main resources.
1223         Sub-resources will again be cached indefinitely as they were prior to
1224         r150169.
1225
1226         * loader/cache/CachedResource.cpp:
1227         (WebCore::CachedResource::freshnessLifetime): If this is a non-HTTP
1228         main resource from a scheme that should not be cached indefinitely,
1229         return 0 for the freshness lifetime. For other non-HTTP cached
1230         resources, return an indefinite freshness lifetime.
1231
1232 2013-05-28  Dean Jackson  <dino@apple.com>
1233
1234         Animations do not restart after exiting page cache
1235         https://bugs.webkit.org/show_bug.cgi?id=116900
1236
1237         Reviewed by Tim Horton.
1238
1239         Animations are suspended as they enter the page cache, but
1240         were not getting correctly resumed when exiting. The cause
1241         was an error in r149576 which was checking a global flag for suspension
1242         on the AnimationController and thus not trying to resume anything.
1243
1244         Test: animations/resume-after-page-cache.html
1245
1246         * page/animation/AnimationController.cpp:
1247         (WebCore::AnimationControllerPrivate::suspendAnimationsForDocument):
1248         (WebCore::AnimationControllerPrivate::resumeAnimationsForDocument):
1249
1250 2013-05-28  Chris Rogers  <crogers@google.com>
1251
1252         Support multiple HRTFDatabases for different sample-rates
1253         https://bugs.webkit.org/show_bug.cgi?id=116183
1254
1255         Reviewed by Kenneth Russell.
1256
1257         Adapted from Blink:
1258         https://codereview.chromium.org/14636011/
1259
1260         This removes the limitation which required OfflineAudioContexts to be created at native sample-rate
1261
1262         * Modules/webaudio/AudioContext.h:
1263         (WebCore::AudioContext::hrtfDatabaseLoader):
1264         (AudioContext):
1265         * Modules/webaudio/OfflineAudioContext.cpp:
1266         (WebCore::OfflineAudioContext::create):
1267         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
1268         (WebCore::OfflineAudioDestinationNode::offlineRender):
1269         * Modules/webaudio/PannerNode.cpp:
1270         (WebCore::PannerNode::initialize):
1271         (WebCore::PannerNode::setPanningModel):
1272         * platform/audio/HRTFDatabaseLoader.cpp:
1273         (WebCore):
1274         (WebCore::HRTFDatabaseLoader::createAndLoadAsynchronouslyIfNecessary):
1275         (WebCore::HRTFDatabaseLoader::~HRTFDatabaseLoader):
1276         * platform/audio/HRTFDatabaseLoader.h:
1277         (HRTFDatabaseLoader):
1278         (WebCore::HRTFDatabaseLoader::loaderMap):
1279         * platform/audio/HRTFPanner.cpp:
1280         (WebCore::HRTFPanner::HRTFPanner):
1281         (WebCore::HRTFPanner::calculateDesiredAzimuthIndexAndBlend):
1282         (WebCore::HRTFPanner::pan):
1283         * platform/audio/HRTFPanner.h:
1284         (HRTFPanner):
1285         * platform/audio/Panner.cpp:
1286         (WebCore::Panner::create):
1287         * platform/audio/Panner.h:
1288         (WebCore):
1289
1290 2013-05-28  Alexey Proskuryakov  <ap@apple.com>
1291
1292         Windows build fix.
1293
1294         * platform/cf/KURLCFNet.cpp:
1295         (WebCore::KURL::createCFURL):
1296
1297 2013-05-28  Alexey Proskuryakov  <ap@apple.com>
1298
1299         Freeze when loading a particular page on washingtonpost.com with NetworkProcess enabled
1300         https://bugs.webkit.org/show_bug.cgi?id=116887
1301         <rdar://problem/12965959>
1302
1303         Reviewed by Darin Adler.
1304
1305         Test: http/tests/uri/curly-braces-escaping.html
1306
1307         The issue was that WebKit used an incorrect accessor to get a string out of CFURL,
1308         unlike WebCore.
1309
1310         Centralized code for converting between CFURLs and strings in a place that WebKit
1311         can use directly.
1312
1313         * WebCore.exp.in:
1314         * WebCore.vcproj/WebCore.vcproj:
1315         * WebCore.vcxproj/WebCore.vcxproj:
1316         * WebCore.vcxproj/WebCore.vcxproj.filters:
1317         * WebCore.xcodeproj/project.pbxproj:
1318         Keeping things building.
1319
1320         * platform/KURL.cpp: (WebCore::KURL::copyToBuffer):
1321         * platform/KURL.h:
1322         Updated for a new typedef name. The code was using Vector<char, 512> and CharBuffer
1323         inconsistently, and now URLs use URLCharBuffer.
1324
1325         * platform/cf/CFURLExtras.cpp: Added.
1326         (WebCore::createCFURLFromBuffer):
1327         (WebCore::getURLBytes):
1328         * platform/cf/CFURLExtras.h: Added.
1329         * platform/cf/KURLCFNet.cpp:
1330         (WebCore::KURL::KURL):
1331         (WebCore::KURL::createCFURL):
1332         Extracted code for CFURL string manipulation that is not logcally part of KURL.
1333
1334         * platform/mac/KURLMac.mm:
1335         (WebCore::KURL::KURL): Use the new getURLBytes function.
1336         (WebCore::KURL::operator NSURL *): Added a comment.
1337         (WebCore::KURL::createCFURL): Added a comment, and updated for new names and
1338         signatures.
1339
1340         * platform/network/cf/ResourceErrorCF.cpp: (WebCore::ResourceError::platformLazyInit):
1341         Added a FIXME. We are still using CFURLGetString here. The difficulty is getting
1342         encodings right.
1343
1344 2013-05-28  Anders Carlsson  <andersca@apple.com>
1345
1346         Create a html/forms subdirectory and move FileIconLoader there
1347         https://bugs.webkit.org/show_bug.cgi?id=116880
1348
1349         Reviewed by Jessie Berlin.
1350
1351         A lot (if not the majority) of files in html/ are forms related, so it makes sense to begin splitting
1352         them out into a separate subdirectory, html/forms.
1353
1354         Begin my moving FileIconLoader from platform to html/forms. It is related to HTML forms (it's only used by
1355         the file upload element), and is not really a platform abstraction so it doesn't belong in platform.
1356
1357         * CMakeLists.txt:
1358         * GNUmakefile.list.am:
1359         * Target.pri:
1360         * WebCore.vcproj/WebCore.vcproj:
1361         * WebCore.vcxproj/WebCore.vcxproj:
1362         * WebCore.vcxproj/WebCore.vcxproj.filters:
1363         * WebCore.xcodeproj/project.pbxproj:
1364         * html/forms/FileIconLoader.cpp: Renamed from Source/WebCore/platform/FileIconLoader.cpp.
1365         * html/forms/FileIconLoader.h: Renamed from Source/WebCore/platform/FileIconLoader.h.
1366
1367 2013-05-28  Chris Fleizach  <cfleizach@apple.com>
1368
1369         AX: WKView is unable to set AXFocused to YES and does not handle keyboard events as expected
1370         https://bugs.webkit.org/show_bug.cgi?id=116756
1371
1372         Reviewed by Tim Horton.
1373
1374         If AXFocused is set to true, but the WebView is not the first responder, then the call will
1375         not do anything. This change asks the Chrome to make the WebView the first responder before
1376         trying to set focus within the page.
1377
1378         Was not able to make a test, it requires on interplay between areas outside the web view.
1379
1380         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1381         (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
1382
1383 2013-05-28  Jer Noble  <jer.noble@apple.com>
1384
1385         Crash in DumpRenderTree at com.apple.WebCore: WebCore::RenderTextTrackCue::repositionGenericCue + 154
1386         https://bugs.webkit.org/show_bug.cgi?id=116882
1387
1388         Reviewed by Eric Carlson.
1389
1390         Remove an inappropriate assert. No cues coming through repositionGenericCue will be WebVTT ones.
1391
1392         * rendering/RenderTextTrackCue.cpp:
1393         (WebCore::RenderTextTrackCue::repositionGenericCue):
1394
1395 2013-05-28  Alberto Garcia  <agarcia@igalia.com>
1396
1397         [BlackBerry] GraphicsContext: add missing definitions.
1398         https://bugs.webkit.org/show_bug.cgi?id=115515
1399
1400         Reviewed by Rob Buis.
1401
1402         * platform/graphics/GraphicsContext.h:
1403         (Graphics):
1404         Add definition for PlatformGraphicsContext.
1405         * platform/graphics/blackberry/GraphicsContextBlackBerry.cpp:
1406         Include RoundedRect.h
1407
1408 2013-05-28  Arvid Nilsson  <anilsson@rim.com>
1409
1410         [BlackBerry] Fix style issues in BlackBerry accelerated compositing backend
1411         https://bugs.webkit.org/show_bug.cgi?id=116604
1412
1413         Reviewed by Carlos Garcia Campos.
1414
1415         PR 273550, 99638
1416
1417         Remove the "get" prefix from getters in the WebKit- and compositing-
1418         thread layer classes, as well as LayerRendererSurface. Clarify which
1419         geometry-related getters return normalized device coordinates by adding
1420         a comment.
1421
1422         Also remove dead code related to LayerData::m_holePunchClipRect, which
1423         was part of an eventually disabled fix for video clipping in iframes,
1424         PR 99638. Since we now use AC layers for iframes, the bug is no longer
1425         reproducible, and the dead code will never need to be enabled again.
1426
1427         No change in behavior, no new tests.
1428
1429         * platform/graphics/blackberry/EGLImageLayerCompositingThreadClient.cpp:
1430         (WebCore::EGLImageLayerCompositingThreadClient::drawTextures):
1431         * platform/graphics/blackberry/LayerCompositingThread.cpp:
1432         (WebCore::LayerCompositingThread::setDrawTransform):
1433         (WebCore::LayerCompositingThread::transformedHolePunchRect):
1434         (WebCore::LayerCompositingThread::drawTextures):
1435         (WebCore::LayerCompositingThread::drawSurface):
1436         * platform/graphics/blackberry/LayerCompositingThread.h:
1437         (WebCore::LayerCompositingThread::sublayers): Removed "get" prefix
1438         (LayerCompositingThread):
1439         (WebCore::LayerCompositingThread::boundingBox): Renamed from "getDrawRect"
1440         (WebCore::LayerCompositingThread::transformedBounds): Removed "get" prefix
1441         (WebCore::LayerCompositingThread::transformedHolePunchRect): Removed "get" prefix
1442         * platform/graphics/blackberry/LayerData.h:
1443         (LayerData): Removed unused data member "m_holePunchClipRect"
1444         * platform/graphics/blackberry/LayerFilterRenderer.cpp:
1445         (WebCore::LayerFilterRenderer::applyActions):
1446         * platform/graphics/blackberry/LayerRenderer.cpp:
1447         (WebCore::LayerRenderer::compositeLayers):
1448         (WebCore::LayerRenderer::drawDebugBorder):
1449         (WebCore::LayerRenderer::drawHolePunchRect):
1450         (WebCore::LayerRenderer::prepareFrameRecursive):
1451         (WebCore::LayerRenderer::updateLayersRecursive):
1452         (WebCore::collect3DPreservingLayers):
1453         (WebCore::LayerRenderer::compositeLayersRecursive):
1454         * platform/graphics/blackberry/LayerRendererSurface.cpp:
1455         (WebCore::LayerRendererSurface::boundingBox):
1456         * platform/graphics/blackberry/LayerRendererSurface.h:
1457         (WebCore::LayerRendererSurface::boundingBox): Renamed from "drawRect" because that sounds like a verb, and this is a getter
1458         * platform/graphics/blackberry/LayerWebKitThread.h:
1459         (WebCore::LayerWebKitThread::sublayers): Removed "get" prefix
1460         * platform/graphics/blackberry/VideoLayerWebKitThread.cpp:
1461         (WebCore::VideoLayerWebKitThread::setHolePunchRect):
1462         (WebCore::VideoLayerWebKitThread::boundsChanged):
1463
1464 2013-05-28  Jer Noble  <jer.noble@apple.com>
1465
1466         Made AudioNode an EventTarget
1467         https://bugs.webkit.org/show_bug.cgi?id=116871
1468
1469         Merge: https://chromium.googlesource.com/chromium/blink/+/ef37484162ddb95d677dcfdcdd778ec60590928b
1470
1471         Reviewed by Darin Adler.
1472
1473         Tests: webaudio/audionode-expected.txt:
1474                webaudio/audionode.html:
1475
1476         Add the requisite boilerplate to allow AudioNode to become an EventTarget. Remove
1477         all that same boilerplate from ScriptProcessorNode now that it's base class
1478         is an EventTarget.
1479
1480         * Modules/webaudio/AudioNode.cpp:
1481         (WebCore::AudioNode::interfaceName): Added boilerplate.
1482         (WebCore::AudioNode::scriptExecutionContext): Return the AudioContext's context.
1483         (WebCore::AudioNode::processIfNecessary): Whitespace.
1484         * Modules/webaudio/AudioNode.h:
1485         * Modules/webaudio/AudioNode.idl: Make AudioNode an EventTarget.
1486         * Modules/webaudio/ScriptProcessorNode.cpp: Remove EventTarget boilerplate.
1487         * Modules/webaudio/ScriptProcessorNode.h: Ditto.
1488         * Modules/webaudio/ScriptProcessorNode.idl: Ditto.
1489         * dom/EventTarget.h: Mark AudioNode as an EventTarget.
1490         * dom/EventTargetFactory.in: Ditto.
1491
1492 2013-05-28  Arvid Nilsson  <anilsson@rim.com>
1493
1494         [BlackBerry] backface-visibility: hidden doesn't work properly with masks and filters
1495         https://bugs.webkit.org/show_bug.cgi?id=116616
1496
1497         Reviewed by Carlos Garcia Campos.
1498
1499         The BlackBerry::Platform::Graphics::GraphicsContext generates geometry
1500         with a different winding order than the accelerated compositing backend
1501         of the BlackBerry port. So, when we switched from Skia to this new
1502         rendering engine, we switched from glFrontFace(GL_CCW) to
1503         glFrontFace(GL_CW), and all was well when drawing display lists.
1504         However, we forgot to update the winding order of geometry generated
1505         within the accelerated compositing backend, which is used for masks and
1506         filters, so they were getting erroneously culled out when
1507         backface-visibility: hidden was applied to them. Fixed by switching the
1508         winding order of all geometry generated up here, which has the added
1509         benefit of enabling us to use TransformationMatrix::mapQuad instead of
1510         transforming point-by-point.
1511
1512         To further complicate matters, a right-side up transform is used when
1513         drawing layers into surfaces, reversing the winding order and requiring
1514         us to switch back to glFrontFace(GL_CCW) temporarily, when drawing
1515         layers to surfaces, or the layers will get culled out inside the
1516         surface.
1517
1518         Also fix spelling error, "drawed" should be "drawn".
1519
1520         No new tests, this is only detectable by pixel tests, which the
1521         BlackBerry port currently doesn't support.
1522
1523         PR 341945.
1524
1525         * platform/graphics/blackberry/EGLImageLayerCompositingThreadClient.cpp:
1526         (WebCore::EGLImageLayerCompositingThreadClient::drawTextures):
1527         * platform/graphics/blackberry/LayerCompositingThread.cpp:
1528         (WebCore::LayerCompositingThread::setDrawTransform):
1529         (WebCore::getTransformedRect):
1530         (WebCore::LayerCompositingThread::drawTextures):
1531         (WebCore::LayerCompositingThread::drawSurface):
1532         * platform/graphics/blackberry/LayerCompositingThread.h:
1533         (LayerCompositingThread):
1534         (WebCore::LayerCompositingThread::origin):
1535         * platform/graphics/blackberry/LayerFilterRenderer.cpp:
1536         (WebCore):
1537         * platform/graphics/blackberry/LayerRenderer.cpp:
1538         (WebCore::LayerRenderer::compositeLayers):
1539         (WebCore):
1540         (WebCore::LayerRenderer::drawLayersOnSurfaces):
1541         * platform/graphics/blackberry/LayerRendererSurface.cpp:
1542         (WebCore::LayerRendererSurface::drawRect):
1543         (WebCore::LayerRendererSurface::transformedBounds):
1544         * platform/graphics/blackberry/LayerRendererSurface.h:
1545         (WebCore::LayerRendererSurface::origin):
1546         (LayerRendererSurface):
1547         * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp:
1548         (WebCore):
1549         (WebCore::loadBufferingImageData):
1550         (WebCore::MediaPlayerPrivate::drawBufferingAnimation):
1551
1552 2013-05-28  Andreas Kling  <akling@apple.com>
1553
1554         Move Node::dispatchChangeEvent() to HTMLFormControlElement.
1555         <http://webkit.org/b/116866>
1556
1557         Reviewed by Anders Carlsson.
1558
1559         ...and devirtualize it, since it had no overrides.
1560
1561         * dom/Node.h:
1562         * dom/Node.cpp:
1563         * html/HTMLFormControlElement.h:
1564         * html/HTMLFormControlElement.cpp:
1565         (WebCore::HTMLFormControlElement::dispatchChangeEvent):
1566         (WebCore::HTMLFormControlElement::dispatchFormControlChangeEvent):
1567         * html/FileInputType.cpp:
1568         (WebCore::FileInputType::setFiles):
1569         * html/HTMLTextFormControlElement.cpp:
1570         (WebCore::HTMLTextFormControlElement::dispatchFormControlChangeEvent):
1571
1572 2013-05-28  Sergio Villar Senin  <svillar@igalia.com>
1573
1574         Refactoring CSS grammar
1575         https://bugs.webkit.org/show_bug.cgi?id=116679
1576
1577         Reviewed by Andreas Kling.
1578
1579         From Blink r149948 by <serya@chromium.org>
1580
1581         Added "closing_parenthesis:" and "error_recovery:" to avoid code
1582         duplication in a couple of error recovery rules. Some other rules
1583         were also refactored which allows to reduce the the number of
1584         shift/reduce conflicts by 2.
1585
1586         No new tests required as this is just a refactoring, no new
1587         functionality added.
1588
1589         * css/CSSGrammar.y.in:
1590
1591 2013-05-28  Sergio Villar Senin  <svillar@igalia.com>
1592
1593         Invalid block doesn't make declaration invalid
1594         https://bugs.webkit.org/show_bug.cgi?id=115709
1595
1596         Reviewed by Andreas Kling.
1597
1598         From Blink r149446 by <serya@chromium.org>
1599
1600         Added a new rule "declaration_recovery:" which covers any kind of
1601         "invalid_block_list maybe_space" sequence. By appending this new
1602         rule to every rule reductable to "declaration:" we can remove some
1603         redundant rules and improve error recovery of some others that
1604         were only accepting exactly one error.
1605
1606         One of the rules being removed was preventing invalid blocks in a
1607         declaration to invalidate the whole declaration. The rule was
1608         reporting the syntax error but at the same time accepting the
1609         invalid block as part of a valid declaration.
1610
1611         * css/CSSGrammar.y.in:
1612
1613 2013-05-28  Andreas Kling  <akling@apple.com>
1614
1615         Move dispatching of focus-related events from Node to Element.
1616         <http://webkit.org/b/116864>
1617
1618         Reviewed by Antti Koivisto.
1619
1620         ...and pass around pointers to Element instead of Node.
1621
1622         * dom/Node.cpp:
1623         * dom/Node.h:
1624         * dom/Element.h:
1625         * dom/Element.cpp:
1626         (WebCore::Element::dispatchFocusInEvent):
1627         (WebCore::Element::dispatchFocusOutEvent):
1628         (WebCore::Element::dispatchFocusEvent):
1629         (WebCore::Element::dispatchBlurEvent):
1630
1631             Moved here from Node.
1632
1633         * html/HTMLFormControlElement.h:
1634         * html/HTMLFormControlElement.cpp:
1635         (WebCore::HTMLFormControlElement::dispatchBlurEvent):
1636         * html/HTMLSelectElement.h:
1637         * html/HTMLSelectElement.cpp:
1638         (WebCore::HTMLSelectElement::dispatchFocusEvent):
1639         (WebCore::HTMLSelectElement::dispatchBlurEvent):
1640         * html/HTMLTextFormControlElement.h:
1641         * html/HTMLTextFormControlElement.cpp:
1642         (WebCore::HTMLTextFormControlElement::dispatchFocusEvent):
1643         (WebCore::HTMLTextFormControlElement::dispatchBlurEvent):
1644
1645             Update subclass overrides and sprinkle OVERRIDE/FINAL.
1646
1647 2013-05-28  Zan Dobersek  <zdobersek@igalia.com>
1648
1649         Remove CachedResourceRequest::initiatorElement
1650         https://bugs.webkit.org/show_bug.cgi?id=116862
1651
1652         Reviewed by Andreas Kling.
1653
1654         The CachedResourceRequest::initiatorElement method is not used anywhere and should be removed.
1655
1656         * loader/cache/CachedResourceRequest.cpp: Remove the initiatorElement method definition.
1657         * loader/cache/CachedResourceRequest.h:
1658         (CachedResourceRequest): Remove the initiatorElement method declaration.
1659
1660 2013-05-28  Andreas Kling  <akling@apple.com>
1661
1662         Document::setFocusedNode() should be setFocusedElement().
1663         <http://webkit.org/b/116857>
1664
1665         Reviewed by Antti Koivisto.
1666
1667         Only Elements can be focused, so tighten Document's idea of what's focused.
1668
1669         Most of this patch is just updating call sites for the new names and removing
1670         now-unnecessary isElementNode() checks and casts.
1671
1672         * WebCore.exp.in:
1673         * accessibility/AXObjectCache.cpp:
1674         (WebCore::AXObjectCache::focusedUIElementForPage):
1675         * accessibility/AccessibilityNodeObject.cpp:
1676         (WebCore::AccessibilityNodeObject::canSetFocusAttribute):
1677         * accessibility/AccessibilityRenderObject.cpp:
1678         (WebCore::AccessibilityRenderObject::isFocused):
1679         (WebCore::AccessibilityRenderObject::setFocused):
1680         (WebCore::AccessibilityRenderObject::handleActiveDescendantChanged):
1681         * bindings/objc/DOM.mm:
1682         (-[DOMElement isFocused]):
1683         * dom/Document.cpp:
1684         (WebCore::Document::dispose):
1685         (WebCore::Document::detach):
1686         (WebCore::Document::focusedNodeRemoved):
1687         (WebCore::Document::removeFocusedNodeOfSubtree):
1688         (WebCore::Document::setFocusedElement):
1689         (WebCore::Document::updateFocusAppearanceTimerFired):
1690         (WebCore::eventTargetNodeForDocument):
1691         * dom/Document.h:
1692         (Document):
1693         (WebCore::Document::focusedElement):
1694         * dom/Element.cpp:
1695         (WebCore::Element::attach):
1696         (WebCore::Element::focus):
1697         (WebCore::Element::blur):
1698         (WebCore::Element::cancelFocusAppearanceUpdate):
1699         * dom/Node.cpp:
1700         (WebCore::Node::rendererIsEditable):
1701         * dom/TreeScope.cpp:
1702         (WebCore::TreeScope::focusedElement):
1703         * dom/UserTypingGestureIndicator.cpp:
1704         (WebCore::UserTypingGestureIndicator::UserTypingGestureIndicator):
1705         * editing/Editor.cpp:
1706         (WebCore::Editor::setBaseWritingDirection):
1707         (WebCore::Editor::setComposition):
1708         (WebCore::Editor::guessesForMisspelledOrUngrammatical):
1709         * editing/EditorCommand.cpp:
1710         (WebCore::verticalScrollDistance):
1711         * editing/FrameSelection.cpp:
1712         (WebCore::FrameSelection::selectAll):
1713         (WebCore::FrameSelection::focusedOrActiveStateChanged):
1714         (WebCore::FrameSelection::setFocusedElementIfNeeded):
1715         (WebCore::FrameSelection::currentForm):
1716         * history/CachedPage.cpp:
1717         (WebCore::CachedPage::restore):
1718         * html/HTMLInputElement.cpp:
1719         (WebCore::HTMLInputElement::updateType):
1720         (WebCore::HTMLInputElement::attach):
1721         * html/HTMLTextAreaElement.cpp:
1722         (WebCore::HTMLTextAreaElement::setValueCommon):
1723         * html/HTMLTextFormControlElement.cpp:
1724         (WebCore::HTMLTextFormControlElement::placeholderShouldBeVisible):
1725         (WebCore::HTMLTextFormControlElement::selectionStart):
1726         (WebCore::HTMLTextFormControlElement::selectionEnd):
1727         (WebCore::HTMLTextFormControlElement::selectionDirection):
1728         * html/RadioInputType.cpp:
1729         (WebCore::RadioInputType::handleKeydownEvent):
1730         (WebCore::RadioInputType::isKeyboardFocusable):
1731         * html/shadow/DateTimeEditElement.cpp:
1732         (WebCore::DateTimeEditElement::focusedFieldIndex):
1733         * loader/FrameLoader.cpp:
1734         (WebCore::FrameLoader::stopLoading):
1735         * page/DOMWindow.cpp:
1736         (WebCore::DOMWindow::focus):
1737         * page/EventHandler.cpp:
1738         (WebCore::EventHandler::scrollOverflow):
1739         (WebCore::EventHandler::logicalScrollOverflow):
1740         (WebCore::EventHandler::dispatchMouseEvent):
1741         (WebCore::EventHandler::sendContextMenuEventForKey):
1742         (WebCore::EventHandler::capsLockStateMayHaveChanged):
1743         * page/FocusController.cpp:
1744         (WebCore::dispatchEventsOnWindowAndFocusedNode):
1745         (WebCore::FocusController::advanceFocusInDocumentOrder):
1746         (WebCore::FocusController::setFocusedElement):
1747         (WebCore::FocusController::findFocusCandidateInContainer):
1748         (WebCore::FocusController::advanceFocusDirectionallyInContainer):
1749         (WebCore::FocusController::advanceFocusDirectionally):
1750         * page/FrameView.cpp:
1751         (WebCore::FrameView::scrollToAnchor):
1752         * plugins/PluginView.cpp:
1753         (WebCore::PluginView::focusPluginElement):
1754         * plugins/efl/PluginViewEfl.cpp:
1755         (WebCore::PluginView::setFocus):
1756         * plugins/mac/PluginViewMac.mm:
1757         (WebCore::PluginView::platformStart):
1758         * rendering/RenderImage.cpp:
1759         (WebCore::RenderImage::paintAreaElementFocusRing):
1760         * rendering/RenderListBox.cpp:
1761         (WebCore::RenderListBox::paintItemForeground):
1762         (WebCore::RenderListBox::paintItemBackground):
1763         * rendering/RenderTextControlSingleLine.cpp:
1764         (WebCore::RenderTextControlSingleLine::capsLockStateMayHaveChanged):
1765         (WebCore::RenderTextControlSingleLine::textShouldBeTruncated):
1766         * rendering/RenderTheme.cpp:
1767         (WebCore::RenderTheme::isFocused):
1768
1769 2013-05-28  Sergio Villar Senin  <svillar@igalia.com>
1770
1771         Web Inspector: Enable CSS logging
1772         https://bugs.webkit.org/show_bug.cgi?id=113401
1773
1774         Reviewed by Benjamin Poulain.
1775
1776         From Blink r149265 by <serya@chromium.org>
1777
1778         CSS logging was disabled in r147028 to prevent message overflow in
1779         the inspector console. This change restores it by modifying the
1780         CSS grammar in order to reduce as much consecutive errors as
1781         possible in 'declaration_list' and 'decl_list' rules.
1782
1783         This way, for rules like 'x { color: ### }' only the first '#'
1784         will be reported as error (instead of 3 identical errors).
1785
1786         The rule 'declaration' still produces multiple errors, because it
1787         does not eat as much errors as possible. So in order not to create
1788         a complex risky patch we just disable logging in the parser for
1789         that rule.
1790
1791         * css/CSSGrammar.y.in:
1792         * css/CSSParser.cpp:
1793         (WebCore::CSSParser::CSSParser):
1794         (WebCore::CSSParser::parseSheet):
1795         (WebCore::CSSParser::syntaxError):
1796         (WebCore::CSSParser::isLoggingErrors):
1797         (WebCore::CSSParser::rewriteSpecifiers):
1798         * css/CSSParser.h:
1799         (CSSParser):
1800
1801 2013-05-27  Patrick Gansterer  <paroga@webkit.org>
1802
1803         Build fix for WinCE after r150730.
1804
1805         * platform/graphics/FontFallbackList.cpp:
1806         (WebCore::FontGlyphs::glyphDataAndPageForCharacter):
1807
1808 2013-05-27  Patrick Gansterer  <paroga@webkit.org>
1809
1810         Build fix for WinCE after r150772.
1811
1812         * platform/win/ClipboardWin.cpp:
1813         (WebCore):
1814         * platform/win/PasteboardWin.cpp:
1815         (WebCore::Pasteboard::readFilenames):
1816         (WebCore):
1817
1818 2013-05-27  Darin Adler  <darin@apple.com>
1819
1820         Fix build.
1821
1822         * html/HTMLAnchorElement.cpp:
1823         (WebCore::hasNonEmptyBox): Fix typo.
1824
1825 2013-05-27  Darin Adler  <darin@apple.com>
1826
1827         Move hasNonEmptyBoundingBox from Node to HTMLAnchorElement
1828         https://bugs.webkit.org/show_bug.cgi?id=116842
1829
1830         Reviewed by Antti Koivisto.
1831
1832         * dom/Node.cpp: Removed hasNonEmptyBoundingBox.
1833         * dom/Node.h: Ditto.
1834
1835         * html/HTMLAnchorElement.cpp:
1836         (WebCore::HTMLAnchorElement::isMouseFocusable): Fixed #if to be more readable and
1837         added more-explicit clearer comments. No behavior change.
1838         (WebCore::hasNonEmptyBox): Added.  Has the same code that was in
1839         Node::hasNonEmptyBoundingBox with some additional comments.
1840         (WebCore::HTMLAnchorElement::isKeyboardFocusable): Call hasNonEmptyBox.
1841
1842 2013-05-27  Darin Adler  <darin@apple.com>
1843
1844         Move isBlockFlowElement and related functions out of the Node class into editing code
1845         https://bugs.webkit.org/show_bug.cgi?id=116846
1846
1847         Reviewed by Antti Koivisto.
1848
1849         * dom/Node.cpp: Removed isBlockFlowElement, enclosingBlockFlowElement, and
1850         inSameContainingBlockFlowElement. These are all editing functions that don't
1851         belong in the Node class, and mostly-deprecated ones to boot.
1852         * dom/Node.h: Ditto.
1853
1854         * dom/Position.cpp:
1855         (WebCore::inSameEnclosingBlockFlowElement): Added. This editing-specific function
1856         is used only here, so put it here.
1857         (WebCore::Position::rendersInDifferentPosition): Updated to call new function above.
1858         (WebCore::Position::leadingWhitespacePosition): Ditto.
1859
1860         * editing/InsertLineBreakCommand.cpp:
1861         (WebCore::InsertLineBreakCommand::insertNodeAfterPosition): Use
1862         deprecatedEnclosingBlockFlowElement at its new location.
1863         (WebCore::InsertLineBreakCommand::insertNodeBeforePosition): Ditto.
1864
1865         * editing/InsertListCommand.cpp:
1866         (WebCore::InsertListCommand::doApplyForSingleParagraph): use
1867         isBlockFlowElement at its new location.
1868         * editing/ReplaceSelectionCommand.cpp:
1869         (WebCore::enclosingInline): Ditto.
1870
1871         * editing/VisiblePosition.cpp:
1872         (WebCore::VisiblePosition::canonicalPosition): Use deprecatedEnclosingBlockFlowElement
1873         at its new location.
1874         (WebCore::enclosingBlockFlowElement): Ditto. Also added FIXME.
1875         * editing/VisibleSelection.cpp:
1876         (WebCore::makeSearchRange): Ditto.
1877
1878         * editing/htmlediting.cpp:
1879         (WebCore::isBlockFlowElement): Added. Same as the Node::isBlockFlowElement
1880         function, but here because this is an editing function, not suitable as a Node member.
1881         (WebCore::deprecatedEnclosingBlockFlowElement): Ditto. Added "deprecated" to the name
1882         since the Node member function had a comment saying it was deprecated. Also changed so
1883         it tolerates a 0 for an argument, which made it easier for one caller.
1884
1885         * editing/htmlediting.h: Added the two new functions.
1886
1887 2013-05-27  Seokju Kwon  <seokju.kwon@gmail.com>
1888
1889         Add guard around paintForFixedRootBackground
1890         https://bugs.webkit.org/show_bug.cgi?id=116754
1891
1892         Reviewed by Simon Fraser.
1893
1894         paintForFixedRootBackground is only used when ACCELERATED_COMPOSITING is enabled.
1895
1896         No new tests, no behavior change.
1897
1898         * rendering/RenderLayer.cpp:
1899         (WebCore):
1900
1901 2013-05-27  Seokju Kwon  <seokju.kwon@gmail.com>
1902
1903         Remove a leftover Pagepoup from PickerIndicatorElement.h
1904         https://bugs.webkit.org/show_bug.cgi?id=116801
1905
1906         Reviewed by Anders Carlsson.
1907
1908         No new tests, no behavior change.
1909
1910         * html/shadow/PickerIndicatorElement.h:
1911         (WebCore):
1912
1913 2013-05-27  Claudio Saavedra  <csaavedra@igalia.com>
1914
1915         [CSS] -webkit-var prefix is case-sensitive
1916         https://bugs.webkit.org/show_bug.cgi?id=116829
1917
1918         Reviewed by Darin Adler.
1919
1920         Tests: Added case to fast/css/variables/case-sensitive.html
1921
1922         * css/CSSParser.cpp:
1923         (WebCore::isEqualToCSSCaseSensitiveIdentifier): Add variant to
1924         IsEqualToCSSIdentifier that respects case-sensitivity.
1925         (WebCore::CSSParser::realLex): Use the above method for CSS
1926         variable declarations.
1927
1928 2013-05-27  Zalan Bujtas  <zalan@apple.com>
1929
1930         drop-shadow filter with overflow:hidden child misbehaves.
1931         https://bugs.webkit.org/show_bug.cgi?id=109783
1932
1933         Reviewed by Simon Fraser.
1934
1935         Applying CSS filters only to the scrollbar rect leaves rendering
1936         artefacts. Filters should skip such partial repaints.
1937
1938         Tests: Test framework uses mock theme for scrollbars. Such scrollbars do not
1939         initiate partial repaints.
1940
1941         * rendering/RenderLayer.cpp:
1942         (WebCore::RenderLayer::setupFilters):
1943         (WebCore::RenderLayer::paintLayerContents):
1944         * rendering/RenderLayer.h:
1945         (RenderLayer):
1946
1947 2013-05-27  Xueqing Huang  <huangxueqing@baidu.com>
1948
1949         Move Windows port off legacy clipboard.
1950         https://bugs.webkit.org/show_bug.cgi?id=116258
1951
1952         Reviewed by Darin Adler.
1953
1954         Clipboard refactor, no new tests.
1955
1956         * dom/Clipboard.h:
1957         * page/win/EventHandlerWin.cpp:
1958         (WebCore::EventHandler::createDraggingClipboard): Create Clipboard instead of ClipboardWin.
1959         * platform/Pasteboard.h:
1960         (WebCore::Pasteboard::dataObject): Get IDataObject by Clipborad.
1961         (WebCore::Pasteboard::writableDataObject): Get WCDataObject by Clipborad.
1962         * platform/win/ClipboardWin.cpp:
1963         (WebCore::Clipboard::createDragImage): Change parameter name loc to dragLocation.
1964         (WebCore::Clipboard::declareAndWriteDragImage): Implement declareAndWriteDragImage use WCDataObject exposed by Pasteboard.
1965         * platform/win/ClipboardWin.h: Removed.
1966         * platform/win/EditorWin.cpp:
1967         (WebCore::Editor::newGeneralClipboard): Create Clipboard instead of ClipboardWin.
1968         * platform/win/PasteboardWin.cpp:
1969         (WebCore::Pasteboard::createForCopyAndPaste): Create a Pasteboard.
1970         (WebCore::Pasteboard::createPrivate): Ditto.
1971         (WebCore::Pasteboard::createForDragAndDrop): Ditto.
1972         (WebCore::Pasteboard::finishCreatingPasteboard): Create Pasteboard use Windows API.
1973         (WebCore::Pasteboard::Pasteboard):
1974         (WebCore::clipboardTypeFromMIMEType): Copied from ClipboardWin.cpp.
1975         (WebCore::Pasteboard::clear): Ditto.
1976         (WebCore::Pasteboard::hasData): Ditto.
1977         (WebCore::addMimeTypesForFormat): Ditto.
1978         (WebCore::Pasteboard::types): Ditto.
1979         (WebCore::Pasteboard::readString): Ditto.
1980         (WebCore::Pasteboard::readFilenames): Ditto.
1981         (WebCore::writeURL): Ditto.
1982         (WebCore::Pasteboard::writeString): Ditto.
1983         (WebCore::Pasteboard::setDragImage): Ditto.
1984         (WebCore::Pasteboard::writeRangeToDataObject): Write range to WCDataObject.
1985         (WebCore::Pasteboard::writeSelection):
1986         (WebCore::Pasteboard::writePlainTextToDataObject): Write PlainText to WCDataObject.
1987         (WebCore::Pasteboard::writePlainText):
1988         (WebCore::pathRemoveBadFSCharacters): Copied from ClipboardWin.cpp.
1989         (WebCore::filesystemPathFromUrlOrTitle): Ditto.
1990         (WebCore::writeFileToDataObject): Ditto.
1991         (WebCore::Pasteboard::writeURLToDataObject): Write URL to WCDataObject.
1992         (WebCore::Pasteboard::writeURL): Copied from ClipboardWin.cpp.
1993         (WebCore::Pasteboard::writePasteboard): Copied from Pasteboard::writeClipboard.
1994         (WebCore::Pasteboard::documentFragment): Copied from ClipboardWin.cpp.
1995         (WebCore::Pasteboard::setExternalDataObject): Clipboard can set new IDataObject.
1996         (WebCore::getCachedImage): Copied from ClipboardWin.cpp.
1997         (WebCore::createGlobalImageFileDescriptor): Ditto.
1998         (WebCore::createGlobalImageFileContent): Ditto.
1999         (WebCore::createGlobalHDropContent): Ditto.
2000         (WebCore::Pasteboard::writeImageToDataObject): Expose to make Clipboard implement declareAndWriteDragImage.
2001         (WebCore::Pasteboard::writeURLToWritableDataObject): Ditto.
2002
2003 2013-05-27  Tim Horton  <timothy_horton@apple.com>
2004
2005         PDFPlugin: Main-frame PDFPlugin Accessibility
2006         https://bugs.webkit.org/show_bug.cgi?id=116563
2007         <rdar://problem/13458534>
2008
2009         Reviewed by Sam Weinig.
2010
2011         * WebCore.exp.in: Export AffineTransform::mapRect.
2012
2013 2013-05-27  Tiancheng Jiang  <tijiang@rim.com>
2014
2015         Checkbox UX update.
2016         https://bugs.webkit.org/show_bug.cgi?id=116838.
2017
2018         Reviewed by Rob Buis.
2019
2020         BlackBerry PR 342302.
2021         Internally Reviewed by Jeff Rogers.
2022         Remove old background and change pressed checkmark image.
2023
2024         * platform/blackberry/RenderThemeBlackBerry.cpp:
2025         (WebCore::RenderThemeBlackBerry::paintCheckbox):
2026
2027 2013-05-27  Sam Weinig  <sam@webkit.org>
2028
2029         When the background is completely transparent we should be conservative and use the default scrollbar style, not the light one
2030         https://bugs.webkit.org/show_bug.cgi?id=116836
2031         <rdar://problem/13949905>
2032
2033         Reviewed by Simon Fraser.
2034
2035         * page/FrameView.cpp:
2036         (WebCore::FrameView::recalculateScrollbarOverlayStyle):
2037         Don't use the light style when the background is completely transparent.
2038
2039 2013-05-27  Patrick Gansterer  <paroga@webkit.org>
2040
2041         Use ICU_INCLUDE_DIRS in BlackBerry CMake files
2042         https://bugs.webkit.org/show_bug.cgi?id=116210
2043
2044         Reviewed by Rob Buis.
2045
2046         Set and use the ICU_INCLUDE_DIRS variable to avoid
2047         duplicated adding of the ICU include directory.
2048
2049         * PlatformBlackBerry.cmake:
2050
2051 2013-05-27  Antti Koivisto  <antti@apple.com>
2052
2053         Tighten FontGlyphs::glyphDataAndPageForCharacter to take FontDescription
2054         https://bugs.webkit.org/show_bug.cgi?id=116823
2055
2056         Reviewed by Andreas Kling.
2057
2058         FontGlyphs does not need to know about Font anymore.
2059
2060         * platform/graphics/Font.cpp:
2061         (WebCore::Font::Font):
2062         (WebCore::Font::operator=):
2063         * platform/graphics/Font.h:
2064         (WebCore::Font::isPlatformFont):
2065         (WebCore::Font::glyphDataAndPageForCharacter):
2066         (Font):
2067         * platform/graphics/FontCache.h:
2068         * platform/graphics/FontFallbackList.cpp:
2069         (WebCore::FontGlyphs::FontGlyphs):
2070         (WebCore::FontGlyphs::glyphDataAndPageForCharacter):
2071         * platform/graphics/FontFallbackList.h:
2072         (WebCore):
2073         (WebCore::FontGlyphs::createForPlatformFont):
2074         
2075             Tweaked the name.
2076
2077         (WebCore::FontGlyphs::isForPlatformFont):
2078         
2079             Move knowledge about platform font to FontGlyphs as it is needed for resolving system fallback on Mac.
2080
2081         * platform/graphics/blackberry/FontCacheBlackBerry.cpp:
2082         (WebCore::FontCache::systemFallbackForCharacters):
2083         * platform/graphics/freetype/FontCacheFreeType.cpp:
2084         (WebCore::FontCache::systemFallbackForCharacters):
2085         * platform/graphics/mac/FontCacheMac.mm:
2086         (WebCore::FontCache::systemFallbackForCharacters):
2087         * platform/graphics/qt/FontCacheQt.cpp:
2088         (WebCore::FontCache::systemFallbackForCharacters):
2089         * platform/graphics/win/FontCacheWin.cpp:
2090         (WebCore::FontCache::systemFallbackForCharacters):
2091         * platform/graphics/wince/FontCacheWinCE.cpp:
2092         (WebCore::FontCache::systemFallbackForCharacters):
2093         
2094             More descriptive name and tighter interface.
2095
2096 2013-05-27  Mihnea Ovidenie  <mihnea@adobe.com>
2097
2098         [CSSRegions] Prevent unnecessary copy of LayoutRect objects
2099         https://bugs.webkit.org/show_bug.cgi?id=116828
2100
2101         Reviewed by Andreas Kling.
2102
2103         Use const references for parameter passing.
2104         No functional change, no new tests.
2105
2106         * rendering/RenderFlowThread.cpp:
2107         (WebCore::RenderFlowThread::paintFlowThreadPortionInRegion):
2108         (WebCore::RenderFlowThread::hitTestFlowThreadPortionInRegion):
2109         * rendering/RenderFlowThread.h:
2110         * rendering/RenderRegion.cpp:
2111         (WebCore::RenderRegion::overflowRectForFlowThreadPortion):
2112         * rendering/RenderRegion.h:
2113
2114 2013-05-27  Leo Yang  <leoyang@rim.com>
2115
2116         [BlackBerry] Reveal HTTP error code for XHR even if there is no response body
2117         https://bugs.webkit.org/show_bug.cgi?id=116543
2118
2119         Reviewed by Rob Buis.
2120         Reviewed internally by Joe Mason.
2121
2122         It's a regression introduced by r132556.
2123         BlackBerry is doing friendly HTTP error handling: if there is no response body
2124         for an HTTP error it will display an error message made by the port. But for a
2125         XHR request, which usually does not result in displaying error messages to the
2126         end user, HTTP error code should be revealed to let the JavaScript know what
2127         the actual server error code is.
2128
2129         Covered by existing tests:
2130         ManualTests/blackberry/head-xhr-nonexistant-file.html
2131         LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-check-head-readystate-for-404.html
2132         LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-check-get-readystate-for-404-without-body.html
2133
2134         * platform/network/blackberry/NetworkJob.cpp:
2135         (WebCore::NetworkJob::shouldNotifyClientFailed):
2136
2137 2013-05-27  Tiancheng Jiang  <tijiang@rim.com>
2138
2139         Adjust date input width.
2140         https://bugs.webkit.org/show_bug.cgi?id=100760.
2141
2142         Reviewed by Rob Buis.
2143
2144         BlackBerry PR 343497.
2145         Internally Reviewed by Jeff Rogers.
2146
2147         Set width to auto to fit the string length.
2148
2149         * css/themeBlackBerry.css:
2150         (input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="time"], input[type="month"]):
2151
2152 2013-05-27  Andreas Kling  <akling@apple.com>
2153
2154         Document::setHoveredNode() should be setHoveredElement().
2155         <http://webkit.org/b/116819>
2156
2157         Reviewed by Antti Koivisto.
2158
2159         Only Elements can be hovered, teach Document about this.
2160
2161         * dom/Document.h:
2162         * dom/Document.cpp:
2163         (WebCore::Document::dispose):
2164         (WebCore::Document::detach):
2165
2166             m_hoverNode => m_hoveredElement.
2167             Removed hoverNode() and setHoverNode() since those were only used internally.
2168
2169         (WebCore::Document::updateHoverActiveState):
2170
2171             Updated for hovered things always being Elements.
2172
2173         (WebCore::Document::hoveredElementDidDetach):
2174         * dom/Element.cpp:
2175         (WebCore::Element::detach):
2176
2177             Renamed Document::hoveredNodeDetached() to hoveredElementDidDetach() and fix it up
2178             following the same pattern as elementInActiveChainDidDetach().
2179
2180 2013-05-27  Allan Sandfeld Jensen  <allan.jensen@digia.com>
2181
2182         [Qt] REGRESSION(r150716): It made 15 inspector and 1 mozilla test to assert
2183         https://bugs.webkit.org/show_bug.cgi?id=116822
2184
2185         Reviewed by Andreas Kling.
2186
2187         The input fontDescription may have more than one family defined.
2188
2189         * platform/qt/RenderThemeQStyle.cpp:
2190         (WebCore::RenderThemeQStyle::adjustButtonStyle):
2191
2192 2013-05-27  Jocelyn Turcotte  <jocelyn.turcotte@digia.com>
2193
2194         [Qt][Win] Input events aren't mapped properly with windowless plugins.
2195         https://bugs.webkit.org/show_bug.cgi?id=116094
2196
2197         Reviewed by Tor Arne Vestbø.
2198
2199         The events are first sent properly but Flash then immediately repaints
2200         and this causes flickering painting.
2201         The issue is that Flash seems to be doing some input event tracking of
2202         its own internally, using the HWND returned through NPN_GetValue(NPNVnetscapeWindow).
2203
2204         We are currently using two coordinate systems for windowless plugins on Windows with Qt:
2205         - FrameView coordinates: Used for input events and ajusted with the WM_WINDOWPOSCHANGED message
2206         - Drawable coordinates: Used by WM_PAINT and adjusted with NPP_SetWindow
2207
2208         This patch fixes the bug by mapping input events to the native window returned
2209         as NPNVnetscapeWindow instead of the FrameView to ensure that those coordinates will match
2210         the ones used by Flash internally.
2211         With this we shouldn't be using FrameView coordinates anywhere for windowless plugins
2212         on Windows with Qt.
2213
2214         * platform/qt/QWebPageClient.h:
2215         (QWebPageClient):
2216           Added mapToOwnerWindow to the interface, mapping from the FrameView up to the wrapping nativeParentWidget.
2217         * plugins/win/PluginViewWin.cpp:
2218         (WebCore::contentsToNativeWindow):
2219         (WebCore::PluginView::paintIntoTransformedContext):
2220         (WebCore::PluginView::handleMouseEvent):
2221
2222 2013-05-27  Antti Koivisto  <antti@apple.com>
2223
2224         Tighten FontGlyphs interfaces to take FontDescription instead of Font
2225         https://bugs.webkit.org/show_bug.cgi?id=116818
2226
2227         Reviewed by Andreas Kling.
2228
2229         This gives better understanding of what the actual inputs are.
2230
2231         * WebCore.exp.in:
2232         * platform/graphics/Font.h:
2233         (WebCore::Font::primaryFont):
2234         (WebCore::Font::fontDataAt):
2235         (WebCore::Font::isFixedPitch):
2236         * platform/graphics/FontCache.cpp:
2237         (WebCore::FontCache::getFontData):
2238         * platform/graphics/FontCache.h:
2239         * platform/graphics/FontFallbackList.cpp:
2240         (WebCore::FontGlyphs::determinePitch):
2241         (WebCore::FontGlyphs::realizeFontDataAt):
2242         (WebCore::FontGlyphs::glyphDataAndPageForCharacter):
2243         * platform/graphics/FontFallbackList.h:
2244         (WebCore::FontGlyphs::primaryFontData):
2245         (WebCore::FontGlyphs::isFixedPitch):
2246         (WebCore::FontGlyphs::primarySimpleFontData):
2247         * platform/graphics/blackberry/FontCacheBlackBerry.cpp:
2248         * platform/graphics/freetype/FontCacheFreeType.cpp:
2249         * platform/graphics/mac/FontCacheMac.mm:
2250         (WebCore::FontCache::similarFontPlatformData):
2251         
2252             Drop get* naming and make this Mac only as no other platform has it.
2253
2254         * platform/graphics/qt/FontCacheQt.cpp:
2255         * platform/graphics/win/FontCacheWin.cpp:
2256         * platform/graphics/wince/FontCacheWinCE.cpp:
2257         (WebCore):
2258
2259 2013-05-27  Andreas Kling  <akling@apple.com>
2260
2261         Strengthen typing of detaching an Element from Document's :active chain.
2262         <http://webkit.org/b/116815>
2263
2264         Reviewed by Antti Koivisto.
2265
2266         Tiny cleanup now that the :active chain can only contain elements.
2267         Rename Document::activeChainNodeDetached() to elementInActiveChainDidDetach().
2268
2269         * dom/Element.cpp:
2270         (WebCore::Element::detach):
2271         * dom/Document.h:
2272         * dom/Document.cpp:
2273         (WebCore::Document::elementInActiveChainDidDetach):
2274
2275             Rename, take Element*, remove silly condition that was always true.
2276
2277 2013-05-27  Andrei Bucur  <abucur@adobe.com>
2278
2279         [CSS Regions] Remove the offsetFromLogicalTopOfFirstPage parameter from layout functions
2280         https://bugs.webkit.org/show_bug.cgi?id=116441
2281
2282         Reviewed by David Hyatt.
2283
2284         The patch changes the following things:
2285         - exposes offsetFromLogicalTopOfFirstPage() to all the RenderBoxes;
2286         - offsetFromLogicalTopOfFirstPage() is now safe to call from any box inside a flow thread, not only the
2287         currently being laid out;
2288         - removes the offsetFromLogicalTopOfFirstPage parameter from all the layout functions
2289         that didn't actually required it; when the value is necessary, the offsetFromLogicalTopOfFirstPage
2290         function is called instead;
2291         - RenderFlowThread now handles its own logic for obtaining the offset from logical top of the first
2292         region for a box, based on the layout states pushed on RenderView; it provides a better caching mechanism
2293         that can be used for all the ancestor containing blocks of the current box being laid out.
2294
2295         The RenderBoxRegionInfo structures are cached only based on the box and the region. This means that
2296         passing around a value for offsetFromLogicalTopOfFirstPage different in some cases than others was
2297         risky. If there is a possibility of having a different box info result for a different offset
2298         then the cache is not working correctly.
2299
2300         Tests: No function change, no tests.
2301
2302         * rendering/RenderBlock.cpp:
2303         (WebCore::RenderBlock::computeStartPositionDeltaForChildAvoidingFloats):
2304         (WebCore::RenderBlock::logicalLeftOffsetForContent):
2305         (WebCore::RenderBlock::logicalRightOffsetForContent):
2306         (WebCore::RenderBlock::getClearDelta):
2307         (WebCore::RenderBlock::lineWidthForPaginatedLineChanged):
2308         (WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage):
2309         (WebCore::RenderBlock::logicalWidthChangedInRegions):
2310         * rendering/RenderBlock.h:
2311         (WebCore::RenderBlock::availableLogicalWidthForLine):
2312         (WebCore::RenderBlock::logicalRightOffsetForLine):
2313         (WebCore::RenderBlock::logicalLeftOffsetForLine):
2314         (WebCore::RenderBlock::startOffsetForLine):
2315         (WebCore::RenderBlock::endOffsetForLine):
2316         (WebCore::RenderBlock::availableLogicalWidthForContent):
2317         (WebCore::RenderBlock::startOffsetForContent):
2318         (WebCore::RenderBlock::endOffsetForContent):
2319         (WebCore::RenderBlock::logicalLeftOffsetForContent):
2320         (WebCore::RenderBlock::logicalRightOffsetForContent):
2321         * rendering/RenderBox.cpp:
2322         (WebCore::RenderBox::borderBoxRectInRegion):
2323         (WebCore::RenderBox::constrainLogicalWidthInRegionByMinMax):
2324         (WebCore::RenderBox::shrinkLogicalWidthToAvoidFloats):
2325         (WebCore::RenderBox::containingBlockLogicalWidthForContentInRegion):
2326         (WebCore::RenderBox::containingBlockAvailableLineWidthInRegion):
2327         (WebCore::RenderBox::computeLogicalWidthInRegion):
2328         (WebCore::RenderBox::computeLogicalWidthInRegionUsing):
2329         (WebCore::RenderBox::renderBoxRegionInfo):
2330         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
2331         (WebCore::RenderBox::containingBlockLogicalHeightForPositioned):
2332         (WebCore::computeInlineStaticDistance):
2333         (WebCore::RenderBox::computePositionedLogicalWidth):
2334         (WebCore::RenderBox::computePositionedLogicalWidthUsing):
2335         (WebCore::RenderBox::computePositionedLogicalHeight):
2336         (WebCore::RenderBox::computePositionedLogicalHeightUsing):
2337         (WebCore::RenderBox::computePositionedLogicalWidthReplaced):
2338         (WebCore::RenderBox::computePositionedLogicalHeightReplaced):
2339         (WebCore::RenderBox::offsetFromLogicalTopOfFirstPage):
2340         * rendering/RenderBox.h:
2341         * rendering/RenderFlexibleBox.cpp:
2342         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
2343         * rendering/RenderFlowThread.cpp:
2344         (WebCore::RenderFlowThread::logicalWidthChangedInRegionsForBlock):
2345         (WebCore::RenderFlowThread::hasCachedOffsetFromLogicalTopOfFirstRegion):
2346         (WebCore::RenderFlowThread::cachedOffsetFromLogicalTopOfFirstRegion):
2347         (WebCore::RenderFlowThread::setOffsetFromLogicalTopOfFirstRegion):
2348         (WebCore::RenderFlowThread::clearOffsetFromLogicalTopOfFirstRegion):
2349         (WebCore::RenderFlowThread::currentActiveRenderBox):
2350         (WebCore::RenderFlowThread::pushFlowThreadLayoutState):
2351         (WebCore::RenderFlowThread::popFlowThreadLayoutState):
2352         (WebCore::RenderFlowThread::offsetFromLogicalTopOfFirstRegion):
2353         (WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent):
2354         * rendering/RenderFlowThread.h:
2355         * rendering/RenderTable.cpp:
2356         (WebCore::RenderTable::updateLogicalWidth):
2357         * rendering/RenderView.cpp:
2358         (WebCore::RenderView::pushLayoutState):
2359         (WebCore::RenderView::pushLayoutStateForCurrentFlowThread):
2360         (WebCore::RenderView::popLayoutStateForCurrentFlowThread):
2361         * rendering/RenderView.h:
2362         (WebCore::RenderView::pushLayoutState):
2363         (WebCore::RenderView::popLayoutState):
2364
2365 2013-05-27  Allan Sandfeld Jensen  <allan.jensen@digia.com>
2366
2367         Active DOM objects stopped twice
2368         https://bugs.webkit.org/show_bug.cgi?id=116524
2369
2370         Reviewed by Alexey Proskuryakov.
2371
2372         Only iterate over all active DOM object to stop them once.
2373
2374         To ensure later created active DOM objects are stopped,
2375         suspendActiveDOMObjectIfNeeded now also stops active DOM objects
2376         if needed. This also fixes an existing bug when active DOM
2377         objects were created after stopActiveDOMObjects had been called.
2378
2379         Two existing tests creates new active DOM objects after stopActiveDOMObjects
2380         has been called:
2381             fast/dom/xmlhttprequest-constructor-in-detached-document.html
2382             fast/dom/Window/timer-null-script-execution-context.html
2383
2384         * dom/ScriptExecutionContext.cpp:
2385         (WebCore::ScriptExecutionContext::stopActiveDOMObjects):
2386         (WebCore::ScriptExecutionContext::suspendActiveDOMObjectIfNeeded):
2387
2388 2013-05-27  Charles Wei  <charles.wei@torchmobile.com.cn>
2389
2390         Remove redundant CachedRawResource::loader()
2391         https://bugs.webkit.org/show_bug.cgi?id=116805
2392
2393         Reviewed by Andreas Kling.
2394
2395         Just remove redundant code, no test case needed.
2396
2397         * loader/cache/CachedRawResource.cpp:
2398         * loader/cache/CachedRawResource.h:
2399
2400 2013-05-27  Andreas Kling  <akling@apple.com>
2401
2402         WinCE build TLC: Node::active() moved to Element.
2403
2404         * rendering/RenderThemeWinCE.cpp:
2405         (WebCore::RenderThemeWinCE::paintSearchFieldCancelButton):
2406
2407 2013-05-26  Jaehun Lim  <ljaehun.lim@samsung.com>
2408
2409         CSSParser::parseImageResolution doesn't need a parameter.
2410         https://bugs.webkit.org/show_bug.cgi?id=116755
2411
2412         Reviewed by Darin Adler.
2413
2414         parseImageResolution() can get CSSPraserValueList from m_valueList directly.
2415
2416         No new tests, no behavior change.
2417
2418         * css/CSSParser.cpp:
2419         (WebCore::CSSParser::parseImageResolution):
2420         * css/CSSParser.h:
2421
2422 2013-05-26  Andreas Kling  <akling@apple.com>
2423
2424         Turn TreeScope::focusedNode() into focusedElement().
2425         <http://webkit.org/b/116802>
2426
2427         Reviewed by Darin Adler.
2428
2429         For the hundredth time, only Elements can be focused!
2430
2431         This change mostly reverts r121079 since that made things unnecessarily complicated
2432         just to tweak the behavior of ShadowRoot.activeElement, an API that we don't expose.
2433         Finding a TreeScope's focused element now does a simple walk up the parent chain instead
2434         of running the full Shadow DOM re-targeting algorithm.
2435
2436         (WebCore::TreeScope::focusedElement):
2437
2438             Simplify and return Element* instead of Node*.
2439
2440         * dom/TreeScope.h:
2441         * dom/TreeScope.cpp:
2442         (WebCore::focusedFrameOwnerElement):
2443
2444             Make this return Element* as the name already suggested.
2445
2446         * dom/Document.cpp:
2447         (WebCore::Document::removeFocusedNodeOfSubtree):
2448         * dom/Element.cpp:
2449         (WebCore::Element::blur):
2450         * dom/ShadowRoot.h:
2451         (WebCore::ShadowRoot::activeElement):
2452         * html/HTMLDocument.cpp:
2453         (WebCore::HTMLDocument::activeElement):
2454
2455             Simplified call sites that were paranoid about getting a non-Element focused node.
2456
2457 2013-05-26  Dean Jackson  <dino@apple.com>
2458
2459         Plugins with no src but valid type should not snapshot
2460         https://bugs.webkit.org/show_bug.cgi?id=116799
2461         <rdar://problem/13695911>
2462
2463         Reviewed by Simon Fraser.
2464
2465         There are a few plug-ins around that don't take any source content
2466         via the src attribute, but rather just load the binary based on the
2467         mime-type. In those cases we shouldn't snapshot until we have a
2468         mechanism to do so.
2469
2470         * html/HTMLPlugInImageElement.cpp:
2471         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
2472             Add MIMEType logging, and detect the case of no src but valid type.
2473         * html/HTMLPlugInImageElement.h: Add another SnapshotReason enum for
2474             this special case.
2475
2476 2013-05-26  Antti Koivisto  <antti@apple.com>
2477
2478         Encapsulate FontGlyphs
2479         https://bugs.webkit.org/show_bug.cgi?id=116803
2480
2481         Reviewed by Andreas Kling.
2482
2483         FontGlyphs is unfriending Font. Give it a real class interface and some actual code.
2484
2485         * platform/graphics/Font.cpp:
2486         (WebCore::Font::Font):
2487         * platform/graphics/Font.h:
2488         (WebCore::Font::glyphDataForCharacter):
2489         (WebCore::Font::glyphDataAndPageForCharacter):
2490         * platform/graphics/FontFallbackList.cpp:
2491         (WebCore::FontGlyphs::FontGlyphs):
2492         (WebCore::isInRange):
2493         (WebCore::shouldIgnoreRotation):
2494         (WebCore::glyphDataAndPageForNonCJKCharacterWithGlyphOrientation):
2495         
2496             Helpers from FontFastPath.cpp.
2497
2498         (WebCore::FontGlyphs::glyphDataAndPageForCharacter):
2499         
2500             This is the primary interface. The code moves here from FontFastPath.cpp.
2501
2502         * platform/graphics/FontFallbackList.h:
2503         (WebCore::FontGlyphs::createForPlatformData):
2504         
2505             Remove setPlatformData in favor of constructor.
2506
2507         (WebCore::FontGlyphs::primarySimpleFontData):
2508         * platform/graphics/FontFastPath.cpp:
2509         * platform/graphics/GraphicsContext.h:
2510
2511             Remove a stray function definition also called setPlatformFont().
2512
2513         * rendering/svg/SVGTextRunRenderingContext.cpp:
2514         (WebCore::SVGTextRunRenderingContext::glyphDataForCharacter):
2515
2516 2013-05-26  Seokju Kwon  <seokju.kwon@gmail.com>
2517
2518         Remove a leftover CALENDAR_PICKER from LocaleNone.cpp
2519         https://bugs.webkit.org/show_bug.cgi?id=116800
2520
2521         Reviewed by Kent Tamura.
2522
2523         No new tests, no behavior change.
2524
2525         * platform/text/LocaleNone.cpp:
2526         (LocaleNone):
2527
2528 2013-05-26  Antti Koivisto  <antti@apple.com>
2529
2530         Rename FontFallbackList to FontGlyphs
2531         https://bugs.webkit.org/show_bug.cgi?id=116797
2532
2533         Reviewed by Andreas Kling.
2534
2535         Maybe it was a fallback list once. Nowadays its purpose is to cache realized glyphs and related data.
2536         
2537         File renaming will be done separately.
2538
2539         * WebCore.exp.in:
2540         * platform/graphics/Font.cpp:
2541         (WebCore::Font::Font):
2542         (WebCore::Font::operator=):
2543         (WebCore::Font::operator==):
2544         
2545             Refactored to early return style.
2546
2547         (WebCore::Font::update):
2548         (WebCore::Font::width):
2549         * platform/graphics/Font.h:
2550         (Font):
2551         (WebCore::Font::glyphs):
2552         (WebCore::Font::loadingCustomFonts):
2553         (WebCore::Font::primaryFont):
2554         (WebCore::Font::fontDataAt):
2555         (WebCore::Font::isFixedPitch):
2556         (WebCore::Font::fontSelector):
2557         * platform/graphics/FontCache.h:
2558         (FontCache):
2559         * platform/graphics/FontFallbackList.cpp:
2560         (WebCore::FontGlyphs::FontGlyphs):
2561         (WebCore::FontGlyphs::invalidate):
2562         (WebCore::FontGlyphs::releaseFontData):
2563         (WebCore::FontGlyphs::determinePitch):
2564         (WebCore::FontGlyphs::realizeFontDataAt):
2565         
2566             Renamed for clarity along with m_fontList -> m_realizedFontData.
2567
2568         (WebCore::FontGlyphs::setPlatformFont):
2569         * platform/graphics/FontFallbackList.h:
2570         (FontGlyphs):
2571         (WebCore::FontGlyphs::GlyphPagesStateSaver::GlyphPagesStateSaver):
2572         (WebCore::FontGlyphs::GlyphPagesStateSaver::~GlyphPagesStateSaver):
2573         (GlyphPagesStateSaver):
2574         (WebCore::FontGlyphs::create):
2575         (WebCore::FontGlyphs::~FontGlyphs):
2576         (WebCore::FontGlyphs::primaryFontData):
2577         * platform/graphics/FontFastPath.cpp:
2578         (WebCore::Font::glyphDataAndPageForCharacter):
2579         * rendering/svg/SVGTextRunRenderingContext.cpp:
2580         (WebCore::SVGTextRunRenderingContext::glyphDataForCharacter):
2581
2582 2013-05-26  Kent Tamura  <tkent@chromium.org>
2583
2584         Remove ENABLE_CALENDAR_PICKER
2585         https://bugs.webkit.org/show_bug.cgi?id=116795
2586
2587         Reviewed by Ryosuke Niwa.
2588
2589         This feature was used only by Chromium port.
2590
2591         * Resources/pagepopups/calendarPicker.css: Removed.
2592         * Resources/pagepopups/calendarPicker.js: Removed.
2593         * css/html.css:
2594         * platform/text/LocaleICU.cpp:
2595         (WebCore::LocaleICU::LocaleICU):
2596         (WebCore):
2597         * platform/text/LocaleICU.h:
2598         (LocaleICU):
2599         * platform/text/PlatformLocale.h:
2600         (Locale):
2601         * platform/text/mac/LocaleMac.h:
2602         (LocaleMac):
2603         * platform/text/mac/LocaleMac.mm:
2604         (WebCore::LocaleMac::monthLabels):
2605         * platform/text/win/LocaleWin.cpp:
2606         (WebCore::LocaleWin::LocaleWin):
2607         (WebCore::LocaleWin::monthLabels):
2608         * platform/text/win/LocaleWin.h:
2609         (LocaleWin):
2610
2611 2013-05-26  Andreas Kling  <akling@apple.com>
2612
2613         Move :active chain participation state from Node to Element.
2614         <http://webkit.org/b/116786>
2615
2616         Reviewed by Antti Koivisto.
2617
2618         Only Elements can be in the :active chain so move the logic there from Node.
2619
2620         * dom/Document.cpp:
2621         (WebCore::Document::updateHoverActiveState):
2622
2623             Add isElementNode() type checks when updating the :active chain.
2624
2625         * dom/Node.h:
2626         * dom/Node.cpp:
2627         (WebCore::Node::detach):
2628         * dom/Element.cpp:
2629         (WebCore::Element::detach):
2630
2631             Move the remaining logic for detaching from the UserActionElementSet to Element.
2632
2633         (WebCore::Element::isUserActionElementInActiveChain):
2634         * dom/Element.h:
2635         (WebCore::Element::inActiveChain):
2636
2637             Move all the :active chain stuff from Node to Element.
2638
2639         * dom/UserActionElementSet.cpp:
2640         (WebCore::UserActionElementSet::didDetach):
2641         * dom/UserActionElementSet.h:
2642         (WebCore::UserActionElementSet::isInActiveChain):
2643         (WebCore::UserActionElementSet::setInActiveChain):
2644
2645             UserActionElementSet now only takes Element* in its API.
2646
2647 2013-05-26  Antti Koivisto  <antti@apple.com>
2648
2649         Remove FontFamily.h/.cpp
2650         https://bugs.webkit.org/show_bug.cgi?id=116788
2651
2652         Reviewed by Anders Carlsson.
2653         
2654         Empty files.
2655
2656         * CMakeLists.txt:
2657         * GNUmakefile.list.am:
2658         * Target.pri:
2659         * WebCore.vcproj/WebCore.vcproj:
2660         * WebCore.vcxproj/WebCore.vcxproj:
2661         * WebCore.xcodeproj/project.pbxproj:
2662         * platform/graphics/FontDescription.h:
2663         * platform/graphics/FontFamily.cpp: Removed.
2664         * platform/graphics/FontFamily.h: Removed.
2665
2666 2013-05-26  Antti Koivisto  <antti@apple.com>
2667
2668         Use Vector instead of custom linked list for font families
2669         https://bugs.webkit.org/show_bug.cgi?id=116783
2670
2671         Reviewed by Andreas Kling.
2672
2673         Get rid of FontFamily and SharedFontFamily.
2674
2675         * accessibility/AccessibilityRenderObject.cpp:
2676         (WebCore::AccessibilityRenderObject::hasSameFont):
2677         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
2678         (getAttributeSetForAccessibilityObject):
2679         * css/CSSComputedStyleDeclaration.cpp:
2680         (WebCore::fontFamilyFromStyle):
2681         * css/DeprecatedStyleBuilder.cpp:
2682         (WebCore::ApplyPropertyFontFamily::applyInheritValue):
2683         (WebCore::ApplyPropertyFontFamily::applyInitialValue):
2684         (WebCore::ApplyPropertyFontFamily::applyValue):
2685         * css/StyleResolver.cpp:
2686         (WebCore::StyleResolver::styleForDocument):
2687         (WebCore::StyleResolver::initializeFontStyle):
2688         * html/canvas/CanvasRenderingContext2D.cpp:
2689         (WebCore::CanvasRenderingContext2D::font):
2690         (WebCore::CanvasRenderingContext2D::setFont):
2691         * page/PrintContext.cpp:
2692         (WebCore::PrintContext::pageProperty):
2693         * platform/efl/RenderThemeEfl.cpp:
2694         (WebCore::RenderThemeEfl::systemFont):
2695         * platform/graphics/Font.h:
2696         (WebCore::Font::firstFamily):
2697         (WebCore::Font::familyCount):
2698         (WebCore::Font::familyAt):
2699         * platform/graphics/FontCache.cpp:
2700         (WebCore::FontCache::getFontData):
2701         * platform/graphics/FontDescription.cpp:
2702         (SameSizeAsFontDescription):
2703         * platform/graphics/FontDescription.h:
2704         (WebCore::FontDescription::FontDescription):
2705         (WebCore::FontDescription::familyCount):
2706         (WebCore::FontDescription::firstFamily):
2707         (WebCore::FontDescription::familyAt):
2708         (WebCore::FontDescription::families):
2709         (WebCore::FontDescription::useFixedDefaultSize):
2710         (WebCore::FontDescription::setOneFamily):
2711         (WebCore::FontDescription::setFamilies):
2712         (WebCore::FontDescription::adoptFamilies):
2713         (WebCore::FontDescription::operator==):
2714         * platform/graphics/FontFamily.cpp:
2715         * platform/graphics/FontFamily.h:
2716         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
2717         (PlatformCALayerWinInternal::displayCallback):
2718         * platform/graphics/mac/FontCacheMac.mm:
2719         (WebCore::FontCache::getSimilarFontPlatformData):
2720         * platform/graphics/qt/FontCacheQt.cpp:
2721         (WebCore::FontCache::getLastResortFallbackFont):
2722         * platform/gtk/RenderThemeGtk.cpp:
2723         (WebCore::RenderThemeGtk::systemFont):
2724         * platform/mac/ThemeMac.mm:
2725         (WebCore::ThemeMac::controlFont):
2726         * platform/qt/RenderThemeQStyle.cpp:
2727         (WebCore::RenderThemeQStyle::adjustButtonStyle):
2728         * platform/text/transcoder/FontTranscoder.cpp:
2729         (WebCore::FontTranscoder::converterType):
2730         * platform/win/DragImageWin.cpp:
2731         (WebCore::dragLabelFont):
2732         * rendering/RenderText.cpp:
2733         (WebCore::RenderText::styleDidChange):
2734         * rendering/RenderTextControl.cpp:
2735         (WebCore::RenderTextControl::computeIntrinsicLogicalWidths):
2736         * rendering/RenderTextControlSingleLine.cpp:
2737         (WebCore::RenderTextControlSingleLine::preferredContentLogicalWidth):
2738         * rendering/RenderThemeMac.mm:
2739         (WebCore::RenderThemeMac::systemFont):
2740         (WebCore::RenderThemeMac::setFontFromControlSize):
2741         * rendering/RenderThemeSafari.cpp:
2742         (WebCore::RenderThemeSafari::systemFont):
2743         (WebCore::RenderThemeSafari::setFontFromControlSize):
2744         * rendering/RenderThemeWin.cpp:
2745         (WebCore::fillFontDescription):
2746
2747 2013-05-26  Andreas Kling  <akling@apple.com>
2748
2749         Move "active" state logic from Node to Element.
2750         <http://webkit.org/b/116785>
2751
2752         Reviewed by Antti Koivisto.
2753
2754         Resolve another 7 year old FIXME by merging the "active" state logic from Node and ContainerNode
2755         and moving it all to Element instead.
2756
2757         * dom/UserActionElementSet.h:
2758         (WebCore::UserActionElementSet::isActive):
2759         (WebCore::UserActionElementSet::setActive):
2760         * dom/ContainerNode.cpp:
2761         * dom/ContainerNode.h:
2762         * dom/Node.cpp:
2763         * dom/Node.h:
2764         * dom/Element.h:
2765         (WebCore::Element::active):
2766         * dom/Element.cpp:
2767         (WebCore::Element::isUserActionElementActive):
2768         (WebCore::Element::setActive):
2769
2770             Moved here from Node/ContainerNode.
2771
2772         * accessibility/AccessibilityNodeObject.cpp:
2773         (WebCore::AccessibilityNodeObject::isPressed):
2774         * dom/Document.cpp:
2775         (WebCore::Document::setFocusedNode):
2776         (WebCore::Document::updateHoverActiveState):
2777         * rendering/RenderTheme.cpp:
2778         (WebCore::RenderTheme::isPressed):
2779         (WebCore::RenderTheme::isSpinUpButtonPartPressed):
2780         * rendering/RenderThemeMac.mm:
2781         (WebCore::getMediaUIPartStateFlags):
2782         (WebCore::RenderThemeMac::updatePressedState):
2783         * platform/qt/RenderThemeQt.cpp:
2784         (WebCore::RenderThemeQt::getMediaControlForegroundColor):
2785
2786             Check that the inspected Node is an Element before asking if it's active.
2787
2788         * html/HTMLAnchorElement.cpp:
2789         (WebCore::HTMLAnchorElement::setActive):
2790
2791             Call the right superclass.
2792
2793         * html/HTMLAnchorElement.h:
2794         * html/HTMLLabelElement.h:
2795         * html/shadow/MediaControlElementTypes.h:
2796
2797             Sprinkle OVERRIDE>
2798
2799 2013-05-26  Andreas Kling  <akling@apple.com>
2800
2801         Move Node::dispatchSimulatedClick() to Element.
2802         <http://webkit.org/b/116784>
2803
2804         Reviewed by Antti Koivisto.
2805
2806         Only Elements use the dispatchSimulatedClick() functionality, so move it there.
2807
2808         * dom/Node.cpp:
2809         * dom/Node.h:
2810         * dom/Element.h:
2811         * dom/Element.cpp:
2812         (WebCore::Element::dispatchSimulatedClick):
2813         * dom/EventDispatcher.h:
2814         * dom/EventDispatcher.cpp:
2815         (WebCore::EventDispatcher::dispatchSimulatedClick):
2816
2817 2013-05-26  Andreas Kling  <akling@apple.com>
2818
2819         TreeScope::rootNode() should return a ContainerNode.
2820         <http://webkit.org/b/116782>
2821
2822         Reviewed by Antti Koivisto.
2823
2824         The rootNode() of a TreeScope is always a ContainerNode, so update pointer types to reflect that.
2825         This lets us take advantage of Antti's optimized traversal functions.
2826
2827         * dom/ContainerNode.h:
2828         (WebCore::Node::isTreeScope):
2829         * dom/Document.cpp:
2830         (WebCore::Document::buildAccessKeyMap):
2831         * dom/Node.cpp:
2832         (WebCore::Node::containingShadowRoot):
2833         * dom/Node.h:
2834         * dom/TreeScope.h:
2835         (WebCore::TreeScope::rootNode):
2836         (TreeScope):
2837         * page/FocusController.cpp:
2838         (WebCore::FocusNavigationScope::rootNode):
2839         (WebCore::FocusNavigationScope::owner):
2840         * page/FocusController.h:
2841         (FocusNavigationScope):
2842
2843 2013-05-26  Andreas Kling  <akling@apple.com>
2844
2845         FocusController::setFocusedNode() should be setFocusedElement().
2846         <http://webkit.org/b/116780>
2847
2848         Reviewed by Antti Koivisto.
2849
2850         Only Elements can have focus, so make the public API of FocusController take Element*.
2851
2852         * WebCore.exp.in:
2853         * page/FocusController.h:
2854         * page/FocusController.cpp:
2855         (WebCore::FocusController::setFocusedElement):
2856
2857             Out with the setFocusedNode(), in with the setFocusedElement().
2858
2859         * dom/Element.cpp:
2860         (WebCore::Element::focus):
2861         (WebCore::Element::blur):
2862         * page/EventHandler.cpp:
2863         (WebCore::EventHandler::dispatchMouseEvent):
2864         * plugins/PluginView.cpp:
2865         (WebCore::PluginView::focusPluginElement):
2866         * editing/FrameSelection.cpp:
2867         (WebCore::FrameSelection::setFocusedNodeIfNeeded):
2868
2869             Tweak for FocusController taking Element* instead of Node*.
2870
2871         (WebCore::FrameSelection::setFocusedElementIfNeeded):
2872
2873             Renamed from setFocusedNodeIfNeeded().
2874
2875         * editing/htmlediting.h:
2876         * editing/htmlediting.cpp:
2877         (WebCore::enclosingAnchorElement):
2878
2879             Cleaned up the loop for readability and made it return an Element.
2880
2881 2013-05-26  Andreas Kling  <akling@apple.com>
2882
2883         Move some form control things from Element to HTMLFormControlElement.
2884         <http://webkit.org/b/116779>
2885
2886         Reviewed by Antti Koivisto.
2887
2888         The following methods sit better on HTMLFormControlElement than on Element:
2889
2890             - formControlType()
2891             - wasChangedSinceLastFormControlChangeEvent()
2892             - setChangedSinceLastFormControlChangeEvent()
2893             - dispatchFormControlChangeEvent()
2894
2895         Moved them, and devirtualized as much as possible.
2896
2897         * dom/Document.cpp:
2898         (WebCore::Document::setFocusedNode):
2899
2900             Check if the old focus target is an Element before (possibly) dispatching a change event.
2901
2902         * dom/Element.cpp:
2903         * dom/Element.h:
2904
2905             Removed some stub methods that were only used by HTMLFormControlElement subclasses.
2906
2907         * html/HTMLFormControlElement.cpp:
2908         * html/HTMLFormControlElement.h:
2909         (WebCore::isHTMLFormControlElement):
2910         (WebCore::toHTMLFormControlElement):
2911
2912             Add toHTMLFormControlElement() helper with ASSERT_WITH_SECURITY_IMPLICATION.
2913
2914         * html/HTMLTextFormControlElement.h:
2915
2916             Sprinkle OVERRIDE.
2917
2918 2013-05-25  Andreas Kling  <akling@apple.com>
2919
2920         Move Node::supportsFocus() to Element.
2921         <http://webkit.org/b/116778>
2922
2923         Reviewed by Antti Koivisto.
2924
2925         Node never supports focus, so move supportsFocus() to Element instead.
2926
2927         * dom/Element.h:
2928         * dom/Node.cpp:
2929         * dom/Node.h:
2930
2931             Removed Node::supportsFocus(), it always returned false anyway.
2932
2933         * accessibility/AccessibilityNodeObject.cpp:
2934         (WebCore::AccessibilityNodeObject::canSetFocusAttribute):
2935
2936             Check that the underlying Node is an Element before asking if it supports focus.
2937
2938         * html/HTMLAnchorElement.h:
2939         * html/HTMLAreaElement.h:
2940         * html/HTMLBodyElement.h:
2941         * html/HTMLElement.h:
2942         * html/HTMLFieldSetElement.h:
2943         * html/HTMLFormControlElement.h:
2944         * html/HTMLFrameElementBase.h:
2945         * html/HTMLMediaElement.h:
2946         * html/HTMLOptGroupElement.h:
2947         * html/HTMLOptionElement.h:
2948         * html/HTMLOutputElement.h:
2949         * svg/SVGAElement.h:
2950         * svg/SVGCircleElement.h:
2951         * svg/SVGEllipseElement.h:
2952         * svg/SVGGElement.h:
2953         * svg/SVGImageElement.h:
2954         * svg/SVGLineElement.h:
2955         * svg/SVGPathElement.h:
2956         * svg/SVGPolyElement.h:
2957         * svg/SVGRectElement.h:
2958         * svg/SVGSVGElement.h:
2959         * svg/SVGSwitchElement.h:
2960         * svg/SVGSymbolElement.h:
2961         * svg/SVGTextElement.h:
2962         * svg/SVGUseElement.h:
2963
2964             OVERRIDE ALL THE THINGS!
2965
2966 2013-05-25  Andreas Kling  <akling@apple.com>
2967
2968         Move Node::isFocusable() to Element.
2969         <http://webkit.org/b/116777>
2970
2971         Reviewed by Anders Carlsson.
2972
2973         Nodes cannot be focusable, so move isFocusable() from Node to Element.
2974
2975         * dom/Node.cpp:
2976         * dom/Node.h:
2977         * dom/Element.h:
2978         * dom/Element.cpp:
2979         (WebCore::Element::isFocusable):
2980
2981             Moved here from Node.
2982
2983         * dom/Document.cpp:
2984         (WebCore::Document::setFocusedNode):
2985         * accessibility/AccessibilityNodeObject.cpp:
2986         (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
2987
2988             Check that the underlying node is an Element before asking if it's focusable.
2989
2990         * page/FrameView.cpp:
2991         (WebCore::FrameView::scrollToAnchor):
2992
2993             Renamed the 'anchorNode' variable to 'anchorElement' because reasons.
2994
2995         * html/HTMLAreaElement.h:
2996         * html/HTMLFormControlElement.h:
2997         * html/HTMLLabelElement.h:
2998         * html/HTMLOptionElement.h:
2999         * svg/SVGAElement.h:
3000
3001             Sprinkle OVERRIDE.
3002
3003         * html/ValidationMessage.cpp:
3004         (WebCore::ValidationMessage::setMessage):
3005
3006             Update a comment to refer to Element::isFocusable() instead of Node.
3007
3008 2013-05-25  Andreas Kling  <akling@apple.com>
3009
3010         Move Node::tabIndex() to Element.
3011         <http://webkit.org/b/116772>
3012
3013         Reviewed by Ryosuke Niwa.
3014
3015         Since only Elements are keyboard-focusable, it doesn't make sense for Node to have a tabIndex().
3016
3017         * dom/Element.h:
3018         * dom/Node.cpp:
3019         * dom/Node.h:
3020
3021             A Node can't have a tab index, so move tabIndex() to Element.
3022
3023         * page/FocusController.h:
3024         * page/FocusController.cpp:
3025         (WebCore::adjustedTabIndex):
3026         (WebCore::FocusController::findElementWithExactTabIndex):
3027         (WebCore::nextElementWithGreaterTabIndex):
3028         (WebCore::previousElementWithLowerTabIndex):
3029         (WebCore::FocusController::nextFocusableNode):
3030         (WebCore::FocusController::previousFocusableNode):
3031
3032             Make this code deal in Element* when doing tab index stuff. FocusController needs
3033             more Node->Element cleanup, but let's do that separately.
3034
3035         * html/HTMLAnchorElement.h:
3036         * html/HTMLElement.h:
3037         * html/HTMLFormControlElement.h:
3038
3039             Sprinkle OVERRIDE.
3040
3041 2013-05-25  Andreas Kling  <akling@apple.com>
3042
3043         Don't instantiate ChildNodeLists just to get a child count.
3044         <http://webkit.org/b/116776>
3045
3046         Reviewed by Ryosuke Niwa.
3047
3048         Use ContainerNode::childNodeCount() instead of Node::childNodes()->length().
3049
3050         * editing/ApplyStyleCommand.cpp:
3051         (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical):
3052
3053 2013-05-25  Andreas Kling  <akling@apple.com>
3054
3055         PluginDocument::pluginNode() should be pluginElement() instead.
3056         <http://webkit.org/b/116774>
3057
3058         Reviewed by Anders Carlsson.
3059
3060         Make PluginDocument hand out a HTMLPlugInElement* instead of a Node*.
3061
3062         * dom/Document.cpp:
3063         (WebCore::eventTargetNodeForDocument):
3064         * html/PluginDocument.h:
3065         * html/PluginDocument.cpp:
3066         (WebCore::PluginDocumentParser::createDocumentStructure):
3067         (WebCore::PluginDocument::pluginWidget):
3068         (WebCore::PluginDocument::setPluginElement):
3069         (WebCore::PluginDocument::detach):
3070
3071 2013-05-25  Andreas Kling  <akling@apple.com>
3072
3073         Remove Document::getFocusableNodes().
3074         <http://webkit.org/b/116773>
3075
3076         Reviewed by Joseph Pecoraro.
3077
3078         This was added in r42191 and there are no remaining clients of the API.
3079
3080         * dom/Document.cpp:
3081         * dom/Document.h:
3082         * WebCore.exp.in:
3083
3084 2013-05-25  Andreas Kling  <akling@apple.com>
3085
3086         Move Node::focusDelegate() to Element.
3087         <http://webkit.org/b/116768>
3088
3089         Reviewed by Anders Carlsson.
3090
3091         Only Element can be a focus delegate (it's currently only ever HTMLInputElement actually)
3092         so move Node::focusDelegate() to Element. Sprinkled isElementNode() checks as needed.
3093
3094         * dom/Node.cpp:
3095         * dom/Node.h:
3096         * dom/Element.h:
3097         * dom/Element.cpp:
3098         * html/shadow/SliderThumbElement.cpp:
3099         (WebCore::SliderThumbElement::focusDelegate):
3100         * html/shadow/SliderThumbElement.h:
3101         * rendering/RenderTheme.cpp:
3102         (WebCore::RenderTheme::isFocused):
3103         * rendering/RenderThemeMac.mm:
3104         (WebCore::RenderThemeMac::paintSliderThumb):
3105
3106 2013-05-25  Alberto Garcia  <agarcia@igalia.com>
3107
3108         Path: clean up addPathForRoundedRect()
3109         https://bugs.webkit.org/show_bug.cgi?id=116765
3110
3111         Reviewed by Andreas Kling.
3112
3113         Reorganize code that is a bit redundant.
3114
3115         No new tests, no behavior change.
3116
3117         * platform/graphics/Path.cpp:
3118         (WebCore::Path::addPathForRoundedRect):
3119
3120 2013-05-25  Simon Fraser  <simon.fraser@apple.com>
3121
3122         Unprefix Page Visibility API
3123         https://bugs.webkit.org/show_bug.cgi?id=102340
3124
3125         Reviewed by Tim Horton.
3126         
3127         Remove prefixes from the document properties, and the visibilitychanged event.
3128         
3129         Rename the "preview" state to "unloaded". The "unloaded" state is never
3130         reached yet (see https://bugs.webkit.org/show_bug.cgi?id=116769).
3131         
3132         Add some comments to places where we should update the visibility state
3133         when going in and out of the page cache, but cannot safely do so yet.
3134
3135         Tested by existing Page Visibility tests.
3136
3137         * dom/Document.cpp:
3138         (WebCore::Document::pageVisibilityState):
3139         (WebCore::Document::visibilityState):
3140         (WebCore::Document::hidden):
3141         (WebCore::Document::dispatchVisibilityStateChangeEvent):
3142         * dom/Document.h:
3143         * dom/Document.idl:
3144         * dom/EventNames.h:
3145         * history/CachedFrame.cpp:
3146         (WebCore::CachedFrameBase::restore):
3147         * loader/FrameLoader.cpp:
3148         (WebCore::FrameLoader::stopLoading):
3149         * page/Page.cpp:
3150         (WebCore::Page::setVisibilityState):
3151         * page/PageVisibilityState.cpp:
3152         (WebCore::pageVisibilityStateString):
3153         * page/PageVisibilityState.h:
3154
3155 2013-05-25  Andreas Kling  <akling@apple.com>
3156
3157         Move Node::isMouseFocusable() to Element.
3158         <http://webkit.org/b/116762>
3159
3160         Reviewed by Anders Carlsson.
3161
3162         Node::isMouseFocusable() would just return isFocusable(), which is never true for a non-Element
3163         since Node::supportsFocus() always returns false. So move it to Element!
3164
3165         * dom/Node.h:
3166         * dom/Node.cpp:
3167         * dom/Element.h:
3168         * dom/Element.cpp:
3169         (WebCore::Element::isMouseFocusable):
3170
3171             Moved here from Node.
3172
3173         * editing/FrameSelection.cpp:
3174         (WebCore::FrameSelection::setFocusedNodeIfNeeded):
3175         * page/EventHandler.cpp:
3176         (WebCore::EventHandler::dispatchMouseEvent):
3177
3178             Walk up the parent chain with parentOrShadowHostElement() instead of parentOrShadowHostNode().
3179             Removed a misleading no-op hunk about mouse-focusable ShadowRoots, since ShadowRoots are not
3180             Elements and thus cannot be mouse-focusable.
3181
3182         * page/TouchAdjustment.cpp:
3183         (WebCore::TouchAdjustment::nodeRespondsToTapGesture):
3184
3185             Check that the Node is an Element before asking if it's mouse-focusable.
3186
3187         * html/HTMLAnchorElement.h:
3188         * html/HTMLAreaElement.h:
3189         * html/HTMLFormControlElement.h:
3190         * html/HTMLInputElement.h:
3191         * html/HTMLMediaElement.h:
3192         * html/HTMLSelectElement.h:
3193         * html/HTMLTextAreaElement.h:
3194         * html/shadow/ClearButtonElement.h:
3195         * html/shadow/TextControlInnerElements.h:
3196         * svg/SVGAElement.h:
3197         * svg/SVGStyledElement.h:
3198
3199             Sprinkle OVERRIDE.
3200
3201 2013-05-25  Andreas Kling  <akling@apple.com>
3202
3203         Move Node::isKeyboardFocusable() to Element.
3204         <http://webkit.org/b/116761>
3205
3206         Reviewed by Antti Koivisto.
3207
3208         Only Elements can be keyboard-focusable. Move the base isKeyboardFocusable() implementation to Element
3209         and sprinkle OVERRIDE on subclass overrides.
3210         FocusController gets some temporary type checks that will go away as that code moves to dealing in
3211         Elements instead of Node.
3212
3213         * dom/Node.h:
3214         * dom/Node.cpp:
3215         * dom/Element.h:
3216         * dom/Element.cpp:
3217         (WebCore::Element::isKeyboardFocusable):
3218
3219             Move isKeyboardFocusable() from Node to Element.
3220
3221         * page/FocusController.cpp:
3222         (WebCore::isNonFocusableShadowHost):
3223         (WebCore::isFocusableShadowHost):
3224         (WebCore::shouldVisit):
3225         (WebCore::FocusController::advanceFocusInDocumentOrder):
3226
3227             Check that the inspected Node is an Element before querying isKeyboardFocusable().
3228
3229         * html/HTMLAnchorElement.h:
3230         * html/HTMLAreaElement.h:
3231         * html/HTMLFormControlElement.h:
3232         * html/HTMLFrameOwnerElement.h:
3233         * html/HTMLInputElement.h:
3234         * html/HTMLPlugInElement.h:
3235         * html/HTMLSelectElement.h:
3236         * html/HTMLTextAreaElement.h:
3237         * svg/SVGAElement.h:
3238         * svg/SVGStyledElement.h:
3239
3240             Sprinkle OVERRIDE.
3241
3242 2013-05-25  Andreas Kling  <akling@apple.com>
3243
3244         Begin moving "focus" state logic from Node to Element.
3245         <http://webkit.org/b/116760>
3246
3247         Reviewed by Antti Koivisto.
3248
3249         Only Elements can be focused, so merge the "focus" state logic from Node and ContainerNode
3250         and move it into Element. There's a lot more iceberg under this tip, but we'll be starting
3251         with setFocus(bool) and focused().
3252
3253         * dom/Node.h:
3254         * dom/ContainerNode.cpp:
3255         * dom/ContainerNode.h:
3256         * dom/Element.cpp:
3257         (WebCore::Element::isUserActionElementFocused):
3258         (WebCore::Element::setFocus):
3259         * dom/Element.h:
3260         (WebCore::Element::focused):
3261         * dom/Node.cpp:
3262
3263             Move focused() and setFocus(bool) from Node/ContainerNode to Element.
3264
3265         * dom/Document.cpp:
3266         (WebCore::Document::setFocusedNode):
3267         * page/EventHandler.cpp:
3268         (WebCore::EventHandler::dispatchMouseEvent):
3269
3270             Check if the inspected Node is an Element before asking if it's focused.
3271
3272 2013-05-25  Noam Rosenthal  <noam.rosenthal@nokia.com>
3273
3274         Direct pattern compositing breaks when no-repeat is set on a large layer
3275         https://bugs.webkit.org/show_bug.cgi?id=116140
3276
3277         Reviewed by Antti Koivisto.
3278
3279         In some cases the directly composited background color logic overrides the layer's
3280         contentsRect, which results in wrong rendering of tiled images.
3281         This patch makes sure that the background image is applied after the solid color,
3282         which ensures the correct contentsRect.
3283
3284         Test: compositing/patterns/direct-pattern-compositing-contain-no-repeat.html
3285
3286         * rendering/RenderLayerBacking.cpp:
3287         (WebCore::RenderLayerBacking::updateDirectlyCompositedContents):
3288
3289 2013-05-24  Andreas Kling  <akling@apple.com>
3290
3291         Move "hover" state logic from Node to Element.
3292         <http://webkit.org/b/116757>
3293
3294         Reviewed by Antti Koivisto.
3295
3296         Resolve a 7 year old FIXME by merging the "hover" state logic from Node and ContainerNode
3297         and moving it all to Element instead.
3298
3299         * dom/Node.cpp:
3300         (WebCore::Node::detach):
3301         * dom/Element.cpp:
3302         (WebCore::Element::detach):
3303
3304             Move Document::hoveredNodeDetached() call from Node::detach() to Element::detach().
3305
3306         (WebCore::Element::isUserActionElementHovered):
3307         (WebCore::Element::setHovered):
3308         * dom/Element.h:
3309         (WebCore::Element::hovered):
3310
3311             Moved here from Node/ContainerNode.
3312
3313         * dom/UserActionElementSet.h:
3314         (WebCore::UserActionElementSet::setHovered):
3315         (WebCore::UserActionElementSet::setFlags):
3316
3317             Make setHovered() take an Element* instead of a Node*. I'd like to do this will all
3318             of these methods eventually, so added a setFlags() helper with the tighter type.
3319
3320         * html/HTMLLabelElement.h:
3321         * html/shadow/SpinButtonElement.h:
3322
3323             Sprinkle OVERRIDE on setHovered() overrides.
3324
3325         * dom/Document.cpp:
3326         (WebCore::Document::updateHoverActiveState):
3327         * accessibility/AccessibilityNodeObject.cpp:
3328         (WebCore::AccessibilityNodeObject::isHovered):
3329         * rendering/RenderTheme.cpp:
3330         (WebCore::RenderTheme::isHovered):
3331
3332             Check if the inspected Node is an element before asking if it's hovered.
3333
3334 2013-05-25  Andreas Kling  <akling@apple.com>
3335
3336         Document::formController() should return a reference.
3337         <http://webkit.org/b/116758>
3338
3339         Reviewed by Antti Koivisto.
3340
3341         The formController() is created on demand, so return a reference instead.
3342
3343         * dom/Document.h:
3344         * dom/Document.cpp:
3345         (WebCore::Document::formController):
3346         (WebCore::Document::setStateForNewFormElements):
3347         * html/HTMLFormControlElementWithState.cpp:
3348         (WebCore::HTMLFormControlElementWithState::HTMLFormControlElementWithState):
3349         (WebCore::HTMLFormControlElementWithState::~HTMLFormControlElementWithState):
3350         (WebCore::HTMLFormControlElementWithState::didMoveToNewDocument):
3351         (WebCore::HTMLFormControlElementWithState::finishParsingChildren):
3352         * html/HTMLFormElement.cpp:
3353         (WebCore::HTMLFormElement::~HTMLFormElement):
3354         (WebCore::HTMLFormElement::finishParsingChildren):
3355         * html/HTMLInputElement.cpp:
3356         (WebCore::HTMLInputElement::~HTMLInputElement):
3357         (WebCore::HTMLInputElement::didMoveToNewDocument):
3358         (WebCore::HTMLInputElement::checkedRadioButtons):
3359
3360 2013-05-25  Sergio Villar Senin  <svillar@igalia.com>
3361
3362         Reducing CSS code duplication in declaration list error recovery
3363         https://bugs.webkit.org/show_bug.cgi?id=115157
3364
3365         Reviewed by Andreas Kling.
3366
3367         From Blink r148974 by <serya@chromium.org>
3368
3369         Refactor "invalid_block_list error | /* empty */" in a new
3370         decl_list_recovery rule that allows to remove 4 redundant rules.
3371
3372         No new test required as we're just refactoring code, no new behaviour.
3373
3374         * css/CSSGrammar.y.in:
3375
3376 2013-05-24  Ryosuke Niwa  <rniwa@webkit.org>
3377
3378         Build fix after r150664.
3379
3380         * bindings/scripts/test/JS/JSTestObj.cpp:
3381         (WebCore):
3382
3383 2013-05-24  Sergio Villar Senin  <svillar@igalia.com>
3384
3385         Fixing invalid block recovery in some declaration list.
3386         https://bugs.webkit.org/show_bug.cgi?id=115159
3387
3388         Reviewed by Darin Adler.
3389
3390         From Blink r148889 by <serya@chromium.org>
3391
3392         Improves the detection of some invalid block declarations inside a
3393         declaration list. This allows the parser not to completely discard
3394         a whole declaration list that contains an invalid block. In
3395         particular grammar failed in tests 8, 12, 13, 15, 16 and 17 in the
3396         new test added by this change.
3397
3398         Test: fast/css/parsing-invalid-block-recovery.html
3399
3400         * css/CSSGrammar.y.in:
3401
3402
3403 2013-05-24  Beth Dakin  <bdakin@apple.com>
3404
3405         DidFirstFlushForHeaderLayer can be called too soon on pages that redirect
3406         https://bugs.webkit.org/show_bug.cgi?id=116749
3407         -and corresponding-
3408         <rdar://problem/13886753>
3409
3410         Reviewed by Simon Fraser.
3411
3412         Only start m_paintRelatedMilestonesTimer if we have actually painted.
3413         * rendering/RenderLayerCompositor.cpp:
3414         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
3415
3416 2013-05-24  Anders Carlsson  <andersca@apple.com>
3417
3418         Fix Windows build.
3419
3420         * WebCore.vcproj/WebCore.vcproj:
3421         * WebCore.vcxproj/WebCore.vcxproj:
3422         * WebCore.vcxproj/WebCore.vcxproj.filters:
3423
3424 2013-05-24  Tim Horton  <timothy_horton@apple.com>
3425
3426         Animated GIFs don't repaint after TiledCoreAnimationDrawingArea un-suspends painting
3427         https://bugs.webkit.org/show_bug.cgi?id=116744
3428         <rdar://problem/13973514>
3429
3430         Reviewed by Simon Fraser.
3431
3432         * WebCore.exp.in: Export FrameView::resumeAnimatingImages.
3433         * page/FrameView.cpp:
3434         (WebCore::FrameView::setIsInWindow):
3435         (WebCore::FrameView::resumeAnimatingImages):
3436         Factor the code to restart animated images out of frameView::setIsInWindow.
3437
3438         * page/FrameView.h:
3439         (FrameView):
3440
3441 2013-05-24  Anders Carlsson  <andersca@apple.com>
3442
3443         Move history property list writer to WebKit
3444         https://bugs.webkit.org/show_bug.cgi?id=116746
3445
3446         Reviewed by Tim Horton.
3447
3448         Remove files from the Xcode project and remove symbols that now live in WebKit.
3449
3450         * WebCore.exp.in:
3451         * WebCore.xcodeproj/project.pbxproj:
3452
3453 2013-05-24  Christophe Dumez  <ch.dumez@sisa.samsung.com>
3454
3455         Global constructors exposed in worker environment have wrong attributes
3456         https://bugs.webkit.org/show_bug.cgi?id=116708
3457
3458         Reviewed by Geoffrey Garen.
3459
3460         Fix JSC bindings generator so that Global constructors exposed in worker environment
3461         have the following attributes:
3462         { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }
3463
3464         This is now consistent with global constructors on DOMWindow and with the Web IDL
3465         specification:
3466         http://dev.w3.org/2006/webapi/WebIDL/#es-interfaces
3467
3468         Test: fast/js/global-constructors-attributes-worker.html
3469
3470         * bindings/scripts/CodeGeneratorJS.pm:
3471         (GenerateAttributesHashTable):
3472
3473 2013-05-24  Christophe Dumez  <ch.dumez@sisa.samsung.com>
3474
3475         Remove custom code for webkitAudioContext global constructor getter
3476         https://bugs.webkit.org/show_bug.cgi?id=116530
3477
3478         Reviewed by Geoffrey Garen.
3479
3480         Get rid of custom code for webkitAudioContext global constructor getter. The
3481         global DOMWindow attribute is now automatically generated by leveraging support
3482         for [EnabledAtRuntime] extended attribute and the existing methods in
3483         RuntimeEnabledFeatures class.
3484
3485         No new tests, no behavior change.
3486
3487         * GNUmakefile.list.am: Remove JSDOMWindowWebAudioCustom.*.
3488         * Modules/webaudio/AudioContext.idl:
3489         Remove [NoInterfaceObject] extended attribute so that the global constructor is
3490         automatically generated instead of automatically added. Add [EnabledAtRuntime]
3491         extended attribute since this global constructor can be disabled at runtime and
3492         so that we can getter rid of the [CustomGetter] for the corresponding global
3493         constructor. Use [InterfaceName] extended attribute so that the interface name
3494         matches the global constructor on DOMWindow (webkitAudioContext).
3495
3496         * Target.pri: Remove JSDOMWindowWebAudioCustom.*.
3497         * UseJSC.cmake: Remove JSDOMWindowWebAudioCustom.*.
3498         * WebCore.exp.in: Export additional symbol.
3499         * WebCore.order: Export additional symbol.
3500         * WebCore.vcproj/WebCore.vcproj: Remove JSDOMWindowWebAudioCustom.*.
3501         * WebCore.vcxproj/WebCore.vcxproj: Remove JSDOMWindowWebAudioCustom.*.
3502         * WebCore.vcxproj/WebCore.vcxproj.filters: Remove JSDOMWindowWebAudioCustom.*.
3503         * WebCore.xcodeproj/project.pbxproj: Remove JSDOMWindowWebAudioCustom.*.
3504         * bindings/generic/RuntimeEnabledFeatures.h:
3505         (WebCore::RuntimeEnabledFeatures::setWebAudioEnabled):
3506         * bindings/js/JSBindingsAllInOne.cpp: Remove JSDOMWindowWebAudioCustom.*.
3507         * bindings/js/JSDOMWindowWebAudioCustom.cpp: Removed. We no longer need any custom code for
3508         the WebAudio global constructor getter because we use [EnabledAtRuntime] support in the
3509         bindings generator now.
3510         * page/DOMWindow.idl: Remove global constructor for AudioContext as it is now automatically
3511         generated.
3512         * page/Settings.in: Remove webAudioEnabled setting as we use the existing setting
3513         in RuntimeEnabledFeatures now.
3514
3515 2013-05-24  Seokju Kwon  <seokju.kwon@gmail.com>
3516
3517         [AC] Needs to be guarded by USE(ACCELERATED_COMPOSITING)
3518         https://bugs.webkit.org/show_bug.cgi?id=116712
3519
3520         Reviewed by Andreas Kling.
3521
3522         renderView is used when ACCELERATED_COMPOSITING is enabled.
3523         So, this patch allows it to be guarded by USE(ACCELERATED_COMPOSITING).
3524
3525         No new tests, no behavior change.
3526
3527         * page/FrameView.cpp:
3528         (WebCore::FrameView::setFrameRect):
3529
3530 2013-05-24  Thomas Deniau  <deniau@apple.com>
3531
3532         Add more lines to the context during Dictionary lookups
3533         https://bugs.webkit.org/show_bug.cgi?id=115256
3534
3535         Reviewed by Ryosuke Niwa.
3536
3537         No new tests - no new functionality.
3538
3539         * WebCore.exp.in: Export a few methods in VisibleUnits needed to be able
3540         to call previousLinePosition(), nextLinePosition(), startOfLine() and
3541         endOfLine() in WebPageMac.mm when determining the context while looking
3542         up a dictionary definition. These symbols used to be exported for iOS
3543         only, export them on the desktop too.
3544
3545 2013-05-24  Anders Carlsson  <andersca@apple.com>
3546
3547         Remove PagePopup code
3548         https://bugs.webkit.org/show_bug.cgi?id=116732
3549
3550         Reviewed by Andreas Kling.
3551
3552         Remove all page popup code.
3553
3554         * GNUmakefile.list.am:
3555         * WebCore.xcodeproj/project.pbxproj:
3556         * dom/ContextFeatures.cpp:
3557         * dom/ContextFeatures.h:
3558         * loader/EmptyClients.h:
3559         * page/ChromeClient.h:
3560         * page/DOMWindowPagePopup.cpp: Removed.
3561         * page/DOMWindowPagePopup.h: Removed.
3562         * page/DOMWindowPagePopup.idl: Removed.
3563         * page/PagePopup.h: Removed.
3564         * page/PagePopupClient.cpp: Removed.
3565         * page/PagePopupClient.h: Removed.
3566         * page/PagePopupController.cpp: Removed.
3567         * page/PagePopupController.h: Removed.
3568         * page/PagePopupController.idl: Removed.
3569         * page/PagePopupDriver.h: Removed.
3570         * testing/Internals.cpp:
3571         (WebCore::Internals::resetToConsistentState):
3572         (WebCore):
3573         * testing/Internals.h:
3574         (WebCore):
3575         (Internals):
3576         * testing/Internals.idl:
3577         * testing/MockPagePopupDriver.cpp: Removed.
3578         * testing/MockPagePopupDriver.h: Removed.
3579
3580 2013-05-24  Jer Noble  <jer.noble@apple.com>
3581
3582         Mac: Set the default audio buffer size to a large value for <video> elements.
3583         https://bugs.webkit.org/show_bug.cgi?id=116342
3584
3585         Reviewed by Eric Carlson.
3586         Roll-in rubber stamped by Eric Carlson.
3587
3588         To enable power savings by waking up the audio hardware less often, set the
3589         requested buffer frame size to a large value, such as 4096. Since this results
3590         in approximately 100ms worth of buffer, set the buffer size to a much lower
3591         value when playing WebAudio, which is much more sensitive to latency than video
3592         or audio elements.
3593
3594         Introduce a new class, AudioSessionManager, as well as a helper class,
3595         AudioSessionManagerToken. Audio elements, video elements, and WebAudio destination
3596         nodes will create and retain a token, and release the token in their destructor.
3597         This allows the AudioSessionManager to track how many of what type of audio-
3598         generating objects are in existence.
3599
3600         This requires implementing AudioSession for Mac platforms. Move the implementation
3601         for retrieving the hardware sample rate and setting the buffer duration into
3602         AudioSessionMac from AudioDestinationMac, to be shared with AudioSessionManagerMac.
3603
3604         Change the AudioSession method preferredBufferLength() into preferredBufferSize(),
3605         as the callers really want to specify a buffer size, not a buffer duration. On iOS,
3606         where the available API requires a duration, perform the conversion from duration to
3607         size on behalf of the caller.
3608
3609         However, since the original version of this patch caused media test
3610         failures on the Mac ML and Lion bots, only enable the buffer size
3611         change for OS X > ML.
3612
3613         * html/HTMLMediaElement.h:  Add a AudioSessionManagerToken member.
3614         * html/HTMLMediaElement.cpp:
3615         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize the token.
3616         * platform/audio/AudioSession.cpp:
3617         (WebCore::AudioSession::preferredBufferSize): Renamed from preferredBufferLength.
3618         (WebCore::AudioSession::setPreferredBufferSize): Renamed from setPreferredBufferLength.
3619         * platform/audio/AudioSession.h:
3620         * platform/audio/AudioSessionManager.cpp:
3621         (AudioSessionManagerToken::create): Simple factory method.
3622         (AudioSessionManagerToken::AudioSessionManagerToken): Call AudioSessionManager::incrementCount().
3623         (AudioSessionManagerToken::~AudioSessionManagerToken): Call AudioSessionManager::decrementCount().
3624         (AudioSessionManager::sharedManager): Simple singleton method.
3625         (AudioSessionManager::AudioSessionManager): Simple constructor.
3626         (AudioSessionManager::has): Return whether the type is present.
3627         (AudioSessionManager::incrementCount): Increment, then call updateSessionState()
3628         (AudioSessionManager::decrementCount): Decrement, then call updateSessionState()
3629         (AudioSessionManager::updateSessionState): Stub, does nothing.
3630         * platform/audio/AudioSessionManager.h:
3631         * platform/audio/ios/AudioDestinationIOS.cpp:
3632         (WebCore::AudioDestinationIOS::configure): Call setPreferredBufferSize() instead of setPreferredBufferLength()
3633         * platform/audio/ios/AudioSessionIOS.mm:
3634         (WebCore::AudioSession::preferredBufferSize): Renamed from preferredBufferLength.
3635         (WebCore::AudioSession::setPreferredBufferSize): Renamed from setPreferredBufferLength
3636         * platform/audio/mac/AudioDestinationMac.cpp:
3637         (WebCore::AudioDestination::hardwareSampleRate): Call AudioSession::sampleRate().
3638         (WebCore::AudioDestinationMac::AudioDestinationMac): Create the AudioSessionManagerToken.
3639         (WebCore::AudioDestinationMac::configure): Do not set the buffer size (this is done in AudioSessionManagerMac).
3640         * platform/audio/mac/AudioDestinationMac.h:
3641         * platform/audio/mac/AudioSessionMac.cpp: Added.
3642         (WebCore::defaultDevice): Added, returns the default audio device.
3643         (WebCore::AudioSession::AudioSession): Simple constructor.
3644         (WebCore::AudioSession::~AudioSession): Simple destructor.
3645         (WebCore::AudioSession::category): Stub, unimplemented.
3646         (WebCore::AudioSession::setCategory): Ditto.
3647         (WebCore::AudioSession::categoryOverride): Ditto.
3648         (WebCore::AudioSession::setCategoryOverride): Ditto.
3649         (WebCore::AudioSession::numberOfOutputChannels): Ditto.
3650         (WebCore::AudioSession::setActive): Ditto.
3651         (WebCore::AudioSession::sampleRate): Use the HAL to return the default audio device sample rate.
3652         (WebCore::AudioSession::preferredBufferSize): Return the current HAL setting.
3653         (WebCore::AudioSession::setPreferredBufferSize): Set the buffer size.
3654         * platform/audio/mac/AudioSessionManagerMac.cpp:
3655         (AudioSessionManager::updateSessionState): Set the buffer size depending on what audio outputs are present.
3656         * WebCore.xcodeproj/project.pbxproj: Add the new files to the project.
3657
3658 2013-05-24  Alberto Garcia  <agarcia@igalia.com>
3659
3660         Path: upstream the missing bits from the BlackBerry port
3661         https://bugs.webkit.org/show_bug.cgi?id=116658
3662
3663         Reviewed by Xan Lopez.
3664
3665         PathBlackBerry was upstreamed a while ago (r144612) but a few bits
3666         were missing from the cross-platform code.
3667
3668         * platform/graphics/Path.cpp:
3669         (WebCore::Path::addPathForRoundedRect):
3670         * platform/graphics/Path.h:
3671         (Graphics):
3672         (Path):
3673
3674 2013-05-24  Noam Rosenthal  <noam@webkit.org>
3675
3676         WebProcess is crashing on http://achicu.github.io/css-presentation when direct pattern compositing is enabled
3677         https://bugs.webkit.org/show_bug.cgi?id=115135
3678
3679         Reviewed by Antti Koivisto.
3680
3681         Issue is invoked when there is a visibility:hidden layer with a non-compositable
3682         background image (e.g. a radial gradient).
3683         The layer is treated as a no-contents layer because of its visibility, however
3684         updateDirectlyCompositedBackgroundImage() later mistakenly treats it as a layer
3685         with direct background-image compositing.
3686
3687         Fixed by returning early from updating directly composited contents for layers
3688         with hidden contents.
3689
3690         Test: compositing/patterns/direct-pattern-compositing-hidden-radial-gradient.html
3691
3692         * rendering/RenderLayerBacking.cpp:
3693         (WebCore::RenderLayerBacking::updateDirectlyCompositedContents):
3694         (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage):
3695         (WebCore::RenderLayerBacking::paintsChildren):
3696         (WebCore::RenderLayerBacking::isDirectlyCompositedImage):
3697
3698 2013-05-24  Robert Hogan  <robert@webkit.org>
3699
3700         Refactor shouldAddBorderPaddingMargin()
3701         https://bugs.webkit.org/show_bug.cgi?id=98803
3702
3703         Reviewed by Ryosuke Niwa.
3704
3705         Make this helper function less clever-stupid in its misguided sacrifice of intelligibility
3706         for the sake of concision.
3707
3708         No new tests, refactoring.
3709
3710         * rendering/RenderBlockLineLayout.cpp:
3711         (WebCore::shouldAddBorderPaddingMargin):
3712         (WebCore::inlineLogicalWidth):
3713
3714 2013-05-24  Xiaobo Wang  <xiaobwang@blackberry.com>
3715
3716         [BlackBerry] DRT - crashed on GraphicsContext3D::makeContextCurrent
3717         https://bugs.webkit.org/show_bug.cgi?id=116654
3718
3719         Reviewed by Carlos Garcia Campos.
3720
3721         PR 331552.
3722         Internally reviewed and amended by Arvid Nilsson.
3723
3724         No new tests, this patch is to fix DRT crashes in fast/canvas/webgl.
3725         The instance of GraphicsContext3D has already been destroyed but
3726         WebGLLayerWebKitThread is not aware of that. This is because compositor
3727         layer of the WebGL graphics context was referenced outside the context.
3728         So when destructing GraphicsContext3D the compositing layer was not
3729         destructed.
3730         Fix by setting m_webGLContext to 0 when destructing GrapthicsContext3D
3731         after releasing the compositor layer, so that it won't be de-referenced
3732         again later.
3733
3734         * platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp:
3735         (WebCore::GraphicsContext3D::~GraphicsContext3D):
3736         * platform/graphics/blackberry/WebGLLayerWebKitThread.cpp:
3737         (WebCore::WebGLLayerWebKitThread::~WebGLLayerWebKitThread):
3738         (WebCore::WebGLLayerWebKitThread::webGLContextDestroyed):
3739         (WebCore):
3740         * platform/graphics/blackberry/WebGLLayerWebKitThread.h:
3741         (WebGLLayerWebKitThread):
3742
3743 2013-05-24  Andreas Kling  <akling@apple.com>
3744
3745         Typing in Safari's unified field causes unnecessary web content repaints.
3746         <http://webkit.org/b/116703>
3747
3748         Reviewed by Andy Estes.
3749
3750         Break out an alternate version of Page::markAllMatchesForText() that only counts the number of times
3751         a string occurs in the page, but doesn't try to mark the occurrences.
3752         This allows Safari to count matches for the 'Find "foo" on This Page' functionality in the unified
3753         location bar without causing tile repaints.
3754
3755         * WebCore.exp.in:
3756         * page/Page.h:
3757         * page/Page.cpp:
3758         (WebCore::Page::findMatchesForText):
3759         (WebCore::Page::markAllMatchesForText):
3760         (WebCore::Page::countFindMatches):
3761
3762             Renamed markAllMatchesForText() to findMatchesForText() and gave it a boolean parameter to control whether
3763             matches should be marked or not. countFindMatches() is the new helper that doesn't mark.
3764
3765 2013-05-23  Beth Dakin  <bdakin@apple.com>
3766
3767         https://bugs.webkit.org/show_bug.cgi?id=116702
3768         REGRESSION (r150399): Scrollbar missing for all overflow scroll
3769         -and corresponding-
3770         <rdar://problem/13963712>
3771
3772         Reviewed by Simon Fraser.
3773
3774         This was a silly copy-paste error.
3775         * rendering/RenderLayer.cpp:
3776         (WebCore::RenderLayer::scrollbarAnimationsAreSuppressed):
3777
3778 2013-05-23  peavo@outlook.com  <peavo@outlook.com>
3779
3780         [WinCairo] Build fails to link.
3781         https://bugs.webkit.org/show_bug.cgi?id=116671
3782
3783         Reviewed by Brent Fulgham.
3784
3785         * page/FrameView.h: Added guard for ACCELERATED_COMPOSITING.
3786
3787 2013-05-23  Roger Fong  <roger_fong@apple.com>
3788
3789         Unreviewed. Modify WebCore for AppleWin 2010 production build.
3790
3791         * WebCore.vcxproj/WebCoreGenerated.make:
3792         (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
3793         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
3794
3795 2013-05-23  Yongjun Zhang  <yongjun_zhang@apple.com>
3796
3797         We need to clear main resource when detaching DocumentLoader from the frame.
3798         https://bugs.webkit.org/show_bug.cgi?id=116680
3799
3800         Normally, when we detach the documentLoader in DocumentLoader::detachFromFrame, main resource is also cleared
3801         in stopLoading().  There is possibility that main resource not being cleared, and this could cause crash later
3802         since docLoader could still receive resource callbacks.  To avoid that, we can remove docLoader from main resource's
3803         client set in detachFromFrame.
3804
3805         Reviewed by Brady Eidson.
3806
3807         No new tests, this doesn't happen on OS X.
3808
3809         * loader/DocumentLoader.cpp:
3810         (WebCore::DocumentLoader::detachFromFrame):
3811         (WebCore::DocumentLoader::clearMainResource):
3812         * loader/cache/CachedResource.h: make hasClient accessible publicly.
3813         (WebCore::CachedResource::hasClient):
3814         (CachedResource):
3815
3816 2013-05-23  Mihai Maerean  <mmaerean@adobe.com>
3817
3818         assertion failed: !node || node->isElementNode() in WebCore::RenderBlock::clone
3819         https://bugs.webkit.org/show_bug.cgi?id=116614
3820
3821         Reviewed by David Hyatt.
3822
3823         Add a test for flow threads so they don't end up being cloned in region based multi columns with columns:1 where
3824         the only child has column-span:all.
3825
3826         Test: fast/multicol/newmulticol/direct-child-column-span-all.html
3827
3828         * rendering/RenderBlock.cpp:
3829         (WebCore::RenderBlock::addChildIgnoringAnonymousColumnBlocks):
3830
3831 2013-05-23  Anders Carlsson  <andersca@apple.com>
3832
3833         Crash in convertMainResourceLoadToDownload when downloading file by option-return
3834         https://bugs.webkit.org/show_bug.cgi?id=116451
3835
3836         Reviewed by Andreas Kling.
3837
3838         Handle MainResourceLoader being null here which will happen when loading a cached main resource.
3839
3840         * loader/DocumentLoader.cpp:
3841         (WebCore::DocumentLoader::continueAfterContentPolicy):
3842
3843 2013-05-23  Benjamin Poulain  <bpoulain@apple.com>
3844
3845         KURL::createCFURL() should return a RetainPtr<CFURLRef>
3846         https://bugs.webkit.org/show_bug.cgi?id=116644
3847
3848         Reviewed by Andreas Kling.
3849
3850         For consistency with the other createCFType() APIs in WebKit, KURL should
3851         return a RetainPtr<> instead of raw +1 CFURLRef.
3852
3853         No leak were discovered while making this change.
3854
3855         * platform/KURL.h:
3856         * platform/cf/KURLCFNet.cpp:
3857         (WebCore):
3858         (WebCore::createCFURLFromBuffer):
3859         (WebCore::KURL::createCFURL):
3860         (WebCore::KURL::fileSystemPath):
3861         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
3862         (WebCore::AVFWrapper::createAssetForURL):
3863         * platform/graphics/cg/GraphicsContextCG.cpp:
3864         (WebCore::GraphicsContext::setURLForRect):
3865         * platform/mac/KURLMac.mm:
3866         (WebCore):
3867         (WebCore::KURL::operator NSURL *):
3868         (WebCore::KURL::createCFURL):
3869         * platform/network/cf/CookieJarCFNet.cpp:
3870         (WebCore::setCookiesFromDOM):
3871         (WebCore::cookiesForDOM):
3872         (WebCore::cookieRequestHeaderFieldValue):
3873         (WebCore::getRawCookies):
3874         (WebCore::deleteCookie):
3875         * platform/network/cf/DNSCFNet.cpp:
3876         (WebCore::DNSResolveQueue::platformProxyIsEnabledInSystemPreferences):
3877         * platform/network/cf/ProxyServerCFNet.cpp:
3878         (WebCore::addProxyServersForURL):
3879         * platform/network/cf/ResourceRequestCFNet.cpp:
3880         (WebCore::ResourceRequest::doUpdatePlatformRequest):
3881         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
3882         * platform/network/cf/ResourceResponseCFNet.cpp:
3883         (WebCore::ResourceResponse::cfURLResponse):
3884         * platform/network/cf/SocketStreamHandleCFNet.cpp:
3885         (WebCore::SocketStreamHandle::SocketStreamHandle):
3886
3887 2013-05-18  Robert Hogan  <robert@webkit.org>
3888
3889         The ellipsis in a text overflow should not avoid floats
3890         https://bugs.webkit.org/show_bug.cgi?id=115746
3891
3892         Reviewed by David Hyatt.
3893
3894         When placing an ellipsis for text overflow we shouldn't avoid any floats on the line.
3895         That is to say, if there is a float in the box we overflow we should let our no-wrap text,
3896         including the ellipsis, render inside the float just as we would if overflow was hidden but
3897         a text-overflow rendering had not been specified.
3898
3899         Test: fast/css/text-overflow-ellipsis-behind-floats.html
3900
3901         * rendering/RenderBlockLineLayout.cpp:
3902         (WebCore::RenderBlock::checkLinesForTextOverflow):
3903
3904 2013-05-23  Christophe Dumez  <ch.dumez@sisa.samsung.com>
3905
3906         Unreviewed, rolling out r150586.
3907         http://trac.webkit.org/changeset/150586
3908         https://bugs.webkit.org/show_bug.cgi?id=116660
3909
3910         Those constructors should be exposed on the WorkerContext, not
3911         the DOMWindow
3912
3913         * fileapi/FileReaderSync.idl:
3914         * workers/WorkerLocation.idl:
3915
3916 2013-05-23  Christophe Dumez  <ch.dumez@sisa.samsung.com>
3917
3918         Remove [NoInterfaceObject] from FileReaderSync and WorkerLocation
3919         https://bugs.webkit.org/show_bug.cgi?id=116660
3920
3921         Reviewed by Kentaro Hara.
3922
3923         Remove [NoInterfaceObject] from FileReaderSync and WorkerLocation to match their
3924         respective specifications:
3925         - http://dev.w3.org/2006/webapi/FileAPI/#FileReaderSync
3926         - http://dev.w3.org/html5/workers/#workerlocation
3927
3928         No new tests, covered by existing tests.
3929
3930         * fileapi/FileReaderSync.idl:
3931         * workers/WorkerLocation.idl:
3932
3933 2013-05-23  Christophe Dumez  <ch.dumez@sisa.samsung.com>
3934
3935         Remove special case for MessagePortArray from bindings generator
3936         https://bugs.webkit.org/show_bug.cgi?id=116653
3937
3938         Reviewed by Kentaro Hara.
3939
3940         Use MessagePort[] instead of MessagePortArray type in the IDL as MessagePortArray
3941         is not defined on IDL side. This allows us to remove the special case for
3942         MessagePortArray from the bindings generator.
3943
3944         No new tests, no behavior change.
3945
3946         * bindings/js/JSMessageEventCustom.cpp:
3947         (WebCore::JSMessageEvent::data):
3948         * bindings/scripts/CodeGeneratorJS.pm:
3949         (NativeToJSValue): Remove special case for MessagePortArray.
3950         * bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.cpp:
3951         * bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.h:
3952         (WebDOMTestSerializedScriptValueInterface):
3953         * bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp:
3954         (webkit_dom_test_serialized_script_value_interface_get_property):
3955         (webkit_dom_test_serialized_script_value_interface_class_init):
3956         * bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.h:
3957         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3958         (WebCore::jsTestSerializedScriptValueInterfacePorts):
3959         * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.h:
3960         * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.mm:
3961         * bindings/scripts/test/TestSerializedScriptValueInterface.idl: Replace MessagePortArray
3962         by MessagePort[].
3963         * dom/MessageEvent.h:
3964         (WebCore::MessageEvent::ports): The method should return a Vector, not a Vector*
3965         as the array on JavaScript side is not nullable.
3966         * dom/MessageEvent.idl: Replace MessagePortArray by MessagePort[].
3967
3968 2013-05-23  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
3969
3970         [EFL] Back, Forward and Stop should be hidden in context menu
3971         https://bugs.webkit.org/show_bug.cgi?id=116615
3972
3973         Reviewed by Christophe Dumez.
3974
3975         Context menu items: Back, Forward, Stop, Reload, should be shown only when
3976         they are able to perform action.
3977
3978         No new tests - no new functionality.
3979
3980         * page/ContextMenuController.cpp:
3981         (WebCore::ContextMenuController::populate):
3982
3983 2013-05-22  Dean Jackson  <dino@apple.com>
3984
3985         Rolling out r150555. It borked about 30 media tests.
3986
3987         * WebCore.xcodeproj/project.pbxproj:
3988         * html/HTMLMediaElement.cpp:
3989         (WebCore::HTMLMediaElement::HTMLMediaElement):
3990         * html/HTMLMediaElement.h:
3991         * platform/audio/AudioSession.cpp:
3992         (WebCore):
3993         (WebCore::AudioSession::AudioSession):
3994         (WebCore::AudioSession::preferredBufferDuration):
3995         (WebCore::AudioSession::setPreferredBufferDuration):
3996         * platform/audio/AudioSession.h:
3997         * platform/audio/AudioSessionListener.h:
3998         (AudioSessionListener):
3999         * platform/audio/AudioSessionManager.cpp: Removed.
4000         * platform/audio/AudioSessionManager.h: Removed.
4001         * platform/audio/ios/AudioDestinationIOS.cpp:
4002         (WebCore::AudioDestinationIOS::configure):
4003         * platform/audio/ios/AudioSessionIOS.mm:
4004         (WebCore::AudioSession::preferredBufferDuration):
4005         (WebCore::AudioSession::setPreferredBufferDuration):
4006         * platform/audio/mac/AudioDestinationMac.cpp:
4007         (WebCore::AudioDestination::hardwareSampleRate):
4008         (WebCore::AudioDestinationMac::AudioDestinationMac):
4009         (WebCore::AudioDestinationMac::configure):
4010         * platform/audio/mac/AudioDestinationMac.h:
4011         (AudioDestinationMac):
4012         * platform/audio/mac/AudioSessionMac.cpp: Removed.
4013         * platform/audio/mac/AudioSessionManagerMac.cpp: Removed.
4014
4015 2013-05-20  Jeffrey Pfau  <jpfau@apple.com>
4016
4017         Active DOM object resumption should match reason for suspending
4018         https://bugs.webkit.org/show_bug.cgi?id=116476
4019
4020         Add a reason to the arguments for resuming active DOM object and
4021         scheduled tasks and ensure that it matches the suspend reason before
4022         actually resuming the objects.
4023
4024         Reviewed by Joseph Pecoraro.
4025
4026         No new tests, no change in functionality.
4027
4028         * bindings/js/PageScriptDebugServer.cpp:
4029         (WebCore::PageScriptDebugServer::setJavaScriptPaused): Add matching resume reason
4030         * dom/Document.cpp:
4031         (WebCore::Document::resumeActiveDOMObjects): Check for matching resume reason
4032         (WebCore::Document::resumeScheduledTasks): Check for matching resume reason
4033         * dom/Document.h:
4034         (Document):
4035         * dom/ScriptExecutionContext.cpp:
4036         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): Check for matching resume reason
4037         * dom/ScriptExecutionContext.h:
4038         (ScriptExecutionContext):
4039         (WebCore::ScriptExecutionContext::reasonForSuspendingActiveDOMObjects): Expose suspend reason to subclasses
4040         * history/CachedFrame.cpp:
4041         (WebCore::CachedFrameBase::restore): Add matching resume reason
4042         * page/Frame.cpp:
4043         (WebCore::Frame::resumeActiveDOMObjectsAndAnimations): Add matching resume reason
4044         * page/PageGroupLoadDeferrer.cpp:
4045         (WebCore::PageGroupLoadDeferrer::~PageGroupLoadDeferrer): Add matching resume reason
4046
4047 2013-05-22  Dean Jackson  <dino@apple.com>
4048
4049         Don't snapshot plugins that can't be snapshotted
4050         https://bugs.webkit.org/show_bug.cgi?id=116490
4051
4052         Reviewed by Tim Horton.
4053
4054         Some plugins, such as QuickTime, don't support snapshotting. We're
4055         planning on another way to capture snapshots, but in the meantime make
4056         sure that they don't fail to initialise because they were told to
4057         not use accelerated rendering.
4058
4059         * WebCore.exp.in: Export restartSnapshottedPlugin so that it can be used from WK2.
4060         * html/HTMLPlugInImageElement.cpp:
4061         (WebCore::HTMLPlugInImageElement::restartSimilarPlugIns): Don't set the play state before restarting.
4062         (WebCore::HTMLPlugInImageElement::userDidClickSnapshot): Make sure we indicated that this snapshotted plugin was clicked.
4063         * html/HTMLPlugInImageElement.h: Move restartSnapshottedPlugin from protected to public.
4064         * rendering/RenderSnapshottedPlugIn.cpp:
4065         (WebCore::RenderSnapshottedPlugIn::handleEvent): Don't set play state here. Let the restart functions do it.
4066
4067 2013-05-22  Max Vujovic  <mvujovic@adobe.com>
4068
4069         [CSS Shaders] valueForCustomFilterTransformParameter should check that renderer is a RenderBox
4070         https://bugs.webkit.org/show_bug.cgi?id=116464
4071
4072         Reviewed by Alexandru Chiculita.
4073
4074         If the renderer is not a RenderBox, we just use a zero size to compute the transform,
4075         like in CSSComputedStyleDeclaration::computedTransform.
4076
4077         Test: css3/filters/custom/custom-filter-crash-inline-computed-style.html
4078
4079         * css/CSSComputedStyleDeclaration.cpp:
4080         (WebCore::valueForCustomFilterTransformParameter):
4081
4082 2013-05-22  Simon Fraser  <simon.fraser@apple.com>
4083
4084         Fix assertion in the getComputedStyle-background-shorthand.html test
4085         https://bugs.webkit.org/show_bug.cgi?id=116639
4086
4087         Reviewed by Ryosuke Niwa.
4088
4089         getComputedStyle-background-shorthand.html was asserting under the newly added
4090         code in willBeRemovedFromTree(). The assertion was caused by too many calls to
4091         FrameView::removeSlowRepaintObject(), which happened because we called it for
4092         RenderTexts, which share style with their parent renderer.
4093         
4094         RenderText overrides styleWillChange() to do nothing, so we never
4095         call add/removeSlowRepaintObject() for them. Thus we should also skip this
4096         work in willBeRemovedFromTree() for RenderTexts.
4097
4098         * rendering/RenderObject.cpp:
4099         (WebCore::RenderObject::willBeRemovedFromTree):
4100
4101 2013-05-22  Bem Jones-Bey  <bjonesbe@adobe.com>
4102
4103         Heap-use-after-free in WebCore::RenderLayerModelObject::hasSelfPaintingLayer
4104         https://bugs.webkit.org/show_bug.cgi?id=116626
4105
4106         Reviewed by David Hyatt.
4107
4108         This is a port of a Blink bug fix by Emil Eklund.
4109
4110         Account for saturated estimated position in RenderBlock::layoutBlockChild.
4111
4112         If the estimated top position is saturated the comparison with oldLogicalTop
4113         might yield a false negative as adding and removing margins, borders etc from
4114         a saturated number might yield incorrect results. If this is the case always
4115         mark for layout.
4116
4117         Minimal test case impractical. See bug for raw fuzzer test case.
4118
4119         * platform/LayoutUnit.h:
4120         (WebCore::LayoutUnit::mightBeSaturated): Add helper method for checking whether
4121             a number might be saturated.
4122         * rendering/RenderBlock.cpp:
4123         (WebCore::RenderBlock::layoutBlockChild): Check if logicalTopEstimate is likely
4124             to be saturated and if so mark for layout.
4125
4126 2013-05-22  Benjamin Poulain  <benjamin@webkit.org>
4127
4128         Remove C