1 2016-01-20 Ryosuke Niwa <rniwa@webkit.org>
3 HTMLElement::nodeName should not upper case non-ASCII characters
4 https://bugs.webkit.org/show_bug.cgi?id=153231
6 Reviewed by Darin Adler.
8 Use the newly added convertToASCIIUppercase to generate the string for tagName and nodeName.
10 Test: fast/dom/Element/tagName-must-be-ASCII-uppercase-in-HTML-document.html
12 * dom/QualifiedName.cpp:
13 (WebCore::QualifiedName::localNameUpper): Use convertToASCIIUppercase.
14 * html/HTMLElement.cpp:
15 (WebCore::HTMLElement::nodeName): Use convertToASCIIUppercase.
17 2016-01-22 Brady Eidson <beidson@apple.com>
19 Modern IDB: Disable simultaneous transactions in the SQLite backend for now.
20 https://bugs.webkit.org/show_bug.cgi?id=153381
22 Reviewed by Alex Christensen.
24 No new tests (This resolves many of the currently crashing/asserting tests).
26 Right now we're porting the Legacy IDB SQLite backend to Modern IDB.
28 The way the Legacy backend works is restricted to one transaction at a time.
30 There's many tricks we can play to resolve this, but that task is better performed
31 once all of the basic functionality is done.
33 Fixing this limitation is covered by https://bugs.webkit.org/show_bug.cgi?id=153382
35 * Modules/indexeddb/server/IDBBackingStore.h: Add a "supports simultaneous transactions" getter.
36 * Modules/indexeddb/server/MemoryIDBBackingStore.h:
37 * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
39 * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
40 (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
41 (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
42 (WebCore::IDBServer::UniqueIDBDatabase::enqueueTransaction):
43 (WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction): If the backing store does
44 not support simultaneous transactions but there is a transaction in progress, return.
45 * Modules/indexeddb/server/UniqueIDBDatabase.h:
47 2016-01-22 Chris Dumez <cdumez@apple.com>
49 document.charset should be an alias for document.characterSet
50 https://bugs.webkit.org/show_bug.cgi?id=153367
52 Reviewed by Ryosuke Niwa.
54 document.charset should be an alias for document.characterSet:
55 - https://dom.spec.whatwg.org/#dom-document-charset
57 It should also be read-only.
59 Chrome matches the specification.
61 No new tests, already covered by existing tests.
66 2016-01-22 Chris Dumez <cdumez@apple.com>
68 Document.open / Document.write should be prevented while the document is being unloaded
69 https://bugs.webkit.org/show_bug.cgi?id=153255
70 <rdar://problem/22741293>
72 Reviewed by Ryosuke Niwa.
74 Document.open / Document.write should be prevented while the document
75 is being unloaded, as per the HTML specification:
76 - https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-open (step 6)
77 - https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-write (step 3)
79 This patch is aligning our behavior with the specification and Firefox.
80 Calling Document.open / Document.write during the document was being
81 unloaded would cause us to crash as this was unexpected.
83 Tests: fast/frames/page-hide-document-open.html
84 fast/frames/page-unload-document-open.html
86 * WebCore.xcodeproj/project.pbxproj:
87 Add new IgnoreOpensDuringUnloadCountIncrementer.h header.
90 (WebCore::Document::open):
91 Abort if the document's ignore-opens-during-unload counter is greater
93 https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-open (step 6)
95 (WebCore::Document::write):
96 Abort if the insertion point is undefined and the document's
97 ignore-opens-during-unload counter is greater than zero, as per:
98 https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-write (step 3)
101 Add data member to maintain the document's ignore-opens-during-unload counter:
102 https://html.spec.whatwg.org/multipage/webappapis.html#ignore-opens-during-unload-counter
104 * dom/IgnoreOpensDuringUnloadCountIncrementer.h: Added.
105 Add utility class to increment / decrement a document's
106 ignore-opens-during-unload counter.
108 * history/CachedFrame.cpp:
109 (WebCore::CachedFrame::CachedFrame):
110 When a page goes into PageCache, we don't end up calling
111 FrameLoader::detachChildren() so we need to increment the document's
112 ignore-opens-during-unload counter before calling stopLoading() on each
115 * loader/FrameLoader.cpp:
116 (WebCore::FrameLoader::detachChildren):
117 detachChildren() will end up firing the pagehide / unload events in each
118 child frame so we increment the parent frame's document's
119 ignore-opens-during-unload counter. This behavior matches the text of:
120 https://html.spec.whatwg.org/multipage/browsers.html#unload-a-document
122 As per the spec, the document's ignore-opens-during-unload counter should
123 be incremented before firing the pagehide / unload events at the document's
124 Window object. It should be decremented only after firing the pagehide /
125 unload events in each subframe. This is needed in case a subframe tries to
126 call document.open / document.write on a parent frame's document, from its
127 pagehide or unload handler.
129 (WebCore::FrameLoader::dispatchUnloadEvents):
130 Increment the document's ignore-opens-during-unload counter before firing
131 the pagehide / unload events and decrement it after. As per the spec, we
132 are not supposed to decrement this early. We actually supposed to wait
133 until the pagehide / unload events have been fired in all the subframes.
134 For this reason, we take care of re-incrementing the document's
135 ignore-opens-during-unload in detachChildren(), which will take care of
136 firing the pagehide / unload in the subframes.
138 2016-01-22 Brady Eidson <beidson@apple.com>
140 Modern IDB: Implement put, get, and delete records for the SQLite backend.
141 https://bugs.webkit.org/show_bug.cgi?id=153375
143 Reviewed by Alex Christensen.
145 No new tests (Covered by many existing tests now passing).
147 * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
148 (WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
149 (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
150 (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
151 (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
152 (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
153 * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
155 2016-01-22 Enrica Casucci <enrica@apple.com>
157 Add support for DataDetectors in WK (iOS).
158 https://bugs.webkit.org/show_bug.cgi?id=152989
159 rdar://problem/22855960
161 Reviewed by Tim Horton.
163 This patch adds the logic to perform data detection and modify
164 the DOM by adding data detector links as appropriate.
165 The data detector results returned by detectContentInRange are
166 stored in the Frame object.
168 * editing/cocoa/DataDetection.h:
169 * editing/cocoa/DataDetection.mm:
170 (WebCore::resultIsURL):
171 (WebCore::constructURLStringForResult):
172 (WebCore::removeResultLinksFromAnchor):
173 (WebCore::searchForLinkRemovingExistingDDLinks):
174 (WebCore::dataDetectorTypeForCategory):
175 (WebCore::buildQuery):
176 (WebCore::DataDetection::detectContentInRange):
177 * loader/FrameLoader.cpp:
178 (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
180 (WebCore::Frame::setDataDetectionResults):
181 (WebCore::Frame::dataDetectionResults):
182 * platform/spi/cocoa/DataDetectorsCoreSPI.h:
183 (DDQueryOffsetCompare):
185 2016-01-22 Daniel Bates <dabates@apple.com>
187 LayoutTest http/tests/security/xssAuditor/embed-tag-in-path-unterminated.html crashing
188 https://bugs.webkit.org/show_bug.cgi?id=153250
189 <rdar://problem/12172843>
191 <rdar://problem/24248040>
193 Reviewed by Alexey Proskuryakov.
195 Remove an incorrect assertion that the absolute URL associated with a protection space cannot
196 contain consecutive forward slash (/) characters. A URL can contain consecutive forward slashes.
197 This also makes the invariants for CredentialStorage::findDefaultProtectionSpaceForURL() symmetric
198 with the invariants for WebCore::protectionSpaceMapKeyFromURL().
200 Tests: http/tests/loading/basic-auth-load-URL-with-consecutive-slashes.html
201 http/tests/xmlhttprequest/basic-auth-load-URL-with-consecutive-slashes.html
203 * platform/network/CredentialStorage.cpp:
204 (WebCore::CredentialStorage::findDefaultProtectionSpaceForURL):
206 2016-01-22 Chris Dumez <cdumez@apple.com>
208 DOMImplementation.createHTMLDocument("") should append an empty Text Node to the title Element
209 https://bugs.webkit.org/show_bug.cgi?id=153374
211 Reviewed by Ryosuke Niwa.
213 DOMImplementation.createHTMLDocument("") should append an empty Text
214 Node to the title Element as per the steps at:
215 - https://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument (step 6)
217 Firefox and Chrome follow the specification here.
219 Previously, WebKit would rely on HTMLTitleElement.text setter which
220 does not create a Text Node if the title is the empty string, as per:
221 - https://html.spec.whatwg.org/multipage/semantics.html#dom-title-text
222 - https://dom.spec.whatwg.org/#dom-node-textcontent
224 No new tests, already covered by existing test.
226 * dom/DOMImplementation.cpp:
227 (WebCore::DOMImplementation::createHTMLDocument):
229 2016-01-17 Ada Chan <adachan@apple.com>
231 Add a mode parameter to MediaControllerInterface::supportsFullscreen() and ChromeClient::supportsVideoFullscreen().
232 https://bugs.webkit.org/show_bug.cgi?id=153220
234 Reviewed by Eric Carlson.
236 No new tests, just code refactoring.
238 * Modules/mediacontrols/MediaControlsHost.cpp:
239 (WebCore::MediaControlsHost::supportsFullscreen):
240 Just pass in VideoFullscreenModeStandard as this is used for checking the standard fullscreen case.
242 * html/HTMLMediaElement.cpp:
243 (WebCore::HTMLMediaElement::enterFullscreen):
244 Only use the FullScreen API if the mode is VideoFullscreenModeStandard. Call ChromeClient::supportsVideoFullscreen()
246 (WebCore::HTMLMediaElement::exitFullscreen):
247 Move the fullscreen element check up so we can use this method to exit picture-in-picture mode.
248 * html/HTMLMediaElement.h:
250 * html/HTMLVideoElement.cpp:
251 (WebCore::HTMLVideoElement::supportsFullscreen):
253 (WebCore::HTMLVideoElement::webkitEnterFullscreen):
254 Pass in VideoFullscreenModeStandard to supportsFullscreen() as this is used for the standard fullscreen case.
255 (WebCore::HTMLVideoElement::webkitSupportsFullscreen):
257 (WebCore::HTMLVideoElement::webkitSupportsPresentationMode):
258 Pass in the correct VideoFullscreenMode to supportsFullscreen() corresponding to the mode string passed in.
259 (WebCore::HTMLVideoElement::setFullscreenMode):
260 Pass in the mode to supportsFullscreen().
261 * html/HTMLVideoElement.h:
263 * html/MediaController.h:
264 * html/MediaControllerInterface.h:
265 Make supportsFullscreen() take a VideoFullscreenMode.
267 * html/shadow/MediaControls.cpp:
268 (WebCore::MediaControls::reset):
269 Pass in VideoFullscreenModeStandard to supportsFullscreen() here since this is used for the standard
271 * html/shadow/MediaControlsApple.cpp:
272 (WebCore::MediaControlsApple::reset):
275 * page/ChromeClient.h:
276 Make supportsVideoFullscreen() take a VideoFullscreenMode.
278 * rendering/HitTestResult.cpp:
279 (WebCore::HitTestResult::mediaSupportsFullscreen):
280 (WebCore::HitTestResult::toggleMediaFullscreenState):
281 (WebCore::HitTestResult::enterFullscreenForVideo):
282 Pass in VideoFullscreenModeStandard in the code relating to the standard fullscreen.
284 2016-01-22 Chris Dumez <cdumez@apple.com>
286 Document.URL / Document.documentURI should return "about:blank" instead of empty string / null
287 https://bugs.webkit.org/show_bug.cgi?id=153363
288 <rdar://problem/22549736>
290 Reviewed by Ryosuke Niwa.
292 Document.URL / Document.documentURI should return "about:blank" instead
293 of empty string / null, as per the specification:
294 - https://dom.spec.whatwg.org/#dom-document-url
295 - https://dom.spec.whatwg.org/#concept-document-url
297 Also, Document.documentURI should be an alias for Document.URL as per:
298 - https://dom.spec.whatwg.org/#dom-document-url
300 Firefox matches the specification.
302 No new tests, already covered by existing W3C tests.
305 (WebCore::Document::urlForBindings):
308 2016-01-22 Brent Fulgham <bfulgham@apple.com>
310 Don't ignore the return value of CCRandomCopyBytes
311 https://bugs.webkit.org/show_bug.cgi?id=153369
312 <rdar://problem/22198376>
313 <rdar://problem/22198378>
315 Reviewed by Alexey Proskuryakov.
317 Tested by existing Crypto tests.
319 * crypto/mac/CryptoKeyMac.cpp:
320 (WebCore::CryptoKey::randomData): RELEASE_ASSERT if CCRandomCopyBytes ever returns
321 anything besides kCCSuccess.
322 * crypto/mac/SerializedCryptoKeyWrapMac.mm:
323 (WebCore::createAndStoreMasterKey): Ditto.
324 (WebCore::wrapSerializedCryptoKey): Ditto.
326 2016-01-21 Sam Weinig <sam@webkit.org>
328 Treat non-https actions on secure pages as mixed content
329 <rdar://problem/23144492>
330 https://bugs.webkit.org/show_bug.cgi?id=153322
332 Reviewed by Alexey Proskuryakov.
334 Tests: http/tests/security/mixedContent/insecure-form-in-iframe.html
335 http/tests/security/mixedContent/insecure-form-in-main-frame.html
336 http/tests/security/mixedContent/javascript-url-form-in-main-frame.html
338 * html/HTMLFormElement.cpp:
339 (WebCore::HTMLFormElement::parseAttribute):
340 Check form actions for mixed content.
342 * loader/MixedContentChecker.cpp:
343 (WebCore::MixedContentChecker::checkFormForMixedContent):
344 * loader/MixedContentChecker.h:
345 Add new function to check and warn if a form's action is mixed content.
347 2016-01-22 Nan Wang <n_wang@apple.com>
349 AX: Crash in setTextMarkerDataWithCharacterOffset
350 https://bugs.webkit.org/show_bug.cgi?id=153365
351 <rdar://problem/24287924>
353 Reviewed by Chris Fleizach.
355 Sometimes when we try to create a text marker range from a stale text marker with a removed
356 node, it will cause crash. Fixed it by adding a null check for the AccessibilityObject we
357 create in setTextMarkerDataWithCharacterOffset.
359 Test: accessibility/text-marker/text-marker-range-with-removed-node-crash.html
361 * accessibility/AXObjectCache.cpp:
362 (WebCore::AXObjectCache::setTextMarkerDataWithCharacterOffset):
364 2016-01-22 Brady Eidson <beidson@apple.com>
366 Modern IDB: Add transactions and create/delete object store to SQLite backend
367 https://bugs.webkit.org/show_bug.cgi?id=153359
369 Reviewed by Alex Christensen.
371 No new tests (Covered by many tests now passing).
373 * Modules/indexeddb/server/IDBBackingStore.h: Change deleteObjectStore to work on an ID instead of name.
375 * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
376 (WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
377 (WebCore::IDBServer::MemoryIDBBackingStore::takeObjectStoreByIdentifier):
378 (WebCore::IDBServer::MemoryIDBBackingStore::takeObjectStoreByName): Deleted.
379 * Modules/indexeddb/server/MemoryIDBBackingStore.h:
381 Clean up filename generation a bit to actually match the previous directory structure.
382 Add begin/commit/abort transaction support.
383 Add create/delete object store support:
384 * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
385 (WebCore::IDBServer::SQLiteIDBBackingStore::filenameForDatabaseName):
386 (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectory):
387 (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabasePath):
388 (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
389 (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
390 (WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
391 (WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
392 (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
393 (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
394 (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
395 * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
397 Clean up SQLiteIDBTransaction to fit with the new WebCore backing store model, which is slightly
398 different from the old WebKit2 backing store model:
399 * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
400 (WebCore::IDBServer::SQLiteIDBTransaction::SQLiteIDBTransaction):
401 (WebCore::IDBServer::SQLiteIDBTransaction::begin):
402 (WebCore::IDBServer::SQLiteIDBTransaction::commit):
403 (WebCore::IDBServer::SQLiteIDBTransaction::abort):
404 (WebCore::IDBServer::SQLiteIDBTransaction::reset):
405 (WebCore::IDBServer::SQLiteIDBTransaction::rollback): Deleted.
406 * Modules/indexeddb/server/SQLiteIDBTransaction.h:
407 (WebCore::IDBServer::SQLiteIDBTransaction::transactionIdentifier):
408 (WebCore::IDBServer::SQLiteIDBTransaction::mode):
410 * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
411 (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
412 (WebCore::IDBServer::UniqueIDBDatabase::performDeleteObjectStore):
413 (WebCore::IDBServer::UniqueIDBDatabase::didPerformDeleteObjectStore):
414 * Modules/indexeddb/server/UniqueIDBDatabase.h:
416 * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
417 (WebCore::IDBDatabaseInfo::deleteObjectStore):
418 * Modules/indexeddb/shared/IDBDatabaseInfo.h:
420 * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
421 (WebCore::IDBObjectStoreInfo::maxIndexID):
423 * Modules/indexeddb/shared/IDBTransactionInfo.h:
424 (WebCore::IDBTransactionInfo::identifier):
426 2016-01-22 Antti Koivisto <antti@apple.com>
428 Style resolver initialization cleanups
429 https://bugs.webkit.org/show_bug.cgi?id=153356
431 Reviewed by Simon Fraser.
433 Simplify StyleResolver::State initialization.
434 Also use more references and other cleanups.
436 * css/MediaQueryMatcher.cpp:
437 (WebCore::MediaQueryMatcher::prepareEvaluator):
438 * css/StyleMedia.cpp:
439 (WebCore::StyleMedia::matchMedium):
440 * css/StyleResolver.cpp:
441 (WebCore::StyleResolver::State::clear):
442 (WebCore::StyleResolver::StyleResolver):
443 (WebCore::StyleResolver::classNamesAffectedByRules):
444 (WebCore::StyleResolver::State::State):
446 Initialize State using a constructor instead of bunch of construction functions.
447 Remove m_styledElement field which is just a casted version of m_element.
449 (WebCore::StyleResolver::State::updateConversionData):
450 (WebCore::StyleResolver::State::setStyle):
451 (WebCore::StyleResolver::sharingCandidateHasIdenticalStyleAffectingAttributes):
452 (WebCore::StyleResolver::canShareStyleWithElement):
453 (WebCore::StyleResolver::locateSharedStyle):
454 (WebCore::isAtShadowBoundary):
455 (WebCore::StyleResolver::styleForElement):
456 (WebCore::StyleResolver::styleForKeyframe):
457 (WebCore::StyleResolver::keyframeStylesForAnimation):
458 (WebCore::StyleResolver::pseudoStyleForElement):
459 (WebCore::StyleResolver::styleForPage):
460 (WebCore::StyleResolver::pseudoStyleRulesForElement):
461 (WebCore::StyleResolver::clearCachedPropertiesAffectedByViewportUnits):
462 (WebCore::isCacheableInMatchedPropertiesCache):
464 Disallow caching of document element style entirely because the writing-mode and direction properties have special handling.
465 The existing check wasn't robust.
467 (WebCore::extractDirectionAndWritingMode):
468 (WebCore::StyleResolver::applyMatchedProperties):
469 (WebCore::StyleResolver::applyPropertyToStyle):
470 (WebCore::StyleResolver::State::initElement): Deleted.
471 (WebCore::StyleResolver::initElement): Deleted.
472 (WebCore::StyleResolver::State::initForStyleResolve): Deleted.
473 * css/StyleResolver.h:
474 (WebCore::StyleResolver::mediaQueryEvaluator):
475 (WebCore::StyleResolver::State::State):
476 (WebCore::StyleResolver::State::document):
477 (WebCore::StyleResolver::State::element):
478 (WebCore::StyleResolver::State::style):
479 (WebCore::StyleResolver::State::takeStyle):
480 (WebCore::StyleResolver::State::styledElement): Deleted.
482 (WebCore::Element::resolveStyle):
483 * page/animation/KeyframeAnimation.cpp:
484 (WebCore::KeyframeAnimation::KeyframeAnimation):
485 * rendering/RenderElement.cpp:
486 (WebCore::RenderElement::getUncachedPseudoStyle):
487 (WebCore::RenderElement::containingBlockForFixedPosition):
488 * rendering/RenderNamedFlowFragment.cpp:
489 (WebCore::RenderNamedFlowFragment::computeStyleInRegion):
490 * style/StyleTreeResolver.cpp:
491 (WebCore::Style::TreeResolver::styleForElement):
492 * svg/SVGElement.cpp:
493 (WebCore::SVGElement::customStyleForRenderer):
494 (WebCore::SVGElement::computedStyle):
495 (WebCore::addQualifiedName):
496 * svg/SVGElementRareData.h:
497 (WebCore::SVGElementRareData::ensureAnimatedSMILStyleProperties):
498 (WebCore::SVGElementRareData::overrideComputedStyle):
500 2016-01-22 Chris Fleizach <cfleizach@apple.com>
502 AX: <code> group and friends should have a custom subrole
503 https://bugs.webkit.org/show_bug.cgi?id=153282
505 Reviewed by Mario Sanchez Prada.
507 Add some custom subroles for the mac for code, ins, del, cite, var, samp, pre, kbd,
508 so that assistive tech can recognize them.
510 Test: accessibility/mac/subroles-for-formatted-groups.html
512 * accessibility/AccessibilityObject.cpp:
513 (WebCore::AccessibilityObject::isStyleFormatGroup):
514 * accessibility/AccessibilityObject.h:
515 * accessibility/AccessibilityRenderObject.cpp:
516 (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
517 (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
518 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
519 (-[WebAccessibilityObjectWrapper subrole]):
521 2016-01-22 Enrica Casucci <enrica@apple.com>
523 Remove dependency from DataDetectorsCore on iOS.
524 https://bugs.webkit.org/show_bug.cgi?id=153358
525 rdar://problem/24294651
527 Reviewed by Anders Carlsson.
529 Avoid build dependencies.
531 * Configurations/WebCore.xcconfig:
533 2016-01-22 Chris Fleizach <cfleizach@apple.com>
535 AX: ARIA combo boxes are not returning the right value for selected text range
536 https://bugs.webkit.org/show_bug.cgi?id=153260
538 Reviewed by Darin Adler.
540 Just because an element has an ARIA role doesn't mean we should always use the selected text range of the whole document.
541 If the element is also a text based ARIA control, we can still use the element's inner text range to return the right value.
543 Test: accessibility/selected-text-range-aria-elements.html
545 * accessibility/AccessibilityRenderObject.cpp:
546 (WebCore::AccessibilityRenderObject::selectedTextRange):
548 2016-01-22 Chris Dumez <cdumez@apple.com>
550 Unreviewed iOS build fix after r195452.
552 * accessibility/AccessibilityNodeObject.cpp:
553 (WebCore::AccessibilityNodeObject::colorValue):
555 2016-01-21 Dave Hyatt <hyatt@apple.com>
557 Elements with overflow and border-radius don't show in multicolumn properly.
558 https://bugs.webkit.org/show_bug.cgi?id=152920
560 Reviewed by Simon Fraser.
562 Added new test in fast/multicol.
564 * rendering/RenderLayer.cpp:
565 (WebCore::RenderLayer::convertToLayerCoords):
566 (WebCore::RenderLayer::offsetFromAncestor):
567 (WebCore::RenderLayer::clipToRect):
568 * rendering/RenderLayer.h:
570 Make sure the crawl up the containing block chain to apply clips properly offsets
571 to account for columns. convertToLayerCoords could already handle this, so
572 offsetFromAncestor now takes the same extra argument (whether or not to adjust for
573 columns) that convertToLayerCoords does.
575 2016-01-22 Darin Adler <darin@apple.com>
577 Reduce use of equalIgnoringCase to just ignore ASCII case
578 https://bugs.webkit.org/show_bug.cgi?id=153266
580 Reviewed by Ryosuke Niwa.
582 Changed many call sites that were using equalIgnoringCase to instead use
583 equalLettersIgnoringASCIICase. What these all have in common is that the
584 thing they are comparing with is a string literal that has all lowercase
585 letters, spaces, and a few simple examples of punctuation.
587 Not 100% sure that the new function name is just right, but it's a long name
588 so it's easy to change it with a global replace if we come up with a better one.
590 Or if we decide ther eis no need for the "letters" optimization, we can change
591 these all to just use equalIgnoringASCIICase, also with a global replace.
593 Also made a few tweaks to some code nearby and some includes.
595 * Modules/encryptedmedia/CDMPrivateClearKey.cpp:
596 (WebCore::CDMPrivateClearKey::supportsKeySystem): Use equalLettersIgnoringASCIICase.
597 (WebCore::CDMPrivateClearKey::supportsKeySystemAndMimeType): Ditto.
598 * Modules/encryptedmedia/CDMSessionClearKey.cpp:
599 (WebCore::CDMSessionClearKey::update): Ditto.
600 * Modules/plugins/YouTubePluginReplacement.cpp:
601 (WebCore::YouTubePluginReplacement::supportsMimeType): Ditto.
602 (WebCore::YouTubePluginReplacement::supportsFileExtension): Ditto.
603 * Modules/webdatabase/DatabaseAuthorizer.cpp:
604 (WebCore::DatabaseAuthorizer::createVTable): Ditto.
605 (WebCore::DatabaseAuthorizer::dropVTable): Ditto.
606 * Modules/websockets/WebSocketHandshake.cpp:
607 (WebCore::WebSocketHandshake::readHTTPHeaders): Ditto.
608 (WebCore::WebSocketHandshake::checkResponseHeaders): Ditto.
609 * accessibility/AXObjectCache.cpp:
610 (WebCore::AXObjectCache::findAriaModalNodes): Ditto.
611 (WebCore::AXObjectCache::handleMenuItemSelected): Ditto.
612 (WebCore::AXObjectCache::handleAriaModalChange): Ditto.
613 (WebCore::isNodeAriaVisible): Ditto.
614 * accessibility/AccessibilityListBoxOption.cpp:
615 (WebCore::AccessibilityListBoxOption::isEnabled): Ditto.
617 * accessibility/AccessibilityNodeObject.cpp:
618 (WebCore::AccessibilityNodeObject::determineAccessibilityRole): Use isColorControl
619 instead of checking the typeAttr of the HTMLInputElement directly.
620 (WebCore::AccessibilityNodeObject::isEnabled): Use equalLettersIgnoringASCIICase.
621 (WebCore::AccessibilityNodeObject::isPressed): Ditto.
622 (WebCore::AccessibilityNodeObject::isChecked): Ditto.
623 (WebCore::AccessibilityNodeObject::isMultiSelectable): Ditto.
624 (WebCore::AccessibilityNodeObject::isRequired): Ditto.
625 (WebCore::shouldUseAccessibilityObjectInnerText): Ditto.
626 (WebCore::AccessibilityNodeObject::colorValue): Ditto.
628 * accessibility/AccessibilityObject.cpp:
629 (WebCore::AccessibilityObject::contentEditableAttributeIsEnabled):
630 Use equalLettersIgnoringASCIICase.
631 (WebCore::AccessibilityObject::ariaIsMultiline): Ditto.
632 (WebCore::AccessibilityObject::liveRegionStatusIsEnabled): Ditto.
633 (WebCore::AccessibilityObject::sortDirection): Ditto.
634 (WebCore::AccessibilityObject::supportsARIAPressed): Ditto.
635 (WebCore::AccessibilityObject::supportsExpanded): Ditto.
636 (WebCore::AccessibilityObject::isExpanded): Ditto.
637 (WebCore::AccessibilityObject::checkboxOrRadioValue): Ditto.
638 (WebCore::AccessibilityObject::isARIAHidden): Ditto.
639 * accessibility/AccessibilityRenderObject.cpp:
640 (WebCore::AccessibilityRenderObject::supportsARIADragging): Ditto.
641 (WebCore::AccessibilityRenderObject::defaultObjectInclusion): Ditto.
642 (WebCore::AccessibilityRenderObject::elementAttributeValue): Ditto.
643 (WebCore::AccessibilityRenderObject::isSelected): Ditto.
644 (WebCore::AccessibilityRenderObject::determineAccessibilityRole): Ditto.
645 (WebCore::AccessibilityRenderObject::orientation): Ditto.
646 (WebCore::AccessibilityRenderObject::canSetExpandedAttribute): Ditto.
647 (WebCore::AccessibilityRenderObject::canSetValueAttribute): Ditto.
648 (WebCore::AccessibilityRenderObject::ariaLiveRegionAtomic): Ditto.
650 * accessibility/AccessibilityTableCell.cpp:
651 (WebCore::AccessibilityTableCell::ariaRowSpan): Use == to compare a string
652 with "0" since there is no need to "ignore case" when there are no letters.
654 * css/CSSCalculationValue.cpp:
655 (WebCore::CSSCalcValue::create): Use equalLettersIgnoringASCIICase.
657 * css/CSSCalculationValue.h: Removed unneeded include of CSSParserValues.h.
658 * css/CSSCustomPropertyValue.h: Ditto.
660 * css/CSSFontFaceSrcValue.cpp:
661 (WebCore::CSSFontFaceSrcValue::isSVGFontFaceSrc): Use equalLettersIgnoringASCIICase.
663 * css/CSSGrammar.y.in: Use equalLettersIgnoringASCIICase. Also restructured the code
664 a bit to have more normal formatting and reordered it slightly.
667 (WebCore::equal): Deleted.
668 (WebCore::equalIgnoringCase): Deleted.
669 (WebCore::equalLettersIgnoringASCIICase): Added. Replaces function templates named
670 equal and equalIgnoringCase that are no longer used.
671 (WebCore::CSSParser::parseValue): Use equalLettersIgnoringASCIICase.
672 (WebCore::CSSParser::parseNonElementSnapPoints): Ditto.
673 (WebCore::CSSParser::parseAlt): Ditto.
674 (WebCore::CSSParser::parseContent): Ditto.
675 (WebCore::CSSParser::parseFillImage): Ditto.
676 (WebCore::CSSParser::parseAnimationName): Ditto.
677 (WebCore::CSSParser::parseAnimationTrigger): Ditto.
678 (WebCore::CSSParser::parseAnimationProperty): Ditto.
679 (WebCore::CSSParser::parseKeyframeSelector): Ditto.
680 (WebCore::CSSParser::parseAnimationTimingFunction): Ditto.
681 (WebCore::CSSParser::parseGridTrackList): Ditto.
682 (WebCore::CSSParser::parseGridTrackSize): Ditto.
683 (WebCore::CSSParser::parseDashboardRegions): Ditto.
684 (WebCore::CSSParser::parseClipShape): Ditto.
685 (WebCore::CSSParser::parseBasicShapeInset): Ditto.
686 (WebCore::CSSParser::parseBasicShape): Ditto.
687 (WebCore::CSSParser::parseFontFaceSrcURI): Ditto.
688 (WebCore::CSSParser::parseFontFaceSrc): Ditto.
689 (WebCore::CSSParser::isCalculation): Ditto.
690 (WebCore::CSSParser::parseColorFromValue): Ditto.
691 (WebCore::CSSParser::parseBorderImage): Ditto.
692 (WebCore::parseDeprecatedGradientPoint): Ditto.
693 (WebCore::parseDeprecatedGradientColorStop): Ditto.
694 (WebCore::CSSParser::parseDeprecatedGradient): Ditto.
695 (WebCore::CSSParser::parseLinearGradient): Ditto.
696 (WebCore::CSSParser::parseRadialGradient): Ditto.
697 (WebCore::CSSParser::isGeneratedImageValue): Ditto.
698 (WebCore::CSSParser::parseGeneratedImage): Ditto.
699 (WebCore::filterInfoForName): Ditto.
700 (WebCore::validFlowName): Ditto.
701 (WebCore::CSSParser::realLex): Ditto.
702 (WebCore::isValidNthToken): Ditto.
703 * css/CSSParserValues.cpp:
704 (WebCore::CSSParserSelector::parsePagePseudoSelector): Ditto.
706 * css/CSSParserValues.h:
707 (WebCore::equalLettersIgnoringASCIICase): Added.
709 * css/CSSVariableDependentValue.h: Removed unneeded include of CSSParserValues.h.
712 (WebCore::reportMediaQueryWarningIfNeeded): Use equalLettersIgnoringASCIICase.
713 * css/MediaQueryEvaluator.cpp:
714 (WebCore::MediaQueryEvaluator::mediaTypeMatch): Ditto.
715 (WebCore::MediaQueryEvaluator::mediaTypeMatchSpecific): Ditto.
716 (WebCore::evalResolution): Ditto.
718 * css/SelectorPseudoTypeMap.h: Removed unneeded include of CSSParserValues.h.
720 * css/StyleBuilderConverter.h:
721 (WebCore::StyleBuilderConverter::convertTouchCallout): Use equalLettersIgnoringASCIICase.
723 * css/makeSelectorPseudoClassAndCompatibilityElementMap.py: Added an include of
724 CSSParserValues.h since it's no longer included by SelectorPseudoTypeMap.h.
727 (WebCore::setParserFeature): Use equalLettersIgnoringASCIICase.
728 (WebCore::Document::processReferrerPolicy): Ditto.
729 (WebCore::Document::createEvent): Ditto.
730 (WebCore::Document::parseDNSPrefetchControlHeader): Ditto.
733 (WebCore::Element::spellcheckAttributeState): Use isNull instead of doing
734 checking equality with nullAtom. Use isEmpty instead of equalIgnoringCase("").
735 Use equalLettersIgnoringASCIICase.
736 (WebCore::Element::canContainRangeEndPoint): Ditto.
738 * dom/InlineStyleSheetOwner.cpp:
739 (WebCore::isValidCSSContentType): Use equalLettersIgnoringASCIICase.
740 Added comment about peculiar behavior where we do case-sensitive processing of
741 the MIME type if the document is XML.
743 * dom/ScriptElement.cpp:
744 (WebCore::ScriptElement::requestScript): Use equalLettersIgnoringASCIICase.
745 (WebCore::ScriptElement::isScriptForEventSupported): Ditto.
746 * dom/SecurityContext.cpp:
747 (WebCore::SecurityContext::parseSandboxPolicy): Ditto.
748 * dom/ViewportArguments.cpp:
749 (WebCore::findSizeValue): Ditto.
750 (WebCore::findScaleValue): Ditto.
751 (WebCore::findBooleanValue): Ditto.
753 * editing/EditorCommand.cpp:
754 (WebCore::executeDefaultParagraphSeparator): Use equalLettersIgnoringASCIICase.
755 (WebCore::executeInsertBacktab): Use ASCIILiteral.
756 (WebCore::executeInsertHTML): Use emptyString.
757 (WebCore::executeInsertLineBreak): Use ASCIILiteral.
758 (WebCore::executeInsertNewline): Ditto.
759 (WebCore::executeInsertTab): Ditto.
760 (WebCore::executeJustifyCenter): Ditto.
761 (WebCore::executeJustifyFull): Ditto.
762 (WebCore::executeJustifyLeft): Ditto.
763 (WebCore::executeJustifyRight): Ditto.
764 (WebCore::executeStrikethrough): Ditto.
765 (WebCore::executeStyleWithCSS): Use equalLettersIgnoringASCIICase.
766 (WebCore::executeUseCSS): Ditto.
767 (WebCore::executeSubscript): Use ASCIILiteral.
768 (WebCore::executeSuperscript): Ditto.
769 (WebCore::executeToggleBold): Ditto.
770 (WebCore::executeToggleItalic): Ditto.
771 (WebCore::executeUnderline): Ditto.
772 (WebCore::executeUnscript): Ditto.
773 (WebCore::stateBold): Ditto.
774 (WebCore::stateItalic): Ditto.
775 (WebCore::stateStrikethrough): Ditto.
776 (WebCore::stateSubscript): Ditto.
777 (WebCore::stateSuperscript): Ditto.
778 (WebCore::stateUnderline): Ditto.
779 (WebCore::stateJustifyCenter): Ditto.
780 (WebCore::stateJustifyFull): Ditto.
781 (WebCore::stateJustifyLeft): Ditto.
782 (WebCore::stateJustifyRight): Ditto.
783 (WebCore::valueFormatBlock): Use emptyString.
784 (WebCore::Editor::Command::value): Use ASCIILiteral.
786 * editing/TextIterator.cpp:
787 (WebCore::isRendererReplacedElement): Use equalLettersIgnoringASCIICase.
790 (WebCore::Blob::isNormalizedContentType): Use isASCIIUpper.
792 * history/HistoryItem.cpp:
793 (WebCore::HistoryItem::setFormInfoFromRequest): Use equalLettersIgnoringASCIICase.
795 * html/Autocapitalize.cpp:
796 (WebCore::valueOn): Deleted.
797 (WebCore::valueOff): Deleted.
798 (WebCore::valueNone): Deleted.
799 (WebCore::valueWords): Deleted.
800 (WebCore::valueSentences): Deleted.
801 (WebCore::valueAllCharacters): Deleted.
802 (WebCore::autocapitalizeTypeForAttributeValue): Use equalLettersIgnoringASCIICase.
803 (WebCore::stringForAutocapitalizeType): Put the AtomicString globals right in the
804 switch statement instead of in separate functions.
806 * html/HTMLAnchorElement.cpp:
807 (WebCore::HTMLAnchorElement::draggable): Use equalLettersIgnoringASCIICase.
808 * html/HTMLAreaElement.cpp:
809 (WebCore::HTMLAreaElement::parseAttribute): Ditto.
810 * html/HTMLBRElement.cpp:
811 (WebCore::HTMLBRElement::collectStyleForPresentationAttribute): Ditto.
812 * html/HTMLBodyElement.cpp:
813 (WebCore::HTMLBodyElement::collectStyleForPresentationAttribute): Ditto.
814 * html/HTMLButtonElement.cpp:
815 (WebCore::HTMLButtonElement::parseAttribute): Ditto.
817 * html/HTMLCanvasElement.cpp:
818 (WebCore::HTMLCanvasElement::toDataURL): Use ASCIILiteral.
820 * html/HTMLDivElement.cpp:
821 (WebCore::HTMLDivElement::collectStyleForPresentationAttribute):
822 Use equalLettersIgnoringASCIICase.
824 * html/HTMLDocument.cpp:
825 (WebCore::HTMLDocument::designMode): Use ASCIILiteral.
826 (WebCore::HTMLDocument::setDesignMode): Use equalLettersIgnoringASCIICase.
828 * html/HTMLElement.cpp:
829 (WebCore::HTMLElement::nodeName): Updated comment.
830 (WebCore::isLTROrRTLIgnoringCase): Use equalLettersIgnoringASCIICase.
831 (WebCore::contentEditableType): Ditto.
832 (WebCore::HTMLElement::collectStyleForPresentationAttribute): Ditto.
833 (WebCore::toValidDirValue): Ditto.
834 (WebCore::HTMLElement::insertAdjacent): Ditto.
835 (WebCore::contextElementForInsertion): Ditto.
836 (WebCore::HTMLElement::applyAlignmentAttributeToStyle): Ditto.
837 (WebCore::HTMLElement::setContentEditable): Ditto.
838 (WebCore::HTMLElement::draggable): Ditto.
839 (WebCore::HTMLElement::translateAttributeMode): Ditto.
840 (WebCore::HTMLElement::hasDirectionAuto): Ditto.
841 (WebCore::HTMLElement::directionality): Ditto.
842 (WebCore::HTMLElement::dirAttributeChanged): Ditto.
843 (WebCore::HTMLElement::addHTMLColorToStyle): Ditto.
844 * html/HTMLEmbedElement.cpp:
845 (WebCore::HTMLEmbedElement::collectStyleForPresentationAttribute): Ditto.
846 * html/HTMLFormControlElement.cpp:
847 (WebCore::HTMLFormControlElement::autocorrect): Ditto.
848 * html/HTMLFormElement.cpp:
849 (WebCore::HTMLFormElement::autocorrect): Ditto.
850 (WebCore::HTMLFormElement::shouldAutocomplete): Ditto.
851 * html/HTMLFrameElementBase.cpp:
852 (WebCore::HTMLFrameElementBase::parseAttribute): Ditto.
854 * html/HTMLFrameSetElement.cpp:
855 (WebCore::HTMLFrameSetElement::parseAttribute): Use equalLettersIgnoringASCIICase.
856 Use == when comparing with "0" and "1" since there is no need for case folding.
858 * html/HTMLHRElement.cpp:
859 (WebCore::HTMLHRElement::collectStyleForPresentationAttribute):
860 Use equalLettersIgnoringASCIICase.
861 * html/HTMLImageElement.cpp:
862 (WebCore::HTMLImageElement::draggable): Ditto.
863 * html/HTMLInputElement.cpp:
864 (WebCore::HTMLInputElement::parseAttribute): Ditto.
865 * html/HTMLKeygenElement.cpp:
866 (WebCore::HTMLKeygenElement::appendFormData): Ditto.
867 * html/HTMLMarqueeElement.cpp:
868 (WebCore::HTMLMarqueeElement::collectStyleForPresentationAttribute): Ditto.
869 * html/HTMLMediaElement.cpp:
870 (WebCore::HTMLMediaElement::parseAttribute): Ditto.
871 * html/HTMLMetaElement.cpp:
872 (WebCore::HTMLMetaElement::process): Ditto.
874 * html/HTMLObjectElement.cpp:
875 (WebCore::mapDataParamToSrc): Use references, modern for loops, simplify
876 logic to not use array indices, use ASCIILiteral and equalLettersIgnoringASCIICase.
877 (WebCore::HTMLObjectElement::parametersForPlugin): Update to call new function.
878 (WebCore::HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk): Use equalLettersIgnoringASCIICase.
879 (WebCore::HTMLObjectElement::containsJavaApplet): Ditto.
880 * html/HTMLParagraphElement.cpp:
881 (WebCore::HTMLParagraphElement::collectStyleForPresentationAttribute): Ditto.
882 * html/HTMLParamElement.cpp:
883 (WebCore::HTMLParamElement::isURLParameter): Ditto.
884 * html/HTMLTableElement.cpp:
885 (WebCore::getBordersFromFrameAttributeValue): Ditto.
886 (WebCore::HTMLTableElement::collectStyleForPresentationAttribute): Ditto.
887 (WebCore::HTMLTableElement::parseAttribute): Ditto.
888 * html/HTMLTablePartElement.cpp:
889 (WebCore::HTMLTablePartElement::collectStyleForPresentationAttribute): Ditto.
890 * html/HTMLTextAreaElement.cpp:
891 (WebCore::HTMLTextAreaElement::parseAttribute): Ditto.
892 * html/HTMLTextFormControlElement.cpp:
893 (WebCore::HTMLTextFormControlElement::setRangeText): Ditto.
894 (WebCore::HTMLTextFormControlElement::directionForFormData): Ditto.
895 * html/HTMLVideoElement.cpp:
896 (WebCore::HTMLVideoElement::parseAttribute): Ditto.
897 * html/InputType.cpp:
898 (WebCore::InputType::applyStep): Ditto.
899 * html/LinkRelAttribute.cpp:
900 (WebCore::LinkRelAttribute::LinkRelAttribute): Ditto.
901 * html/MediaElementSession.cpp:
902 (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled): Ditto.
903 * html/NumberInputType.cpp:
904 (WebCore::NumberInputType::sizeShouldIncludeDecoration): Ditto.
905 * html/RangeInputType.cpp:
906 (WebCore::RangeInputType::createStepRange): Ditto.
907 (WebCore::RangeInputType::handleKeydownEvent): Ditto.
908 * html/StepRange.cpp:
909 (WebCore::StepRange::parseStep): Ditto.
910 * html/canvas/CanvasStyle.cpp:
911 (WebCore::parseColor): Ditto.
912 * html/parser/HTMLConstructionSite.cpp:
913 (WebCore::HTMLConstructionSite::setCompatibilityModeFromDoctype): Ditto.
914 * html/parser/HTMLElementStack.cpp:
915 (WebCore::HTMLElementStack::isHTMLIntegrationPoint): Ditto.
916 * html/parser/HTMLMetaCharsetParser.cpp:
917 (WebCore::HTMLMetaCharsetParser::encodingFromMetaAttributes): Ditto.
918 * html/parser/HTMLPreloadScanner.cpp:
919 (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): Ditto.
920 (WebCore::TokenPreloadScanner::StartTagScanner::crossOriginModeAllowsCookies): Ditto.
921 * html/parser/HTMLTreeBuilder.cpp:
922 (WebCore::HTMLTreeBuilder::processStartTagForInBody): Ditto.
923 (WebCore::HTMLTreeBuilder::processStartTagForInTable): Ditto.
924 * html/parser/XSSAuditor.cpp:
925 (WebCore::isDangerousHTTPEquiv): Ditto.
927 * html/track/WebVTTParser.cpp:
928 (WebCore::WebVTTParser::hasRequiredFileIdentifier): Removed unneeded special case
931 * inspector/InspectorPageAgent.cpp:
932 (WebCore::createXHRTextDecoder): Use equalLettersIgnoringASCIICase.
933 * inspector/NetworkResourcesData.cpp:
934 (WebCore::createOtherResourceTextDecoder): Ditto.
935 * loader/CrossOriginAccessControl.cpp:
936 (WebCore::isOnAccessControlSimpleRequestHeaderWhitelist): Ditto.
937 * loader/DocumentLoader.cpp:
938 (WebCore::DocumentLoader::continueAfterContentPolicy): Ditto.
939 * loader/FormSubmission.cpp:
940 (WebCore::appendMailtoPostFormDataToURL): Ditto.
941 (WebCore::FormSubmission::Attributes::parseEncodingType): Ditto.
942 (WebCore::FormSubmission::Attributes::parseMethodType): Ditto.
943 * loader/FrameLoader.cpp:
944 (WebCore::FrameLoader::shouldPerformFragmentNavigation): Ditto.
945 (WebCore::FrameLoader::shouldTreatURLAsSrcdocDocument): Ditto.
946 * loader/ImageLoader.cpp:
947 (WebCore::ImageLoader::updateFromElement): Ditto.
948 * loader/MediaResourceLoader.cpp:
949 (WebCore::MediaResourceLoader::start): Ditto.
950 * loader/SubframeLoader.cpp:
951 (WebCore::SubframeLoader::createJavaAppletWidget): Ditto.
952 * loader/TextResourceDecoder.cpp:
953 (WebCore::TextResourceDecoder::determineContentType): Ditto.
954 * loader/TextTrackLoader.cpp:
955 (WebCore::TextTrackLoader::load): Ditto.
956 * loader/appcache/ApplicationCache.cpp:
957 (WebCore::ApplicationCache::requestIsHTTPOrHTTPSGet): Ditto.
958 * loader/cache/CachedCSSStyleSheet.cpp:
959 (WebCore::CachedCSSStyleSheet::canUseSheet): Ditto.
960 * loader/cache/CachedResource.cpp:
961 (WebCore::shouldCacheSchemeIndefinitely): Ditto.
962 * page/DOMSelection.cpp:
963 (WebCore::DOMSelection::modify): Ditto.
964 * page/EventSource.cpp:
965 (WebCore::EventSource::didReceiveResponse): Ditto.
966 * page/FrameView.cpp:
967 (WebCore::FrameView::scrollToAnchor): Ditto.
968 * page/Performance.cpp:
969 (WebCore::Performance::webkitGetEntriesByType): Ditto.
970 * page/PerformanceResourceTiming.cpp:
971 (WebCore::passesTimingAllowCheck): Ditto.
973 * page/SecurityOrigin.cpp:
974 (WebCore::SecurityOrigin::SecurityOrigin): Use emptyString.
975 (WebCore::SecurityOrigin::toString): Use ASCIILiteral.
976 (WebCore::SecurityOrigin::databaseIdentifier): Ditto.
978 * page/UserContentURLPattern.cpp:
979 (WebCore::UserContentURLPattern::parse): Use equalLettersIgnoringASCIICase.
980 (WebCore::UserContentURLPattern::matches): Ditto.
982 (WebCore::URL::protocolIs): Ditto.
984 * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
985 (WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystemAndMimeType):
986 Changed to use early exit and equalLettersIgnoringASCIICase. Added comment
987 about inconsistency with next function.
988 (WebCore::CDMPrivateMediaSourceAVFObjC::supportsMIMEType): Added comment
989 about inconsistency with previous function.
991 * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
992 (WebCore::CDMSessionAVContentKeySession::generateKeyRequest):
993 Use equalLettersIgnoringASCIICase.
994 * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
995 (WebCore::CDMSessionAVStreamSession::generateKeyRequest): Ditto.
996 * platform/graphics/cg/ImageBufferCG.cpp:
997 (WebCore::utiFromMIMEType): Ditto.
999 * platform/graphics/cocoa/FontCacheCoreText.cpp:
1000 (WebCore::FontCache::similarFont): Changed to not use so many global
1001 variables and use equalLettersIgnoringASCIICase.
1002 * platform/graphics/ios/FontCacheIOS.mm:
1003 (WebCore::platformFontWithFamilySpecialCase): Ditto.
1005 * platform/graphics/mac/FontCustomPlatformData.cpp:
1006 (WebCore::FontCustomPlatformData::supportsFormat): Use equalLettersIgnoringASCIICase.
1007 * platform/mac/PasteboardMac.mm:
1008 (WebCore::Pasteboard::readString): Ditto.
1009 * platform/network/BlobResourceHandle.cpp:
1010 (WebCore::BlobResourceHandle::createAsync): Ditto.
1011 (WebCore::BlobResourceHandle::loadResourceSynchronously): Ditto.
1012 * platform/network/CacheValidation.cpp:
1013 (WebCore::parseCacheControlDirectives): Ditto.
1014 * platform/network/FormData.h:
1015 (WebCore::FormData::parseEncodingType): Ditto.
1016 * platform/network/HTTPParsers.cpp:
1017 (WebCore::contentDispositionType): Ditto.
1018 (WebCore::parseXFrameOptionsHeader): Ditto.
1020 * platform/network/ResourceResponseBase.cpp:
1021 (WebCore::ResourceResponseBase::isHTTP): Use protocolIsInHTTPFamily, which is
1022 both clearer and more efficient.
1023 (WebCore::ResourceResponseBase::isAttachment): Rewrite to be a bit more terse
1024 and use equalLettersIgnoringASCIICase.
1026 * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
1027 (WebCore::ResourceHandleCFURLConnectionDelegate::createResourceRequest):
1028 Use equalLettersIgnoringASCIICase.
1029 * platform/network/mac/ResourceHandleMac.mm:
1030 (WebCore::ResourceHandle::willSendRequest): Ditto.
1031 * platform/sql/SQLiteDatabase.cpp:
1032 (WebCore::SQLiteDatabase::open): Ditto.
1033 * platform/sql/SQLiteStatement.cpp:
1034 (WebCore::SQLiteStatement::isColumnDeclaredAsBlob): Ditto.
1036 * platform/text/TextEncodingRegistry.cpp:
1037 (WebCore::defaultTextEncodingNameForSystemLanguage): Use ASCIILiteral
1038 and equalLettersIgnoringASCIICase.
1040 * rendering/mathml/RenderMathMLFraction.cpp:
1041 (WebCore::RenderMathMLFraction::updateFromElement): Use equalLettersIgnoringASCIICase.
1042 * svg/SVGToOTFFontConversion.cpp:
1043 (WebCore::SVGToOTFFontConverter::compareCodepointsLexicographically): Ditto.
1044 (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): Ditto.
1045 * testing/InternalSettings.cpp:
1046 (WebCore::InternalSettings::setEditingBehavior): Ditto.
1047 (WebCore::InternalSettings::setShouldDisplayTrackKind): Ditto.
1048 (WebCore::InternalSettings::shouldDisplayTrackKind): Ditto.
1049 * testing/Internals.cpp:
1050 (WebCore::markerTypeFrom): Ditto.
1051 (WebCore::markerTypesFrom): Ditto.
1052 (WebCore::Internals::mediaElementHasCharacteristic): Ditto.
1053 (WebCore::Internals::setCaptionDisplayMode): Ditto.
1054 (WebCore::Internals::beginMediaSessionInterruption): Ditto.
1055 (WebCore::Internals::endMediaSessionInterruption): Ditto.
1056 (WebCore::Internals::setMediaSessionRestrictions): Ditto.
1057 (WebCore::Internals::setMediaElementRestrictions): Ditto.
1058 (WebCore::Internals::postRemoteControlCommand): Ditto.
1059 (WebCore::Internals::setAudioContextRestrictions): Ditto.
1060 (WebCore::Internals::setMockMediaPlaybackTargetPickerState): Ditto.
1061 * testing/MockCDM.cpp:
1062 (WebCore::MockCDM::supportsKeySystem): Ditto.
1063 (WebCore::MockCDM::supportsKeySystemAndMimeType): Ditto.
1064 (WebCore::MockCDM::supportsMIMEType): Ditto.
1065 * xml/XMLHttpRequest.cpp:
1066 (WebCore::isSetCookieHeader): Ditto.
1067 (WebCore::XMLHttpRequest::responseXML): Ditto.
1068 (WebCore::XMLHttpRequest::isAllowedHTTPMethod): Ditto.
1069 (WebCore::XMLHttpRequest::didReceiveData): Ditto.
1071 2016-01-22 Youenn Fablet <youenn.fablet@crf.canon.fr>
1073 Remove PassRefPtr from ResourceRequest and FormData
1074 https://bugs.webkit.org/show_bug.cgi?id=153229
1076 Reviewed by Chris Dumez.
1078 Covered by existing tests.
1080 Making ResourceRequest::setHTTPBody take a RefPtr<FormData>&&.
1081 Moving FormData from PassRefPtr to RefPtr.
1083 * html/parser/XSSAuditorDelegate.cpp:
1084 (WebCore::XSSAuditorDelegate::didBlockScript):
1085 * loader/FormSubmission.cpp:
1086 (WebCore::FormSubmission::populateFrameLoadRequest):
1087 * loader/FrameLoader.cpp:
1088 (WebCore::FrameLoader::loadPostRequest):
1089 (WebCore::FrameLoader::loadDifferentDocumentItem):
1090 * loader/PingLoader.cpp:
1091 (WebCore::PingLoader::sendViolationReport):
1092 * loader/PingLoader.h:
1093 * page/ContentSecurityPolicy.cpp:
1094 (WebCore::ContentSecurityPolicy::reportViolation):
1095 * platform/network/FormData.cpp:
1096 (WebCore::FormData::create):
1097 (WebCore::FormData::createMultiPart):
1098 (WebCore::FormData::copy):
1099 (WebCore::FormData::deepCopy):
1100 (WebCore::FormData::resolveBlobReferences):
1101 * platform/network/FormData.h:
1102 (WebCore::FormData::decode):
1103 * platform/network/ResourceRequestBase.cpp:
1104 (WebCore::ResourceRequestBase::adopt):
1105 (WebCore::ResourceRequestBase::setHTTPBody):
1106 * platform/network/ResourceRequestBase.h:
1107 (WebCore::ResourceRequestBase::setHTTPBody):
1108 * platform/network/cf/FormDataStreamCFNet.cpp:
1109 (WebCore::setHTTPBody):
1110 * platform/network/cf/FormDataStreamCFNet.h:
1111 * platform/network/cf/ResourceRequestCFNet.cpp:
1112 (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
1113 (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
1114 * platform/network/cocoa/ResourceRequestCocoa.mm:
1115 (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
1116 * platform/network/curl/ResourceHandleManager.cpp:
1117 (WebCore::getFormElementsCount):
1118 * platform/network/mac/FormDataStreamMac.h:
1119 * platform/network/mac/FormDataStreamMac.mm:
1120 (WebCore::setHTTPBody):
1121 * platform/network/soup/ResourceHandleSoup.cpp:
1122 (WebCore::doRedirect):
1123 * xml/XMLHttpRequest.cpp:
1124 (WebCore::XMLHttpRequest::createRequest):
1126 2016-01-22 Csaba Osztrogonác <ossy@webkit.org>
1128 Fix the !ENABLE(INDEXED_DATABASE) build after r195443
1129 https://bugs.webkit.org/show_bug.cgi?id=153350
1131 Unreviewed buildfix.
1134 (WebCore::Page::setSessionID):
1136 2016-01-22 ChangSeok Oh <changseok.oh@collabora.com>
1138 [GTK] Remove a focus ring on anchor node when focused by mouse.
1139 https://bugs.webkit.org/show_bug.cgi?id=136121
1141 Reviewed by Michael Catanzaro.
1143 Safari, Chrome and FF don't show a focus ring, the dotted rectangle on anchor node
1144 for mouse clicking. I think the behavior is reasonable and looks better.
1145 No reason for gtk & efl ports to keep the focus on anchor node. Of course, this change should not
1146 affect the focus ring for tab navigation.
1148 No new tests since an existing test can cover this.
1149 Tests: fast/events/click-focus-anchor.html
1151 * html/HTMLAnchorElement.cpp:
1152 (WebCore::HTMLAnchorElement::isMouseFocusable):
1154 2016-01-21 Simon Fraser <simon.fraser@apple.com>
1156 REGRESSION (r168244): Content in horizontal-bt page is offset such that only the end is viewable and there is a white gap at the top
1157 https://bugs.webkit.org/show_bug.cgi?id=136019
1159 Reviewed by Dan Bernstein.
1161 In horizontal-bt documents (where the page starts scrolled to the bottom, and scrolling up goes into negative scroll positions),
1162 the position of the root content layer would be set incorrectly by the scrolling thread, resulting in misplaced
1165 Fix by having the renamed "yPositionForRootContentLayer" take scroll origin into
1166 account, and being more consistent about using scrollOrigin to position this layer.
1168 Test: fast/scrolling/programmatic-horizontal-bt-document-scroll.html
1170 * page/FrameView.cpp:
1171 (WebCore::FrameView::yPositionForFooterLayer): Moved
1172 (WebCore::FrameView::positionForRootContentLayer): Take scrollOrigin, and subtract it from the computed value.
1173 (WebCore::FrameView::yPositionForRootContentLayer): Renamed.
1175 * page/scrolling/AsyncScrollingCoordinator.cpp:
1176 (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): We've already pushed the new scrollPosition onto the FrameView,
1177 so we can just use the member function to compute the positionForContentsLayer.
1178 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1179 (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition): This is the bug fix; FrameView::positionForRootContentLayer()
1180 now takes scrollOrigin into account.
1181 * rendering/RenderLayerCompositor.cpp:
1182 (WebCore::RenderLayerCompositor::updateRootLayerPosition): Rather than using the documentRect, position the root content layer
1183 in terms of the scroll origin (which is -documentRect.location()).
1185 2016-01-21 Brady Eidson <beidson@apple.com>
1187 Modern IDB: Support populating/extracting database metadata with SQLite backend.
1188 Nhttps://bugs.webkit.org/show_bug.cgi?id=153318
1190 Reviewed by Alex Christensen.
1192 No new tests (Covered by current tests).
1195 * WebCore.xcodeproj/project.pbxproj:
1197 * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
1198 (WebCore::IDBClient::IDBDatabase::willAbortTransaction): Committing transactions can abort if the commit
1201 * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1202 (WebCore::IDBClient::IDBTransaction::didCommit): Before a committing transaction is aborted, notify the
1203 IDBDatabase that it aborted.
1205 Copied over from WK2:
1206 * Modules/indexeddb/server/IDBSerialization.cpp: Added.
1207 (WebCore::serializeIDBKeyPath):
1208 (WebCore::deserializeIDBKeyPath):
1209 (WebCore::serializeIDBKeyData):
1210 (WebCore::deserializeIDBKeyData):
1211 * Modules/indexeddb/server/IDBSerialization.h: Added.
1213 * Modules/indexeddb/server/IDBServer.cpp:
1214 (WebCore::IDBServer::IDBServer::createBackingStore): Optionally create a SQLite backing store.
1216 Mostly copied over verbatim from WebKit2's UniqueIDBDatabaseBackingStoreSQLite.cpp:
1217 * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1218 (WebCore::IDBServer::idbKeyCollate):
1219 (WebCore::IDBServer::v1RecordsTableSchema):
1220 (WebCore::IDBServer::v1RecordsTableSchemaAlternate):
1221 (WebCore::IDBServer::v2RecordsTableSchema):
1222 (WebCore::IDBServer::v2RecordsTableSchemaAlternate):
1223 (WebCore::IDBServer::createOrMigrateRecordsTableIfNecessary):
1224 (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidRecordsTable):
1225 (WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo):
1226 (WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo):
1227 (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
1228 (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
1229 (WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
1230 (WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
1231 (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
1232 (WebCore::IDBServer::SQLiteIDBBackingStore::unregisterCursor):
1233 * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1235 Copied over from WK2:
1236 * Modules/indexeddb/server/SQLiteIDBCursor.cpp: Added.
1237 (WebCore::IDBServer::SQLiteIDBCursor::maybeCreate):
1238 (WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
1239 (WebCore::IDBServer::buildIndexStatement):
1240 (WebCore::IDBServer::buildObjectStoreStatement):
1241 (WebCore::IDBServer::SQLiteIDBCursor::establishStatement):
1242 (WebCore::IDBServer::SQLiteIDBCursor::createSQLiteStatement):
1243 (WebCore::IDBServer::SQLiteIDBCursor::objectStoreRecordsChanged):
1244 (WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
1245 (WebCore::IDBServer::SQLiteIDBCursor::bindArguments):
1246 (WebCore::IDBServer::SQLiteIDBCursor::advance):
1247 (WebCore::IDBServer::SQLiteIDBCursor::advanceUnique):
1248 (WebCore::IDBServer::SQLiteIDBCursor::advanceOnce):
1249 (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
1250 (WebCore::IDBServer::SQLiteIDBCursor::iterate):
1251 * Modules/indexeddb/server/SQLiteIDBCursor.h: Added.
1252 (WebCore::IDBServer::SQLiteIDBCursor::identifier):
1253 (WebCore::IDBServer::SQLiteIDBCursor::transaction):
1254 (WebCore::IDBServer::SQLiteIDBCursor::objectStoreID):
1255 (WebCore::IDBServer::SQLiteIDBCursor::currentKey):
1256 (WebCore::IDBServer::SQLiteIDBCursor::currentPrimaryKey):
1257 (WebCore::IDBServer::SQLiteIDBCursor::currentValueBuffer):
1258 (WebCore::IDBServer::SQLiteIDBCursor::didError):
1260 Copied over from WK2:
1261 * Modules/indexeddb/server/SQLiteIDBTransaction.cpp: Added.
1262 (WebCore::IDBServer::SQLiteIDBTransaction::SQLiteIDBTransaction):
1263 (WebCore::IDBServer::SQLiteIDBTransaction::~SQLiteIDBTransaction):
1264 (WebCore::IDBServer::SQLiteIDBTransaction::begin):
1265 (WebCore::IDBServer::SQLiteIDBTransaction::commit):
1266 (WebCore::IDBServer::SQLiteIDBTransaction::reset):
1267 (WebCore::IDBServer::SQLiteIDBTransaction::rollback):
1268 (WebCore::IDBServer::SQLiteIDBTransaction::maybeOpenCursor):
1269 (WebCore::IDBServer::SQLiteIDBTransaction::closeCursor):
1270 (WebCore::IDBServer::SQLiteIDBTransaction::notifyCursorsOfChanges):
1271 (WebCore::IDBServer::SQLiteIDBTransaction::clearCursors):
1272 (WebCore::IDBServer::SQLiteIDBTransaction::inProgress):
1273 * Modules/indexeddb/server/SQLiteIDBTransaction.h: Added.
1274 (WebCore::IDBServer::SQLiteIDBTransaction::transactionIdentifier):
1275 (WebCore::IDBServer::SQLiteIDBTransaction::mode):
1276 (WebCore::IDBServer::SQLiteIDBTransaction::sqliteTransaction):
1279 (WebCore::Page::setSessionID): If the new SessionID is different from the last one,
1280 clear the IDBConnectionToServer.
1281 (WebCore::Page::idbConnection): Always ask the DatabaseProvider; It handles whether or not
1282 the session is ephemeral.
1284 2016-01-21 Alex Christensen <achristensen@webkit.org>
1286 CMake build fix after r195302.
1288 * PlatformMac.cmake:
1290 2016-01-21 Ryosuke Niwa <rniwa@webkit.org>
1292 createElementFromSavedToken shouldn't have the code to create a non-HTML element
1293 https://bugs.webkit.org/show_bug.cgi?id=153327
1295 Reviewed by Chris Dumez.
1297 Since HTMLConstructionSite::createElementFromSavedToken is only used to instantiate a formatting element,
1298 there is no need for it to support creating a non-HTML elements. Remove the branch and assert that this
1301 createElementFromSavedToken is called in HTMLTreeBuilder::callTheAdoptionAgency and HTMLConstructionSite's
1302 reconstructTheActiveFormattingElements. In both cases, the stack item passed to createElementFromSavedToken
1303 is guaranteed to be in the list of active formatting elements, which only contains formatting elements.
1305 No new tests since there is no behavioral change.
1307 * html/parser/HTMLConstructionSite.cpp:
1308 (WebCore::HTMLConstructionSite::insertHTMLHeadElement):
1309 (WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML):
1310 (WebCore::HTMLConstructionSite::insertFormattingElement):
1311 (WebCore::HTMLConstructionSite::createElement): Returns Ref<Element> instead of PassRefPtr<Element>.
1312 (WebCore::HTMLConstructionSite::createHTMLElement): Ditto.
1313 (WebCore::HTMLConstructionSite::createElementFromSavedToken): Ditto. Removed the code to instantiate
1314 a non-HTML element. Also assert that an element created by this function is a formatting tag.
1315 * html/parser/HTMLConstructionSite.h:
1316 * html/parser/HTMLTreeBuilder.cpp:
1317 (WebCore::HTMLConstructionSite::isFormattingTag): Put into HTMLConstructionSite to add an assertion.
1318 (WebCore::HTMLTreeBuilder::processEndTagForInBody):
1320 2016-01-21 Andreas Kling <akling@apple.com>
1322 CGImageSource sometimes retains temporary SharedBuffer data indefinitely, doubling memory cost.
1323 <https://webkit.org/b/153325>
1325 Reviewed by Anders Carlsson.
1327 After a resource has finished downloading, and has been cached to disk cache,
1328 we mmap() the disk cached version so we can throw out the temporary download buffer.
1330 Due to the way CGImageSource works on Mac/iOS, it's not possible to replace the data
1331 being decoded once the image has been fully decoded once. When doing the replacement,
1332 we'd end up with the SharedBuffer wrapping the mmap() data, and the CGImageSource
1333 keeping the old SharedBuffer::DataBuffer alive, effectively doubling the memory cost.
1335 This patch adds a CachedResource::didReplaceSharedBufferContents() callback that
1336 CachedImage implements to throw out the decoded data. This is currently the only way
1337 to make CGImageSource drop the retain it holds on the SharedBuffer::DataBuffer.
1338 The downside of this approach is that we'll sometimes incur the cost of one additional
1339 image decode after an image downloads and is cached for the first time.
1341 I put a FIXME in there since we could do better with a little help from CGImageSource.
1343 * loader/cache/CachedImage.cpp:
1344 (WebCore::CachedImage::didReplaceSharedBufferContents):
1345 * loader/cache/CachedImage.h:
1346 * loader/cache/CachedResource.cpp:
1347 (WebCore::CachedResource::tryReplaceEncodedData):
1348 * loader/cache/CachedResource.h:
1349 (WebCore::CachedResource::didReplaceSharedBufferContents):
1351 2016-01-21 Beth Dakin <bdakin@apple.com>
1353 Add the ability to update WebKitAdditions to WK2
1354 https://bugs.webkit.org/show_bug.cgi?id=153320
1356 rdar://problem/23639629
1358 Reviewed by Anders Carlsson.
1360 This SPI is un-used now.
1361 * platform/spi/mac/NSSpellCheckerSPI.h:
1363 2016-01-21 Simon Fraser <simon.fraser@apple.com>
1365 GraphicsContext: low quality drawImage and drawImageBuffer should use InterpolationLow
1366 https://bugs.webkit.org/show_bug.cgi?id=49002
1368 Reviewed by Chris Dumez.
1370 When using low quality image scaling for images which are getting painted often,
1371 the code used InterpolationNone, which make the images look even worse than they should.
1373 Not easily testable.
1375 * platform/graphics/GraphicsContext.cpp:
1376 (WebCore::GraphicsContext::drawImage):
1377 (WebCore::GraphicsContext::drawImageBuffer):
1378 (WebCore::GraphicsContext::drawConsumingImageBuffer):
1380 2016-01-19 Ada Chan <adachan@apple.com>
1382 Make it possible to enable VIDEO_PRESENTATION_MODE on other Cocoa platforms.
1383 https://bugs.webkit.org/show_bug.cgi?id=153218
1385 Reviewed by Eric Carlson.
1387 No new tests. Code refactoring.
1389 * Configurations/FeatureDefines.xcconfig:
1390 * WebCore.xcodeproj/project.pbxproj:
1391 Move WebVideoFullscreenInterface.h from ios to cocoa.
1392 * html/HTMLVideoElement.cpp:
1393 (WebCore::HTMLVideoElement::webkitSupportsPresentationMode):
1394 The declaration of supportsPictureInPicture() has been moved to WebVideoFullscreenInterface.h
1395 so include that header instead. Guard the supportsPictureInPicture() call with PLATFORM(COCOA)
1396 as that method is only defined in Cocoa.
1397 * platform/cocoa/WebVideoFullscreenInterface.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterface.h.
1398 Also move the declaration of supportsPictureInPicture() here.
1399 * platform/graphics/MediaPlayer.cpp:
1400 * platform/graphics/MediaPlayer.h:
1401 * platform/graphics/MediaPlayerPrivate.h:
1402 Implementations of methods related to the video fullscreen layer are now guarded by
1403 PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)) instead.
1404 * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
1405 Declaration of supportsPictureInPicture() has been moved to WebVideoFullscreenInterface.h
1406 * platform/mac/WebVideoFullscreenInterfaceMac.mm: Added.
1407 (WebCore::supportsPictureInPicture):
1408 Return false for now.
1410 2016-01-21 Said Abou-Hallawa <sabouhallawa@apple.com>
1412 A crash reproducible in Path::isEmpty() under RenderSVGShape::paint()
1413 https://bugs.webkit.org/show_bug.cgi?id=149613
1415 Reviewed by Darin Adler.
1417 When RenderSVGRoot::layout() realizes its layout size has changed and
1418 it has resources which have relative sizes, it marks all the clients of
1419 the resources for invalidates regardless whether they belong to the
1420 same RenderSVGRoot or not. But it reruns the layout only for its children.
1421 If one of these clients comes before the current RenderSVGRoot in the render
1422 tree, ee end up having renderer marked for invalidation at rendering time.
1423 This also prevents scheduling the layout if the same renderer is marked
1424 for another invalidation later. We prevent this because we do not want
1425 to schedule another layout for a renderer which is already marked for
1426 invalidation. This can cause crash if the renderer is an RenderSVGPath.
1428 The fix is to mark "only" the clients of a resource which belong to the
1429 same RenderSVGRoot of the resource. Also we need to run the layout for
1430 all the resources which belong to different RenderSVGRoots before running
1431 the layout for an SVG renderer.
1433 Tests: svg/custom/filter-update-different-root.html
1434 svg/custom/pattern-update-different-root.html
1436 * rendering/svg/RenderSVGResourceContainer.cpp:
1437 (WebCore::RenderSVGResourceContainer::markAllClientsForInvalidation):
1438 We should not mark any client outside the current root for invalidation
1440 * rendering/svg/RenderSVGResourceContainer.h: Remove unneeded private keyword.
1442 * rendering/svg/RenderSVGRoot.cpp:
1443 (WebCore::RenderSVGRoot::addResourceForClientInvalidation):
1444 Code clean up; use findTreeRootObject() instead of repeating the same code.
1446 * rendering/svg/RenderSVGShape.cpp:
1447 (WebCore::RenderSVGShape::isEmpty): Avoid crashing if RenderSVGShape::isEmpty()
1448 is called before calling RenderSVGShape::layout().
1450 * rendering/svg/RenderSVGText.cpp:
1451 (WebCore::RenderSVGText::layout): findTreeRootObject() now returns a pointer.
1453 * rendering/svg/SVGRenderSupport.cpp:
1454 (WebCore::SVGRenderSupport::findTreeRootObject): I do think nothing
1455 guarantees that an SVG renderer has to have an RenderSVGRoot in its
1456 ancestors. So change this function to return a pointer. Also Provide
1457 the non-const version of this function.
1459 (WebCore::SVGRenderSupport::layoutDifferentRootIfNeeded): Runs the layout
1460 if needed for all the resources which belong to different RenderSVGRoots.
1462 (WebCore::SVGRenderSupport::layoutChildren): Make sure all the renderer's
1463 resources which belong to different RenderSVGRoots are laid out before
1464 running the layout for this renderer.
1466 * rendering/svg/SVGRenderSupport.h: Remove a mysterious comment.
1468 * rendering/svg/SVGResources.cpp:
1469 (WebCore::SVGResources::layoutDifferentRootIfNeeded): Run the layout for
1470 all the resources which belong to different RenderSVGRoots outside the
1471 context of their RenderSVGRoots.
1473 * rendering/svg/SVGResources.h:
1474 (WebCore::SVGResources::clipper):
1475 (WebCore::SVGResources::markerStart):
1476 (WebCore::SVGResources::markerMid):
1477 (WebCore::SVGResources::markerEnd):
1478 (WebCore::SVGResources::masker):
1479 (WebCore::SVGResources::filter):
1480 (WebCore::SVGResources::fill):
1481 (WebCore::SVGResources::stroke):
1482 Code clean up; use nullptr instead of 0.
1484 2016-01-21 Jer Noble <jer.noble@apple.com>
1486 [EME] Correctly report errors when generating key requests from AVContentKeySession.
1487 https://bugs.webkit.org/show_bug.cgi?id=151963
1489 Reviewed by Eric Carlson.
1491 WebIDL's "unsigned long" is a 32-bit unsigned integer, and C++'s "unsigned long" is (or, can
1492 be) a 64-bit integer on 64-bit platforms. Casting a negative integer to a 64-bit integer
1493 results in a number which cannot be accurately stored in a double-length floating point
1494 number. Previously, the mac CDM code would work around this issue by returning the absolute
1495 value of NSError code returned by media frameworks. Instead, fix the underlying problem by
1496 storing the MediaKeyError's systemCode as a uint32_t (which more accurately represents the
1497 size of a WebIDL "unsigned long" on all platforms.)
1499 Check the error code issued by -contentKeyRequestDataForApp:contentIdentifier:options:error:.
1501 * Modules/encryptedmedia/CDM.h:
1502 * Modules/encryptedmedia/CDMSessionClearKey.cpp:
1503 (WebCore::CDMSessionClearKey::generateKeyRequest):
1504 (WebCore::CDMSessionClearKey::update):
1505 * Modules/encryptedmedia/CDMSessionClearKey.h:
1506 * Modules/encryptedmedia/MediaKeySession.cpp:
1507 (WebCore::MediaKeySession::keyRequestTimerFired):
1508 (WebCore::MediaKeySession::addKeyTimerFired):
1509 (WebCore::MediaKeySession::sendError):
1510 * Modules/encryptedmedia/MediaKeySession.h:
1511 * Modules/mediacontrols/mediaControlsApple.js:
1512 (Controller.prototype.handleReadyStateChange):
1513 * WebCore.xcodeproj/project.pbxproj:
1514 * html/MediaKeyError.h:
1515 (WebCore::MediaKeyError::create):
1516 (WebCore::MediaKeyError::systemCode):
1517 * html/MediaKeyEvent.h:
1518 * platform/graphics/CDMSession.h:
1519 * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
1520 (WebCore::CDMSessionAVFoundationCF::generateKeyRequest):
1521 (WebCore::CDMSessionAVFoundationCF::update):
1522 * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
1523 * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
1524 * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
1525 (WebCore::CDMSessionAVContentKeySession::generateKeyRequest):
1526 (WebCore::CDMSessionAVContentKeySession::update):
1527 (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
1528 * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
1529 * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
1530 (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
1531 (WebCore::CDMSessionAVFoundationObjC::update):
1532 * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
1533 * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
1534 (WebCore::CDMSessionAVStreamSession::generateKeyRequest):
1535 (WebCore::CDMSessionAVStreamSession::update):
1536 (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
1537 * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
1538 * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
1539 (WebCore::CDMSessionMediaSourceAVFObjC::layerDidReceiveError):
1540 (WebCore::CDMSessionMediaSourceAVFObjC::rendererDidReceiveError):
1541 (WebCore::CDMSessionMediaSourceAVFObjC::systemCodeForError): Deleted.
1542 * testing/MockCDM.cpp:
1543 (WebCore::MockCDMSession::generateKeyRequest):
1544 (WebCore::MockCDMSession::update):2016-01-15 Simon Fraser <simon.fraser@apple.com>
1546 2016-01-21 Carlos Garcia Campos <cgarcia@igalia.com>
1548 [SOUP] GResource resources should be cached indefinitely in memory cache
1549 https://bugs.webkit.org/show_bug.cgi?id=153275
1551 Reviewed by Žan Doberšek.
1553 GResources can't change so they will always return the same data,
1554 we never need to revalidate them.
1556 * loader/cache/CachedResource.cpp:
1557 (WebCore::shouldCacheSchemeIndefinitely):
1559 2016-01-21 Nan Wang <n_wang@apple.com>
1561 AX: [IOS] Implement next/previous text marker functions using TextIterator
1562 https://bugs.webkit.org/show_bug.cgi?id=153292
1563 <rdar://problem/24268243>
1565 Reviewed by Chris Fleizach.
1567 Added support for the refactored next/previous text marker functions on iOS. And
1568 made text marker tests working on iOS.
1569 Also, fixed an issue in AXObjectCache where creating a range with a replaced node
1570 at the start or end might exclude that node.
1572 Tests: accessibility/text-marker/text-marker-previous-next.html
1573 accessibility/text-marker/text-marker-with-user-select-none.html
1575 * accessibility/AXObjectCache.cpp:
1576 (WebCore::characterOffsetsInOrder):
1577 (WebCore::resetNodeAndOffsetForReplacedNode):
1578 (WebCore::AXObjectCache::rangeForUnorderedCharacterOffsets):
1579 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1580 (+[WebAccessibilityTextMarker textMarkerWithVisiblePosition:cache:]):
1581 (+[WebAccessibilityTextMarker textMarkerWithCharacterOffset:cache:]):
1582 (+[WebAccessibilityTextMarker startOrEndTextMarkerForRange:isStart:cache:]):
1583 (-[WebAccessibilityTextMarker dataRepresentation]):
1584 (-[WebAccessibilityTextMarker visiblePosition]):
1585 (-[WebAccessibilityTextMarker characterOffset]):
1586 (-[WebAccessibilityTextMarker isIgnored]):
1587 (-[WebAccessibilityTextMarker accessibilityObject]):
1588 (-[WebAccessibilityTextMarker description]):
1589 (-[WebAccessibilityObjectWrapper stringForTextMarkers:]):
1591 (-[WebAccessibilityObjectWrapper textMarkerRange]):
1592 (-[WebAccessibilityObjectWrapper accessibilityObjectForTextMarker:]):
1593 (-[WebAccessibilityObjectWrapper nextMarkerForMarker:]):
1594 (-[WebAccessibilityObjectWrapper previousMarkerForMarker:]):
1595 (-[WebAccessibilityObjectWrapper textMarkerForPoint:]):
1596 (-[WebAccessibilityObjectWrapper nextMarkerForCharacterOffset:]):
1597 (-[WebAccessibilityObjectWrapper previousMarkerForCharacterOffset:]):
1598 (-[WebAccessibilityObjectWrapper rangeForTextMarkers:]):
1599 (-[WebAccessibilityObjectWrapper lengthForTextMarkers:]):
1600 (-[WebAccessibilityObjectWrapper startOrEndTextMarkerForTextMarkers:isStart:]):
1601 (-[WebAccessibilityObjectWrapper textMarkerRangeForMarkers:]):
1602 (-[WebAccessibilityObjectWrapper accessibilityIdentifier]):
1604 2016-01-20 Zalan Bujtas <zalan@apple.com>
1606 http://victordarras.fr/cssgame/ doesn't work in Safari.
1607 https://bugs.webkit.org/show_bug.cgi?id=153285
1608 <rdar://problem/24212369>
1610 Reviewed by Tim Horton.
1612 This patch adds support for hittesting ClipPathOperation::Reference.
1614 Tests: svg/clip-path/hittest-clip-path-reference-miss.html
1616 * rendering/RenderBlock.cpp:
1617 (WebCore::RenderBlock::nodeAtPoint):
1618 * rendering/RenderObject.h:
1619 (WebCore::RenderObject::isSVGResourceClipper):
1620 * rendering/svg/RenderSVGResourceClipper.h:
1623 2016-01-20 David Kilzer <ddkilzer@apple.com>
1625 ResourceHandleCFURLConnectionDelegateWithOperationQueue delegate methods don't NULL-check m_handle->client()
1626 <https://webkit.org/b/152675>
1627 <rdar://problem/24034044>
1629 Reviewed by Brent Fulgham.
1631 * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1632 (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
1633 (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
1634 (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
1635 (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
1636 (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
1637 (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
1638 (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveDataArray):
1639 - Add NULL check for m_handle->client() as is done in the
1640 WebCoreResourceHandleAsOperationQueueDelegate class in
1641 WebCoreResourceHandleAsOperationQueueDelegate.mm. (The NULL
1642 check for -connection:didReceiveResponse: is currently
1643 missing, but there are crashes there, too, that are covered by
1646 2016-01-20 Said Abou-Hallawa <sabouhallawa@apple.com>
1648 Use TinyLRUCache in caching the CGColorRef in WebCore::cachedCGColor()
1649 https://bugs.webkit.org/show_bug.cgi?id=153279
1651 Reviewed by Dean Jackson.
1653 Reuse the new template TinyLRUCache in caching the CGColor instead of
1654 having the same code repeated twice.
1656 * platform/graphics/cg/ColorCG.cpp:
1657 (WebCore::leakCGColor):
1658 (WebCore::RetainPtr<CGColorRef>>::createValueForKey):
1659 (WebCore::cachedCGColor):
1661 2016-01-20 Timothy Hatcher <timothy@apple.com>
1663 Web Inspector: InspectorCSSAgent does not call disable in willDestroyFrontendAndBackend
1664 https://bugs.webkit.org/show_bug.cgi?id=153289
1665 <rdar://problem/24242600>
1667 Reviewed by Joseph Pecoraro.
1669 * inspector/InspectorCSSAgent.cpp:
1670 (WebCore::InspectorCSSAgent::willDestroyFrontendAndBackend): Call disable().
1672 2016-01-20 Said Abou-Hallawa <sabouhallawa@apple.com>
1674 Refactor AtomicStringKeyedMRUCache to be a generic LRU cache
1675 https://bugs.webkit.org/show_bug.cgi?id=153109
1677 Reviewed by Darin Adler.
1679 Replace the template specialization of AtomicStringKeyedMRUCache with
1680 template derived from TinyLRUCachePolicy. Override the functions which
1681 are needed for creating the values and the null value. Also replace the
1682 static function which was returning a NeverDestroyed AtomicStringKeyedMRUCache
1683 with a singleton function 'cache' inside the derived template.
1685 * WebCore.xcodeproj/project.pbxproj:
1686 * platform/text/AtomicStringKeyedMRUCache.h: Removed.
1687 * platform/text/cf/HyphenationCF.cpp:
1688 (WebCore::canHyphenate):
1689 (WebCore::lastHyphenLocation):
1690 (WebCore::AtomicStringKeyedMRUCache<RetainPtr<CFLocaleRef>>::createValueForNullKey): Deleted.
1691 (WebCore::AtomicStringKeyedMRUCache<RetainPtr<CFLocaleRef>>::createValueForKey): Deleted.
1692 (WebCore::cfLocaleCache): Deleted.
1693 * platform/text/hyphen/HyphenationLibHyphen.cpp:
1694 (WebCore::countLeadingSpaces):
1695 (WebCore::lastHyphenLocation):
1696 (WebCore::AtomicStringKeyedMRUCache<RefPtr<HyphenationDictionary>>::createValueForNullKey): Deleted.
1697 (WebCore::AtomicStringKeyedMRUCache<RefPtr<HyphenationDictionary>>::createValueForKey): Deleted.
1698 (WebCore::hyphenDictionaryCache): Deleted.
1700 2016-01-20 Chris Dumez <cdumez@apple.com>
1702 Drop support for obsolete Node.isSupported()
1703 https://bugs.webkit.org/show_bug.cgi?id=153164
1705 Reviewed by Darin Adler.
1707 Drop support for obsolete Node.isSupported(). Chrome and Firefox already
1710 No new tests, already covered by existing test.
1713 (WebCore::Node::isSupportedForBindings):
1717 2016-01-20 Carlos Garcia Campos <cgarcia@igalia.com>
1719 Unreviewed. Fix compile warning when building with GTK+ < 3.14.
1721 * rendering/RenderThemeGtk.cpp:
1722 (WebCore::loadThemedIcon):
1724 2016-01-20 Csaba Osztrogonác <ossy@webkit.org>
1726 [Mac] Speculative cmake buildfix after r195317.
1728 * PlatformMac.cmake:
1730 2016-01-19 Chris Dumez <cdumez@apple.com>
1732 DocumentType.publicId / systemId should never return null
1733 https://bugs.webkit.org/show_bug.cgi?id=153264
1735 Reviewed by Ryosuke Niwa.
1737 DocumentType.publicId / systemId should never return null as these
1738 attributes are not nullable in the IDL:
1739 https://dom.spec.whatwg.org/#interface-documenttype
1741 Instead we should return the empty string. Firefox and Chrome match the
1744 No new tests, already covered by existing tests.
1746 * dom/DocumentType.idl:
1748 2016-01-19 Commit Queue <commit-queue@webkit.org>
1750 Unreviewed, rolling out r195302.
1751 https://bugs.webkit.org/show_bug.cgi?id=153267
1753 This change broke the Windows build, rolling out so it isn't
1754 broken all night before investigation. (Requested by
1755 ryanhaddad on #webkit).
1759 "[EME] Correctly report errors when generating key requests
1760 from AVContentKeySession."
1761 https://bugs.webkit.org/show_bug.cgi?id=151963
1762 http://trac.webkit.org/changeset/195302
1764 2016-01-19 Chris Dumez <cdumez@apple.com>
1766 DOMImplementation.createDocument() should treat undefined namespace as null
1767 https://bugs.webkit.org/show_bug.cgi?id=153252
1769 Reviewed by Ryosuke Niwa.
1771 DOMImplementation.createDocument() should treat undefined namespace as null as
1772 the DOMString parameter is nullable:
1773 https://dom.spec.whatwg.org/#domimplementation
1775 Firefox behaves according to the specification, Chrome does not.
1777 No new tests, already covered by existing test.
1779 * dom/DOMImplementation.idl:
1781 2016-01-19 Enrica Casucci <enrica@apple.com>
1783 Add support for DataDetectors in WK (iOS).
1784 https://bugs.webkit.org/show_bug.cgi?id=152989
1785 rdar://problem/22855960
1787 Reviewed by Tim Horton.
1789 This is the first step toward implementing Data Detectors support
1790 in WK2. The patch adds a new memeber to the Settings object
1791 to retrieve the type of detection desired. The DataDetection files
1792 have been moved under cocoa, since they are no longer OS X specific.
1794 * Configurations/FeatureDefines.xcconfig:
1795 * Configurations/WebCore.xcconfig:
1796 * WebCore.xcodeproj/project.pbxproj:
1797 * editing/cocoa/DataDetection.h: Copied from Source/WebCore/editing/mac/DataDetection.h.
1798 * editing/cocoa/DataDetection.mm: Copied from Source/WebCore/editing/mac/DataDetection.mm.
1799 (WebCore::detectItemAtPositionWithRange):
1800 (WebCore::DataDetection::detectItemAroundHitTestResult):
1801 (WebCore::DataDetection::detectContentInRange):
1802 * editing/mac/DataDetection.h: Removed.
1803 * editing/mac/DataDetection.mm: Removed.
1804 * loader/FrameLoader.cpp:
1805 (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
1808 * platform/spi/mac/DataDetectorsSPI.h:
1810 2016-01-19 Nikos Andronikos <nikos.andronikos-webkit@cisra.canon.com.au>
1812 SVG 2 requires a mechanism for restricting enum values exposed through the DOM
1813 https://bugs.webkit.org/show_bug.cgi?id=152814
1815 Reviewed by Darin Adler.
1817 No new tests (No change in functionality, blocked bugs add new tests).
1819 This patch adds a mechanism to restrict the values returned through the
1820 SVGAnimatedEnumeration interface.
1821 This is required for SVG 2, which does not expose new enumeration
1822 values through the IDL.
1823 See http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAnimatedEnumeration
1825 SVG 2 does not add numeric type values for new options, new options
1826 should return UNKNOWN.
1827 E.g. See the table defining numeric type values for orient at
1828 http://www.w3.org/TR/SVG2/painting.html#InterfaceSVGMarkerElement
1830 On setting baseVal, the following steps are run:
1832 2. If value is 0 or is not the numeric type value for any value of the reflected attribute, then set the reflected attribute to the empty string.
1834 * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
1835 Override baseVal() and animVal() to perform range checks against
1836 the highest exposed enum value.
1837 * svg/properties/SVGAnimatedStaticPropertyTearOff.h:
1838 (WebCore::SVGAnimatedStaticPropertyTearOff::baseVal): Mark function as virtual as it's over-ridden for enumerations.
1839 (WebCore::SVGAnimatedStaticPropertyTearOff::animVal): Mark function as virtual as it's over-ridden for enumerations.
1840 * svg/properties/SVGPropertyTraits.h:
1841 Add SVGIDLEnumLimits struct that contains function for querying the
1842 highest exposed enum value.
1843 (WebCore::SVGIDLEnumLimits::highestExposedEnumValue): New function that returns the highest enum value that should
1844 be exposed through the DOM. This function should be specialized for enum types that need to restrict the exposed
1847 2016-01-19 Konstantin Tokarev <annulen@yandex.ru>
1849 Fixed compilation of AXObjectCache in case of !HAVE(ACCESSIBILITY).
1850 https://bugs.webkit.org/show_bug.cgi?id=153243
1852 Reviewed by Chris Fleizach.
1854 No new tests needed.
1856 * accessibility/AXObjectCache.h:
1857 (WebCore::AXObjectCache::AXObjectCache):
1858 (WebCore::nodeHasRole): Deleted.
1860 2016-01-19 Antti Koivisto <antti@apple.com>
1862 Use references in SelectorChecker
1863 https://bugs.webkit.org/show_bug.cgi?id=153240
1865 Reviewed by Andreas Kling.
1867 Element and selector can't be null in most places.
1869 * css/ElementRuleCollector.cpp:
1870 (WebCore::ElementRuleCollector::collectMatchingRules):
1871 * css/SelectorChecker.cpp:
1872 (WebCore::attributeValueMatches):
1873 (WebCore::anyAttributeMatches):
1874 (WebCore::SelectorChecker::checkOne):
1875 (WebCore::SelectorChecker::matchSelectorList):
1876 (WebCore::SelectorChecker::checkScrollbarPseudoClass):
1877 (WebCore::SelectorChecker::determineLinkMatchType):
1878 (WebCore::isFrameFocused):
1879 (WebCore::SelectorChecker::matchesFocusPseudoClass):
1880 * css/SelectorChecker.h:
1881 (WebCore::SelectorChecker::isCommonPseudoClassSelector):
1882 (WebCore::SelectorChecker::checkExactAttribute): Deleted.
1883 * css/SelectorCheckerTestFunctions.h:
1884 (WebCore::isAutofilled):
1885 (WebCore::isDefaultButtonForForm):
1886 (WebCore::isDisabled):
1887 (WebCore::isEnabled):
1888 (WebCore::isMediaDocument):
1889 (WebCore::isChecked):
1890 (WebCore::isInRange):
1891 (WebCore::isOutOfRange):
1892 (WebCore::isInvalid):
1893 (WebCore::isOptionalFormControl):
1894 (WebCore::isRequiredFormControl):
1896 (WebCore::isWindowInactive):
1897 (WebCore::containslanguageSubtagMatchingRange):
1898 (WebCore::matchesLangPseudoClass):
1899 (WebCore::matchesReadOnlyPseudoClass):
1900 (WebCore::matchesReadWritePseudoClass):
1901 (WebCore::shouldAppearIndeterminate):
1902 (WebCore::scrollbarMatchesEnabledPseudoClass):
1903 (WebCore::scrollbarMatchesCornerPresentPseudoClass):
1904 (WebCore::matchesFullScreenPseudoClass):
1905 (WebCore::matchesFullScreenAnimatingFullScreenTransitionPseudoClass):
1906 (WebCore::matchesFullScreenAncestorPseudoClass):
1907 (WebCore::matchesFullScreenDocumentPseudoClass):
1908 (WebCore::matchesFutureCuePseudoClass):
1909 (WebCore::matchesPastCuePseudoClass):
1911 2016-01-19 Chris Dumez <cdumez@apple.com>
1913 Unreviewed, rolling out r195179.
1915 It relies on r195141 which was rolled out
1919 "Allocate style sheet media queries in BumpArena."
1920 https://bugs.webkit.org/show_bug.cgi?id=153188
1921 http://trac.webkit.org/changeset/195179
1923 2016-01-19 Chris Dumez <cdumez@apple.com>
1925 Unreviewed, rolling out r195173.
1927 It relies on r195141 which was rolled out
1931 "Give RuleSet a BumpArena and start using it for
1933 https://bugs.webkit.org/show_bug.cgi?id=153169
1934 http://trac.webkit.org/changeset/195173
1936 2016-01-19 Commit Queue <commit-queue@webkit.org>
1938 Unreviewed, rolling out r195300.
1939 https://bugs.webkit.org/show_bug.cgi?id=153244
1941 enrica wants more time to fix Windows (Requested by thorton on
1946 "Add support for DataDetectors in WK (iOS)."
1947 https://bugs.webkit.org/show_bug.cgi?id=152989
1948 http://trac.webkit.org/changeset/195300
1950 2016-01-19 Zalan Bujtas <zalan@apple.com>
1952 outline-offset does not work for inlines.
1953 https://bugs.webkit.org/show_bug.cgi?id=153238
1955 Reviewed by Simon Fraser.
1957 Adjust outline box width/height with outline-offset.
1959 Test: fast/inline/inlines-with-outline-offset.html
1961 * rendering/RenderInline.cpp:
1962 (WebCore::RenderInline::paintOutline):
1963 (WebCore::RenderInline::paintOutlineForLine):
1965 2016-01-19 Chris Dumez <cdumez@apple.com>
1967 Unreviewed, rolling out r195141.
1969 Seems to cause crashes on iOS9 64bit
1973 "Fragmentation-free allocator for timeless and/or coupled
1975 https://bugs.webkit.org/show_bug.cgi?id=152696
1976 http://trac.webkit.org/changeset/195141
1978 2015-12-07 Jer Noble <jer.noble@apple.com>
1980 [EME] Correctly report errors when generating key requests from AVContentKeySession.
1981 https://bugs.webkit.org/show_bug.cgi?id=151963
1983 Reviewed by Eric Carlson.
1985 WebIDL's "unsigned long" is a 32-bit unsigned integer, and C++'s "unsigned long" is (or, can
1986 be) a 64-bit integer on 64-bit platforms. Casting a negative integer to a 64-bit integer
1987 results in a number which cannot be accurately stored in a double-length floating point
1988 number. Previously, the mac CDM code would work around this issue by returning the absolute
1989 value of NSError code returned by media frameworks. Instead, fix the underlying problem by
1990 storing the MediaKeyError's systemCode as a uint32_t (which more accurately represents the
1991 size of a WebIDL "unsigned long" on all platforms.)
1993 Check the error code issued by -contentKeyRequestDataForApp:contentIdentifier:options:error:.
1995 * Modules/encryptedmedia/CDM.h:
1996 * Modules/encryptedmedia/CDMSessionClearKey.cpp:
1997 (WebCore::CDMSessionClearKey::generateKeyRequest):
1998 (WebCore::CDMSessionClearKey::update):
1999 * Modules/encryptedmedia/CDMSessionClearKey.h:
2000 * Modules/encryptedmedia/MediaKeySession.cpp:
2001 (WebCore::MediaKeySession::keyRequestTimerFired):
2002 (WebCore::MediaKeySession::addKeyTimerFired):
2003 (WebCore::MediaKeySession::sendError):
2004 * Modules/encryptedmedia/MediaKeySession.h:
2005 * Modules/mediacontrols/mediaControlsApple.js:
2006 (Controller.prototype.handleReadyStateChange):
2007 * WebCore.xcodeproj/project.pbxproj:
2008 * html/MediaKeyError.h:
2009 (WebCore::MediaKeyError::create):
2010 (WebCore::MediaKeyError::systemCode):
2011 * html/MediaKeyEvent.h:
2012 * platform/graphics/CDMSession.h:
2013 * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
2014 * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
2015 (WebCore::CDMSessionAVContentKeySession::generateKeyRequest):
2016 (WebCore::CDMSessionAVContentKeySession::update):
2017 (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
2018 * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
2019 * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
2020 (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
2021 (WebCore::CDMSessionAVFoundationObjC::update):
2022 * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
2023 * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
2024 (WebCore::CDMSessionAVStreamSession::generateKeyRequest):
2025 (WebCore::CDMSessionAVStreamSession::update):
2026 (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
2027 * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
2028 * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
2029 (WebCore::CDMSessionMediaSourceAVFObjC::layerDidReceiveError):
2030 (WebCore::CDMSessionMediaSourceAVFObjC::rendererDidReceiveError):
2031 (WebCore::CDMSessionMediaSourceAVFObjC::systemCodeForError): Deleted.
2032 * testing/MockCDM.cpp:
2033 (WebCore::MockCDMSession::generateKeyRequest):
2034 (WebCore::MockCDMSession::update):2016-01-15 Simon Fraser <simon.fraser@apple.com>
2036 2016-01-19 Enrica Casucci <enrica@apple.com>
2038 Add support for DataDetectors in WK (iOS).
2039 https://bugs.webkit.org/show_bug.cgi?id=152989
2040 rdar://problem/22855960
2042 Reviewed by Tim Horton.
2044 This is the first step toward implementing Data Detectors support
2045 in WK2. The patch adds a new memeber to the Settings object
2046 to retrieve the type of detection desired. The DataDetection files
2047 have been moved under cocoa, since they are no longer OS X specific.
2049 * Configurations/FeatureDefines.xcconfig:
2050 * Configurations/WebCore.xcconfig:
2051 * WebCore.xcodeproj/project.pbxproj:
2052 * editing/cocoa/DataDetection.h: Copied from Source/WebCore/editing/mac/DataDetection.h.
2053 * editing/cocoa/DataDetection.mm: Copied from Source/WebCore/editing/mac/DataDetection.mm.
2054 (WebCore::detectItemAtPositionWithRange):
2055 (WebCore::DataDetection::detectItemAroundHitTestResult):
2056 (WebCore::DataDetection::detectContentInRange):
2057 * editing/mac/DataDetection.h: Removed.
2058 * editing/mac/DataDetection.mm: Removed.
2059 * loader/FrameLoader.cpp:
2060 (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
2063 * platform/spi/mac/DataDetectorsSPI.h:
2065 2016-01-19 Chris Dumez <cdumez@apple.com>
2067 Unreviewed, fix typo in comment added in r195157.
2069 * dom/DocumentType.h:
2071 2016-01-18 Antti Koivisto <antti@apple.com>
2073 Selector checker should not mutate document and style
2074 https://bugs.webkit.org/show_bug.cgi?id=153205
2076 Reviewed by Darin Adler.
2078 Selector checker currently writes affected-by bits and similar directly to the document and style during selector
2079 matching. This is confusing, complicated and wrong.
2081 This patch changes SelectorChecker and SelectorCompiler to collect style relatationship metadata to a separate
2082 data structure (currently part of SelectorChecker::CheckingContext) instead of changing the document and style
2083 directly. The mutations are performed later outside selector checker.
2085 * css/ElementRuleCollector.cpp:
2086 (WebCore::ElementRuleCollector::ruleMatches):
2087 (WebCore::ElementRuleCollector::commitStyleRelations):
2089 Apply the relationship bit to elements and style.
2091 (WebCore::ElementRuleCollector::collectMatchingRulesForList):
2092 * css/ElementRuleCollector.h:
2093 * css/SelectorChecker.cpp:
2094 (WebCore::SelectorChecker::LocalContext::LocalContext):
2096 LocalContext is now a separate data structure.
2098 (WebCore::addStyleRelation):
2100 Helper for recording new style relations. This is used where code mutated elements or style directly before.
2102 (WebCore::isFirstChildElement):
2103 (WebCore::isLastChildElement):
2104 (WebCore::isFirstOfType):
2105 (WebCore::isLastOfType):
2106 (WebCore::countElementsBefore):
2107 (WebCore::countElementsOfTypeBefore):
2108 (WebCore::SelectorChecker::SelectorChecker):
2109 (WebCore::SelectorChecker::match):
2110 (WebCore::hasScrollbarPseudoElement):
2111 (WebCore::localContextForParent):
2112 (WebCore::SelectorChecker::matchRecursively):
2113 (WebCore::attributeValueMatches):
2114 (WebCore::anyAttributeMatches):
2115 (WebCore::canMatchHoverOrActiveInQuirksMode):
2116 (WebCore::tagMatches):
2117 (WebCore::SelectorChecker::checkOne):
2118 (WebCore::SelectorChecker::matchSelectorList):
2119 (WebCore::SelectorChecker::checkScrollbarPseudoClass):
2120 (WebCore::SelectorChecker::CheckingContextWithStatus::CheckingContextWithStatus): Deleted.
2121 (WebCore::checkingContextForParent): Deleted.
2122 * css/SelectorChecker.h:
2123 (WebCore::SelectorChecker::CheckingContext::CheckingContext):
2124 * css/SelectorCheckerTestFunctions.h:
2125 (WebCore::isEnabled):
2126 (WebCore::isMediaDocument):
2127 (WebCore::isChecked):
2128 (WebCore::isInRange):
2129 (WebCore::isOutOfRange):
2130 * css/StyleResolver.h:
2131 (WebCore::checkRegionSelector):
2132 * cssjit/SelectorCompiler.cpp:
2133 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelationIfResolvingStyle):
2134 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation):
2136 Helpers for generating code for recording new style relations. This is used where code mutated elements or style directly before.
2138 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorCheckerExcludingPseudoElements):
2139 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateDirectAdjacentTreeWalker):
2140 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateIndirectAdjacentTreeWalker):
2141 (WebCore::SelectorCompiler::addStyleRelationElementFunction):
2142 (WebCore::SelectorCompiler::SelectorCodeGenerator::jumpIfNoPreviousAdjacentElement):
2143 (WebCore::SelectorCompiler::SelectorCodeGenerator::moduloIsZero):
2144 (WebCore::SelectorCompiler::SelectorCodeGenerator::linkFailures):
2145 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
2146 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateContextFunctionCallTest):
2147 (WebCore::SelectorCompiler::elementIsActive):
2148 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsActive):
2149 (WebCore::SelectorCompiler::jumpIfElementIsNotEmpty):
2150 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsEmpty):
2151 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsFirstChild):
2152 (WebCore::SelectorCompiler::elementIsHovered):
2153 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsHovered):
2154 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsInLanguage):
2155 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsLastChild):
2156 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsOnlyChild):
2157 (WebCore::SelectorCompiler::makeContextStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
2158 (WebCore::SelectorCompiler::isPlaceholderShown):
2159 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasPlaceholderShown):
2160 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsLink):
2161 (WebCore::SelectorCompiler::nthFilterIsAlwaysSatisified):
2162 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
2163 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
2164 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChild):
2165 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChildOf):
2166 (WebCore::SelectorCompiler::SelectorCodeGenerator::generateMarkPseudoStyleForPseudoElement):
2167 (WebCore::SelectorCompiler::SelectorCodeGenerator::addFlagsToElementStyleFromContext): Deleted.
2168 (WebCore::SelectorCompiler::setNodeFlag): Deleted.
2169 (WebCore::SelectorCompiler::SelectorCodeGenerator::markElementIfResolvingStyle): Deleted.
2170 (WebCore::SelectorCompiler::setFirstChildState): Deleted.
2171 (WebCore::SelectorCompiler::elementIsActiveForStyleResolution): Deleted.
2172 (WebCore::SelectorCompiler::setElementStyleIsAffectedByEmpty): Deleted.
2173 (WebCore::SelectorCompiler::setElementStyleFromContextIsAffectedByEmptyAndUpdateRenderStyleIfNecessary): Deleted.
2174 (WebCore::SelectorCompiler::elementIsHoveredForStyleResolution): Deleted.
2175 (WebCore::SelectorCompiler::setLastChildState): Deleted.
2176 (WebCore::SelectorCompiler::setOnlyChildState): Deleted.
2177 (WebCore::SelectorCompiler::makeElementStyleUniqueIfNecessaryAndTestIsPlaceholderShown): Deleted.
2178 (WebCore::SelectorCompiler::setElementChildIndex): Deleted.
2179 (WebCore::SelectorCompiler::setChildrenAffectedByBackwardPositionalRules): Deleted.
2180 (WebCore::SelectorCompiler::setParentAffectedByLastChildOf): Deleted.
2181 * dom/SelectorQuery.cpp:
2182 (WebCore::SelectorDataList::selectorMatches):
2183 (WebCore::SelectorDataList::selectorClosest):
2184 (WebCore::SelectorDataList::matches):
2185 * inspector/InspectorCSSAgent.cpp:
2186 (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
2187 * inspector/InspectorStyleSheet.cpp:
2188 (WebCore::buildObjectForSelectorHelper):
2190 2016-01-19 Carlos Garcia Campos <cgarcia@igalia.com>
2192 Unreviewed. Fix GTK+ build with GTK+ < 3.14.
2194 Flags GTK_ICON_LOOKUP_DIR_LTR and GTK_ICON_LOOKUP_DIR_RTL were
2197 * rendering/RenderThemeGtk.cpp:
2198 (WebCore::loadThemedIcon):
2200 2016-01-19 Carlos Garcia Campos <cgarcia@igalia.com>
2202 Unreviewed. Fix GObject DOM bindings API break after r195264.
2204 Add webkit_dom_character_data_set_data to the list of functions
2205 that used to raise exceptions.
2207 * bindings/scripts/CodeGeneratorGObject.pm:
2208 (FunctionUsedToRaiseException):
2210 2016-01-19 Javier Fernandez <jfernandez@igalia.com>
2212 [css-grid][css-align] justify-self stretch is not applied for img elements
2213 https://bugs.webkit.org/show_bug.cgi?id=153206
2215 Reviewed by Darin Adler.
2217 When computing the logical height, we check first if there is an override
2218 height value set as a consequence of the stretching logic, so we use it
2219 directly for any kind of element. However, in the case of the width
2220 computation, we don't use such override value because it's the default
2221 behavior of block-level boxes.
2223 However, we consider some special cases which have to be treated as
2224 replaced elements. Theses cases are evaluated first, so we don't let the
2225 regular width computation logic to be executed, which is what we want
2226 to implement the stretch behavior.
2228 In order to let replaced elements, such images, to be stretched as a
2229 consequence of the CSS alignment properties, we need to exclude grid
2230 items from the cases to be treated as replaced elements during the width
2233 Test: fast/css-grid-layout/grid-align-stretching-replaced-items.html
2235 * rendering/RenderBox.cpp:
2236 (WebCore::RenderBox::computeLogicalWidthInRegion):
2237 (WebCore::RenderBox::hasStretchedLogicalWidth):
2238 (WebCore::RenderBox::sizesLogicalWidthToFitContent):
2239 * rendering/RenderBox.h:
2241 2016-01-19 Ryosuke Niwa <rniwa@webkit.org>
2243 Text::splitText doesn't update Range end points anchored on parent nodes
2244 https://bugs.webkit.org/show_bug.cgi?id=153227
2246 Reviewed by Antti Koivisto.
2248 When a Text node is split into two and there is a Range whose boundary points' container node
2249 is its parent and offset appears after the Text node, we must update the boundary points as specified
2250 in step 7 of the concept "split" a Text node at https://dom.spec.whatwg.org/#concept-text-split
2252 1. Insert new node into parent before node’s next sibling.
2253 2. For each range whose start node is node and start offset is greater than offset, set its start node
2254 to new node and decrease its start offset by offset.
2255 3. For each range whose end node is node and end offset is greater than offset, set its end node to
2256 new node and decrease its end offset by offset.
2257 4. For each range whose start node is parent and start offset is equal to the index of node + 1,
2258 increase its start offset by one.
2259 5. For each range whose end node is parent and end offset is equal to the index of node + 1, increase
2260 its end offset by one.
2262 Fixed the bug by implementing steps 4 and 5 in boundaryTextNodesSplit. New behavior matches the DOM spec
2263 as well as the behavior of Firefox.
2265 Test: fast/dom/Range/update-range-in-split-text.html
2268 (WebCore::boundaryTextNodesSplit): See above.
2269 * dom/RangeBoundaryPoint.h:
2270 (WebCore::RangeBoundaryPoint::setToAfterChild): Added.
2272 2016-01-19 Ryosuke Niwa <rniwa@webkit.org>
2274 CharacterData::setData doesn't need ExceptionCode as an out argument
2275 https://bugs.webkit.org/show_bug.cgi?id=153225
2277 Reviewed by Antti Koivisto.
2279 Removed the ExceptionCode out argument from CharacterData::setData since it's never used.
2281 * dom/CharacterData.cpp:
2282 (WebCore::CharacterData::setData):
2283 (WebCore::CharacterData::containsOnlyWhitespace):
2284 (WebCore::CharacterData::setNodeValue):
2285 (WebCore::CharacterData::setDataAndUpdate):
2286 * dom/CharacterData.h:
2287 (WebCore::CharacterData::data):
2288 (WebCore::CharacterData::dataMemoryOffset):
2289 (WebCore::CharacterData::length):
2290 * dom/CharacterData.idl:
2292 (WebCore::Range::processContentsBetweenOffsets):
2294 (WebCore::Text::replaceWholeText):
2295 * editing/markup.cpp:
2296 (WebCore::replaceChildrenWithFragment):
2297 (WebCore::replaceChildrenWithText):
2298 * html/HTMLOptionElement.cpp:
2299 (WebCore::HTMLOptionElement::setText):
2300 * html/HTMLScriptElement.cpp:
2301 (WebCore::HTMLScriptElement::setText):
2302 * html/HTMLTitleElement.cpp:
2303 (WebCore::HTMLTitleElement::setText):
2305 2016-01-19 Ryosuke Niwa <rniwa@webkit.org>
2307 innerHTML should always add a mutation record for removing all children
2308 https://bugs.webkit.org/show_bug.cgi?id=148782
2309 <rdar://problem/22571962>
2311 Reviewed by Antti Koivisto.
2313 Fixed the bug by disabling WebKit's optimization to avoid the node replacement when the behavior
2314 is observable to scripts by either:
2315 - Author scripts has a reference to the node
2316 - MutationObserver can be observing this subtree
2317 - Mutation events can be observing this subtree
2319 Note that no caller of this function exposes fragment to author scripts so it couldn't be referenced.
2320 It also means that we don't need to check DOMNodeInsertedIntoDocument since it doesn't bubble up
2321 (it's only relevant if the text node in fragment has its event listener but that's impossible).
2323 Test: fast/dom/innerHTML-single-text-node.html
2325 * dom/ChildListMutationScope.h:
2326 (WebCore::ChildListMutationScope::canObserve): Added.
2328 * editing/markup.cpp:
2329 (WebCore::hasMutationEventListeners): Added.
2330 (WebCore::replaceChildrenWithFragment):
2332 2016-01-18 Ryosuke Niwa <rniwa@webkit.org>
2334 createAttribute should lowercase the attribute name in a HTML document
2335 https://bugs.webkit.org/show_bug.cgi?id=153112
2337 Reviewed by Darin Adler.
2339 In a HTML document, we should always lowercase localName in document.createAttribute as specified in
2340 https://dom.spec.whatwg.org/#dom-document-createattribute:
2342 1. If localName does not match the Name production in XML, throw an InvalidCharacterError exception.
2343 2. If the context object is an HTML document, let localName be converted to ASCII lowercase.
2344 3. Return a new attribute whose local name is localName.
2346 Change WebKit's behavior to match the spec as well as Firefox. document.createAttributeNS will
2347 continue to preserve the case as spec'ed.
2349 No new tests are added since the behavior change is covered by existing tests.
2352 (WebCore::Document::createAttribute):
2354 2016-01-18 Brady Eidson <beidson@apple.com>
2356 Modern IDB: Add private-browsing variant for many IDB tests, and enable private browsing in Modern IDB.
2357 https://bugs.webkit.org/show_bug.cgi?id=153179
2359 Reviewed by Darin Adler.
2361 Tests: Many private-browsing copies of existing IDB tests.
2363 * Modules/indexeddb/client/IDBFactoryImpl.cpp:
2364 (WebCore::IDBClient::shouldThrowSecurityException): Allow IDB access in private browsing.
2366 2016-01-18 Eric Carlson <eric.carlson@apple.com>
2368 [iOS Simulator WK1] ASSERT loading Blink layout test imported/web-platform-tests/mediacapture-streams/stream-api/mediastream/mediastream-idl.html
2369 https://bugs.webkit.org/show_bug.cgi?id=153070
2370 <rdar://problem/24183105>
2372 Reviewed by Darin Adler.
2374 No new tests, this prevents an existing test from crashing.
2376 * platform/mock/MockRealtimeVideoSource.cpp:
2377 (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Create the timer with RunLoop::current
2378 instead of RunLoop::main.
2380 2016-01-18 Gyuyoung Kim <gyuyoung.kim@webkit.org>
2382 Reduce PassRefPtr uses in dom - 3
2383 https://bugs.webkit.org/show_bug.cgi?id=153055
2385 Reviewed by Darin Adler.
2387 Third patch to reduce uses of PassRefPtr in WebCore/dom.
2389 * dom/MutationObserverInterestGroup.cpp:
2390 (WebCore::MutationObserverInterestGroup::enqueueMutationRecord):
2391 * dom/MutationRecord.cpp:
2392 (WebCore::MutationRecord::createChildList):
2393 (WebCore::MutationRecord::createAttributes):
2394 (WebCore::MutationRecord::createCharacterData):
2395 (WebCore::MutationRecord::createWithNullOldValue):
2396 * dom/MutationRecord.h:
2397 * dom/NamedFlowCollection.cpp:
2398 (WebCore::NamedFlowCollection::createCSSOMSnapshot):
2399 * dom/NamedFlowCollection.h:
2400 * dom/PendingScript.cpp:
2401 (WebCore::PendingScript::releaseElementAndClear):
2402 * dom/PendingScript.h:
2403 * dom/ScriptRunner.h:
2404 * dom/SecurityContext.h:
2405 * dom/ShadowRoot.cpp:
2406 (WebCore::ShadowRoot::cloneNode):
2408 * dom/SpaceSplitString.cpp:
2409 (WebCore::SpaceSplitStringData::create):
2410 * dom/SpaceSplitString.h:
2411 * dom/TreeWalker.cpp:
2412 (WebCore::TreeWalker::setCurrent):
2413 (WebCore::TreeWalker::parentNode):
2414 (WebCore::TreeWalker::previousNode):
2415 (WebCore::TreeWalker::nextNode):
2417 * dom/default/PlatformMessagePortChannel.cpp:
2418 (WebCore::PlatformMessagePortChannel::entangledChannel):
2419 * dom/default/PlatformMessagePortChannel.h:
2421 2016-01-18 Nan Wang <n_wang@apple.com>
2423 AX: [Mac] Implement next/previous text marker functions using TextIterator
2424 https://bugs.webkit.org/show_bug.cgi?id=152728
2426 Reviewed by Chris Fleizach.
2428 The existing AXTextMarker based calls are implemented using visible position, and that introduced
2429 some bugs which make VoiceOver working incorrectly on Mac sometimes. Since TextIterator uses rendering
2430 position, we tried to use it to refactor those AXTextMarker based calls.
2431 In this patch, I implemented functions to navigate to previous/next text marker using Range and TextIterator.
2432 Also added a conversion between visible position and character offset to make sure unconverted text marker
2433 related functions are still working correctly.
2435 Tests: accessibility/mac/previous-next-text-marker.html
2436 accessibility/mac/text-marker-with-user-select-none.html
2438 * accessibility/AXObjectCache.cpp:
2439 (WebCore::AXObjectCache::visiblePositionForTextMarkerData):
2440 (WebCore::AXObjectCache::traverseToOffsetInRange):
2441 (WebCore::AXObjectCache::lengthForRange):
2442 (WebCore::AXObjectCache::rangeForNodeContents):
2443 (WebCore::characterOffsetsInOrder):
2444 (WebCore::AXObjectCache::rangeForUnorderedCharacterOffsets):
2445 (WebCore::AXObjectCache::setTextMarkerDataWithCharacterOffset):
2446 (WebCore::AXObjectCache::startOrEndTextMarkerDataForRange):
2447 (WebCore::AXObjectCache::textMarkerDataForCharacterOffset):
2448 (WebCore::AXObjectCache::nextNode):
2449 (WebCore::AXObjectCache::previousNode):
2450 (WebCore::AXObjectCache::visiblePositionFromCharacterOffset):
2451 (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
2452 (WebCore::AXObjectCache::accessibilityObjectForTextMarkerData):
2453 (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
2454 * accessibility/AXObjectCache.h:
2455 (WebCore::CharacterOffset::CharacterOffset):
2456 (WebCore::CharacterOffset::remaining):
2457 (WebCore::CharacterOffset::isNull):
2458 (WebCore::AXObjectCache::setNodeInUse):
2459 (WebCore::AXObjectCache::removeNodeForUse):
2460 (WebCore::AXObjectCache::isNodeInUse):
2461 * accessibility/AccessibilityObject.cpp:
2462 (WebCore::AccessibilityObject::selectionRange):
2463 (WebCore::AccessibilityObject::elementRange):
2464 (WebCore::AccessibilityObject::selectText):
2465 (WebCore::AccessibilityObject::lineRangeForPosition):
2466 (WebCore::AccessibilityObject::replacedNodeNeedsCharacter):
2467 (WebCore::renderListItemContainerForNode):
2468 (WebCore::listMarkerTextForNode):
2469 (WebCore::AccessibilityObject::listMarkerTextForNodeAndPosition):
2470 (WebCore::AccessibilityObject::stringForRange):
2471 (WebCore::AccessibilityObject::stringForVisiblePositionRange):
2472 (WebCore::replacedNodeNeedsCharacter): Deleted.
2473 * accessibility/AccessibilityObject.h:
2474 (WebCore::AccessibilityObject::visiblePositionRange):
2475 (WebCore::AccessibilityObject::visiblePositionRangeForLine):
2476 (WebCore::AccessibilityObject::boundsForVisiblePositionRange):
2477 (WebCore::AccessibilityObject::setSelectedVisiblePositionRange):
2478 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2479 (isTextMarkerIgnored):
2480 (-[WebAccessibilityObjectWrapper accessibilityObjectForTextMarker:]):
2481 (accessibilityObjectForTextMarker):
2482 (-[WebAccessibilityObjectWrapper textMarkerRangeFromRange:]):
2483 (textMarkerRangeFromRange):
2484 (-[WebAccessibilityObjectWrapper startOrEndTextMarkerForRange:isStart:]):
2485 (startOrEndTextmarkerForRange):
2486 (-[WebAccessibilityObjectWrapper nextTextMarkerForNode:offset:]):
2487 (-[WebAccessibilityObjectWrapper previousTextMarkerForNode:offset:]):
2488 (-[WebAccessibilityObjectWrapper textMarkerForNode:offset:]):
2489 (textMarkerForCharacterOffset):
2490 (-[WebAccessibilityObjectWrapper rangeForTextMarkerRange:]):
2491 (-[WebAccessibilityObjectWrapper characterOffsetForTextMarker:]):
2492 (textMarkerForVisiblePosition):
2493 (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
2495 2016-01-18 Olivier Blin <olivier.blin@softathome.com>
2497 [Mac] Remove unused playerToPrivateMap()
2498 https://bugs.webkit.org/show_bug.cgi?id=153203
2500 Reviewed by Darin Adler.
2502 This was used in previous EME implementations, but is unnecessary
2505 No new tests since this removes dead code only.
2507 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2508 (WebCore::globalLoaderDelegateQueue): Deleted.
2509 (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC): Deleted.
2511 2016-01-18 Simon Fraser <simon.fraser@apple.com>
2513 Add TextStream-based logging for Position and VisiblePosition
2514 https://bugs.webkit.org/show_bug.cgi?id=153195
2516 Reviewed by Ryosuke Niwa.
2518 Make it easy to dump Positions and VisiblePositions with a TextStream.
2521 (WebCore::operator<<):
2523 * editing/VisiblePosition.cpp:
2524 (WebCore::operator<<):
2525 * editing/VisiblePosition.h:
2527 2016-01-18 Zan Dobersek <zdobersek@igalia.com>
2529 Sink the Vector<uint8_t> buffer into the SerializedScriptValue constructor
2530 https://bugs.webkit.org/show_bug.cgi?id=142634
2532 Reviewed by Darin Adler.
2534 Have the SerializedScriptValue constructor take in the Vector<uint8_t> buffer
2535 through an rvalue reference, avoiding the copying into the m_data member. The
2536 three-parameter constructor now takes in the Vector<String> blob URL object
2537 via const reference, and the std::unique_ptr<> object via a rvalue reference.
2539 Adjust all the call sites and affected code to now either move or copy a
2540 non-movable object into the SerializedScriptValue constructor or the helper
2543 No new tests -- no change in behavior.
2545 * bindings/js/IDBBindingUtilities.cpp:
2546 (WebCore::deserializeIDBValueDataToJSValue):
2547 (WebCore::deserializeIDBValueBuffer):
2548 (WebCore::idbValueDataToJSValue):
2549 * bindings/js/IDBBindingUtilities.h:
2550 * bindings/js/SerializedScriptValue.cpp:
2551 (WebCore::SerializedScriptValue::SerializedScriptValue):
2552 (WebCore::SerializedScriptValue::create):
2553 (WebCore::SerializedScriptValue::numberValue):
2554 (WebCore::SerializedScriptValue::undefinedValue):
2555 (WebCore::SerializedScriptValue::nullValue):
2556 * bindings/js/SerializedScriptValue.h:
2557 * testing/Internals.cpp:
2558 (WebCore::Internals::deserializeBuffer):
2560 2016-01-18 Olivier Blin <olivier.blin@softathome.com>
2562 [GStreamer] Remove unused m_endTime
2563 https://bugs.webkit.org/show_bug.cgi?id=153209
2565 Reviewed by Michael Catanzaro.
2567 m_endTime has been unused since r47710 in MediaPlayerPrivateGStreamer.
2569 No new tests since this is just a member cleanup.
2571 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2572 (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): Deleted.
2573 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2575 2016-01-18 Csaba Osztrogonác <ossy@webkit.org>
2577 Fix the --minimal build due to missing VM.h include
2578 https://bugs.webkit.org/show_bug.cgi?id=153128
2580 Reviewed by Michael Catanzaro.
2582 * bindings/js/WebCoreJSBuiltinInternals.h:
2584 2016-01-18 Csaba Osztrogonác <ossy@webkit.org>
2586 Remove the SKIP_UNUSED_PARAM define
2587 https://bugs.webkit.org/show_bug.cgi?id=153129
2589 Reviewed by Michael Catanzaro.
2591 * bindings/js/WebCoreJSBuiltinInternals.cpp:
2592 (WebCore::JSBuiltinInternalFunctions::visit):
2593 (WebCore::JSBuiltinInternalFunctions::initialize):
2594 * bindings/js/WebCoreJSBuiltinInternals.h:
2596 2016-01-17 Simon Fraser <simon.fraser@apple.com>
2598 More displaylist tests, and minor cleanup
2599 https://bugs.webkit.org/show_bug.cgi?id=153198
2601 Reviewed by Zalan Bujtas.
2603 Have the DisplayListRecorder's constructor push the recorder onto the GraphicsContext,
2604 and remove that code from GraphicsLayerCA.
2606 Tests: displaylists/extent-includes-shadow.html
2607 displaylists/extent-includes-transforms.html
2609 * platform/graphics/ca/GraphicsLayerCA.cpp:
2610 (WebCore::GraphicsLayerCA::recursiveCommitChanges):
2611 * platform/graphics/displaylists/DisplayListRecorder.cpp:
2612 (WebCore::DisplayList::Recorder::Recorder):
2614 2016-01-16 Myles C. Maxfield <mmaxfield@apple.com>
2616 Remove TextRun::allowsRoundingHacks()
2617 https://bugs.webkit.org/show_bug.cgi?id=153185
2619 Reviewed by Simon Fraser.
2621 Rounding hacks are disallowed by default, and are only re-enabled on iOS 4 and
2622 earlier, which are not supported OSes. Because they are disallowed on all
2623 supported configurations, remove support for them wholesale.
2627 * html/canvas/CanvasRenderingContext2D.cpp:
2628 (WebCore::CanvasRenderingContext2D::drawTextInternal):
2629 * platform/graphics/FontCascade.cpp:
2630 * platform/graphics/FontCascade.h:
2631 (WebCore::FontCascade::isRoundingHackCharacter): Deleted.
2632 * platform/graphics/StringTruncator.cpp:
2633 (WebCore::stringWidth):
2634 (WebCore::truncateString):
2635 (WebCore::StringTruncator::centerTruncate):
2636 (WebCore::StringTruncator::rightTruncate):
2637 (WebCore::StringTruncator::width):
2638 (WebCore::StringTruncator::leftTruncate):
2639 (WebCore::StringTruncator::rightClipToCharacter):
2640 (WebCore::StringTruncator::rightClipToWord):
2641 * platform/graphics/StringTruncator.h:
2642 * platform/graphics/TextRun.cpp:
2643 (WebCore::TextRun::setAllowsRoundingHacks): Deleted.
2644 (WebCore::TextRun::allowsRoundingHacks): Deleted.
2645 * platform/graphics/TextRun.h:
2646 (WebCore::TextRun::TextRun):
2647 (WebCore::TextRun::applyRunRounding): Deleted.
2648 (WebCore::TextRun::applyWordRounding): Deleted.
2649 (WebCore::TextRun::disableRoundingHacks): Deleted.
2650 * platform/graphics/WidthIterator.cpp:
2651 (WebCore::WidthIterator::advanceInternal):
2652 * platform/graphics/mac/ComplexTextController.cpp:
2653 (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
2654 * platform/mac/DragImageMac.mm:
2655 (WebCore::widthWithFont): Deleted.
2656 (WebCore::drawAtPoint): Deleted.
2657 * rendering/RenderFileUploadControl.cpp:
2658 (WebCore::RenderFileUploadControl::fileTextValue):
2659 (WebCore::RenderFileUploadControl::paintObject): Deleted.
2660 * rendering/RenderListBox.cpp:
2661 (WebCore::RenderListBox::paintItemForeground):
2662 (WebCore::RenderListBox::updateFromElement): Deleted.
2663 * rendering/RenderTextControl.cpp:
2664 (WebCore::RenderTextControl::getAverageCharWidth): Deleted.
2665 * rendering/RenderTheme.cpp:
2666 (WebCore::RenderTheme::fileListNameForWidth):
2667 * rendering/RenderThemeMac.mm:
2668 (WebCore::RenderThemeMac::fileListNameForWidth):
2669 * rendering/svg/SVGInlineTextBox.cpp:
2670 (WebCore::SVGInlineTextBox::constructTextRun): Deleted.
2671 * rendering/svg/SVGTextMetrics.cpp:
2672 (WebCore::SVGTextMetrics::constructTextRun): Deleted.
2673 * testing/Internals.cpp:
2674 (WebCore::Internals::resetToConsistentState): Deleted.
2675 (WebCore::Internals::allowRoundingHacks): Deleted.
2676 * testing/Internals.h:
2677 * testing/Internals.idl:
2679 2016-01-16 Andreas Kling <akling@apple.com>
2681 Allocate style sheet media queries in BumpArena.
2682 <https://webkit.org/b/153188>
2684 Reviewed by Antti Koivisto.
2686 Teach the CSS parser to allocate MediaQuery and MediaQueryExp from BumpArena as well.
2688 * css/CSSGrammar.y.in:
2690 * css/MediaQueryExp.h:
2692 2016-01-16 Michael Catanzaro <mcatanzaro@igalia.com>
2694 [GTK] Add a couple comments to ScrollbarThemeGtk
2695 https://bugs.webkit.org/show_bug.cgi?id=153184
2697 Reviewed by Carlos Garcia Campos.
2699 * platform/gtk/ScrollbarThemeGtk.cpp:
2700 (WebCore::ScrollbarThemeGtk::paint):
2702 2016-01-16 Andreas Kling <akling@apple.com>
2704 Give RuleSet a BumpArena and start using it for RuleDataVectors.
2705 <https://webkit.org/b/153169>
2707 Reviewed by Antti Koivisto.
2709 Since RuleSet only supports appending rules and doesn't need to worry about removing them,
2710 it's a great candidate for BumpArena optimizations.
2712 Give each RuleSet its own BumpArena and teach them how to allocate RuleDataVector objects
2715 There are more things that can be done here, ideally all the sub-allocations inside RuleSet
2716 that happen via e.g Vector and HashMap would also come out of the BumpArena.
2719 (WebCore::RuleSet::RuleSet):
2720 (WebCore::RuleSet::addToRuleSet):
2721 (WebCore::RuleSet::copyShadowPseudoElementRulesFrom):
2723 (WebCore::RuleSet::RuleDataVector::create):
2724 (WebCore::RuleSet::RuleSet): Deleted.
2726 2016-01-16 Simon Fraser <simon.fraser@apple.com>
2728 Fix flakiness of displaylists/layer-dispay-list.html
2730 When toggling "uses display list drawing" on a GraphicsLayerCA, do
2733 * platform/graphics/ca/GraphicsLayerCA.cpp:
2734 (WebCore::GraphicsLayerCA::setUsesDisplayListDrawing):
2736 2016-01-15 Simon Fraser <simon.fraser@apple.com>
2738 Remove GraphicsContext::drawConvexPolygon() and GraphicsContext::clipConvexPolygon()
2739 https://bugs.webkit.org/show_bug.cgi?id=153174
2741 Reviewed by Zalan Bujtas.
2743 GraphicsContext::drawConvexPolygon() and GraphicsContext::clipConvexPolygon() were
2744 poorly named (non-convex polygons are allowed), and just syntactic sugar over
2745 clipPath() and drawPath().
2747 Remove them, but add a convenience function to create a Path from a Vector of
2748 points. For CG, we can use the more efficient CGPathAddLines().
2750 Add TextStream dumping for Path.
2752 * platform/graphics/GraphicsContext.h:
2753 * platform/graphics/Path.cpp:
2754 (WebCore::Path::polygonPathFromPoints):
2755 (WebCore::Path::dump):
2756 (WebCore::operator<<):
2757 * platform/graphics/Path.h:
2758 * platform/graphics/cairo/GraphicsContextCairo.cpp:
2759 (WebCore::GraphicsContext::setPlatformShouldAntialias):
2760 (WebCore::addConvexPolygonToContext): Deleted.
2761 (WebCore::GraphicsContext::drawConvexPolygon): Deleted.
2762 (WebCore::GraphicsContext::clipConvexPolygon): Deleted.
2763 * platform/graphics/cg/GraphicsContextCG.cpp:
2764 (WebCore::addConvexPolygonToPath): Deleted.
2765 (WebCore::GraphicsContext::drawConvexPolygon): Deleted.
2766 (WebCore::GraphicsContext::clipConvexPolygon): Deleted.
2767 * platform/graphics/cg/PathCG.cpp:
2768 (WebCore::Path::polygonPathFromPoints):
2769 (WebCore::Path::moveTo):
2770 (WebCore::Path::addLineTo):
2771 (WebCore::Path::addQuadCurveTo):
2772 (WebCore::Path::addBezierCurveTo):
2773 (WebCore::Path::addArcTo):
2774 * platform/graphics/displaylists/DisplayListItems.cpp:
2775 (WebCore::DisplayList::Item::sizeInBytes): Deleted.
2776 (WebCore::DisplayList::ClipConvexPolygon::ClipConvexPolygon): Deleted.
2777 (WebCore::DisplayList::ClipConvexPolygon::apply): Deleted.
2778 (WebCore::DisplayList::operator<<): Deleted.
2779 (WebCore::DisplayList::addConvexPolygonToPath): Deleted.
2780 (WebCore::DisplayList::DrawConvexPolygon::DrawConvexPolygon): Deleted.
2781 (WebCore::DisplayList::DrawConvexPolygon::localBounds): Deleted.
2782 (WebCore::DisplayList::DrawConvexPolygon::apply): Deleted.
2783 * platform/graphics/displaylists/DisplayListItems.h:
2784 (WebCore::DisplayList::ClipConvexPolygon::create): Deleted.
2785 (WebCore::DisplayList::ClipConvexPolygon::points): Deleted.
2786 (WebCore::DisplayList::ClipConvexPolygon::antialias): Deleted.
2787 (WebCore::DisplayList::DrawConvexPolygon::create): Deleted.
2788 (WebCore::DisplayList::DrawConvexPolygon::points): Deleted.
2789 (WebCore::DisplayList::DrawConvexPolygon::antialiased): Deleted.
2790 * platform/graphics/displaylists/DisplayListRecorder.cpp:
2791 (WebCore::DisplayList::Recorder::drawConvexPolygon): Deleted.
2792 (WebCore::DisplayList::Recorder::clipConvexPolygon): Deleted.
2793 * platform/graphics/displaylists/DisplayListRecorder.h:
2794 * rendering/RenderBoxModelObject.cpp:
2795 (WebCore::RenderBoxModelObject::clipBorderSidePolygon):
2796 * rendering/RenderElement.cpp:
2797 (WebCore::RenderElement::drawLineForBoxSide):
2798 * rendering/RenderThemeIOS.mm:
2799 (WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
2800 * rendering/RenderThemeMac.mm:
2801 (WebCore::RenderThemeMac::paintMenuListButtonDecorations):
2803 2016-01-16 Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2805 Add Platform.cpp to ANGLESupport
2807 https://bugs.webkit.org/show_bug.cgi?id=153120
2809 Reviewed by Darin Adler.
2811 No new tests, only addresses a build failure.
2815 2016-01-16 Carlos Garcia Campos <cgarcia@igalia.com>
2817 [GTK] List box selections stopped working again with GTK+ from current git master
2818 https://bugs.webkit.org/show_bug.cgi?id=153122
2820 Reviewed by Michael Catanzaro.
2822 The problem is that the ListBox selection implementation is
2823 wrong. We are using a similar implementation to GtkEntry, but
2824 GtkTreeView doesn't have a child CSS node for selections.
2826 * rendering/RenderThemeGtk.cpp:
2827 (WebCore::styleColor): Don't use a child style context for ListBox selections.
2828 (WebCore::createStyleContext): Remove ListBoxSelection.
2830 2016-01-14 Carlos Garcia Campos <cgarcia@igalia.com>
2832 [SOUP] Initialize HTTP version of ResourceResponse
2833 https://bugs.webkit.org/show_bug.cgi?id=153088
2835 Reviewed by Michael Catanzaro.
2837 * platform/network/soup/ResourceResponseSoup.cpp:
2838 (WebCore::ResourceResponse::updateFromSoupMessage):
2840 2016-01-16 Myles C. Maxfield <mmaxfield@apple.com>
2842 Tiny cleanup in FontFaceComparator
2843 https://bugs.webkit.org/show_bug.cgi?id=153044
2845 Reviewed by Zalan Bujtas.
2847 This is a follow-up patch to r194923.
2849 No new tests because there is no behavior change.
2851 * css/CSSFontSelector.cpp:
2852 (WebCore::FontFaceComparator::FontFaceComparator):
2853 (WebCore::FontFaceComparator::operator()):
2855 2016-01-15 Jiewen Tan <jiewen_tan@apple.com>
2857 FrameLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame() is never called when loading a main resource from the memory cache
2858 https://bugs.webkit.org/show_bug.cgi?id=152520
2859 <rdar://problem/23305737>
2861 Reviewed by Andy Estes.
2863 Test: http/tests/loading/server-redirect-for-provisional-load-caching.html
2865 * loader/DocumentLoader.cpp:
2866 (WebCore::DocumentLoader::responseReceived):
2867 Dispatch message to notify client that a cached resource was redirected. So,
2868 client can make proper actions to treat server side redirection.
2869 * loader/cache/CachedRawResource.h:
2870 Add a method to tell whether the cached resource was redirected.
2872 2016-01-15 Chris Dumez <cdumez@apple.com>
2874 Drop obsolete HTMLDocument.width / height attributes
2875 https://bugs.webkit.org/show_bug.cgi?id=153144
2877 Reviewed by Ryosuke Niwa.
2879 Drop obsolete HTMLDocument.width / height attributes as these are
2880 obsolete and already not supported by other major browsers (tested
2881 Firefox and Chrome).
2883 No new tests, already covered by existing tests.
2885 * html/HTMLDocument.idl:
2887 2016-01-15 Chris Dumez <cdumez@apple.com>
2889 Drop obsolete DocumentType.entities / notations
2890 https://bugs.webkit.org/show_bug.cgi?id=153147
2892 Reviewed by Ryosuke Niwa.
2894 Drop obsolete DocumentType.entities / notations attributes.
2896 Firefox and Chrome already dropped those. We already dropped support for
2897 entities and notations so these always returned null.
2899 No new tests, already covered by existing tests.
2901 * dom/DocumentType.h:
2902 * dom/DocumentType.idl:
2904 2016-01-10 Simon Fraser <simon.fraser@apple.com>
2906 Make a way to test display-list drawing
2907 https://bugs.webkit.org/show_bug.cgi?id=152956
2909 Reviewed by Ryosuke Niwa.
2911 Make it possible to toggle display-list drawing for a given compositing
2912 layer via internals, as well as getting a textual representation of the display
2913 list, optionally including items with platform-specific behavior.
2915 Add one test that uses this.
2917 Test: displaylists/layer-dispay-list.html
2919 * platform/graphics/GraphicsLayer.h:
2920 (WebCore::GraphicsLayer::displayListAsText):
2921 * platform/graphics/ca/GraphicsLayerCA.cpp:
2922 (WebCore::GraphicsLayerCA::displayListAsText):
2923 * platform/graphics/ca/GraphicsLayerCA.h:
2924 * platform/graphics/displaylists/DisplayList.cpp:
2925 (WebCore::DisplayList::DisplayList::shouldDumpForFlags):
2926 (WebCore::DisplayList::DisplayList::asText):
2927 * platform/graphics/displaylists/DisplayList.h:
2928 * rendering/RenderLayerBacking.cpp:
2929 (WebCore::RenderLayerBacking::setUsesDisplayListDrawing):
2930 (WebCore::RenderLayerBacking::displayListAsText):
2931 * rendering/RenderLayerBacking.h:
2932 * testing/Internals.cpp:
2933 (WebCore::Internals::setElementUsesDisplayListDrawing):
2934 (WebCore::Internals::displayListForElement):
2935 * testing/Internals.h:
2936 * testing/Internals.idl:
2938 2016-01-15 Olivier Blin <olivier.blin@softathome.com>
2940 Fix audio build with video disabled
2941 https://bugs.webkit.org/show_bug.cgi?id=153134
2943 Reviewed by Michael Catanzaro.
2945 Build fails when WebAudio is enabled but VIDEO disabled.
2947 No new tests since this is a build fix only.
2949 * platform/audio/PlatformMediaSession.cpp:
2950 * platform/audio/PlatformMediaSession.h:
2951 * platform/audio/PlatformMediaSessionManager.cpp:
2952 * testing/Internals.cpp:
2953 (WebCore::Internals::setAudioContextRestrictions):
2955 2016-01-15 Olivier Blin <olivier.blin@softathome.com>
2957 [GTK] Fix build of RenderThemeGtk without VIDEO by including HTMLInputElement
2958 https://bugs.webkit.org/show_bug.cgi?id=153133
2960 Reviewed by Michael Catanzaro.
2962 Build was fine with VIDEO enabled, since HTMLInputElement.h was
2963 included by transitivity through MediaControlElements.h and
2964 MediaControlElementTypes.h.
2966 This seems to be broken since r194847.
2968 No new tests since this is just a build fix.
2970 * rendering/RenderThemeGtk.cpp:
2972 2016-01-15 Ryosuke Niwa <rniwa@webkit.org>
2974 createElementNS and createAttributeNS should treat undefined namespaceURI as null string
2975 https://bugs.webkit.org/show_bug.cgi?id=153119
2977 Reviewed by Chris Dumez.
2979 Treat undefined as null in document.createElementNS and document.createAttributeNS as defined in:
2980 https://dom.spec.whatwg.org/#document
2982 Test: fast/dom/Document/createAttributeNS-undefined-namespace.html
2986 2016-01-15 Myles C. Maxfield <mmaxfield@apple.com>
2988 [Cocoa] Font features are not applied to the system font
2989 https://bugs.webkit.org/show_bug.cgi?id=153053
2991 Reviewed by Dean Jackson.
2993 We simply need to call preparePlatformFont() on it.
2995 Test: fast/text/system-font-features.html
2997 * platform/graphics/cocoa/FontCacheCoreText.cpp:
2998 (WebCore::fontWithFamily):
3000 2016-01-15 Tim Horton <timothy_horton@apple.com>
3002 Data detector yellow highlight location is vertically mirrored in WebKit1
3003 https://bugs.webkit.org/show_bug.cgi?id=152216
3004 <rdar://problem/23848003>
3006 Reviewed by Beth Dakin.
3008 No new tests, because we currently have no decent mechanism for testing
3009 where TextIndicator/Lookup/DataDetectors actually make it to the screen,
3010 nor for synthetic force-click in WebKit1.
3012 * editing/mac/DictionaryLookup.h:
3013 * editing/mac/DictionaryLookup.mm:
3014 (WebCore::showPopupOrCreateAnimationController):
3015 (WebCore::DictionaryLookup::showPopup):
3016 (WebCore::DictionaryLookup::animationControllerForPopup):
3017 Add an optional function for converting between root-FrameView and
3018 handed-in-NSView coordinates, and use it to convert textBoundingRectInRootViewCoordinates
3019 into the coordinates of the WebView.
3021 2016-01-15 Joseph Pecoraro <pecoraro@apple.com>
3023 Media Query (-webkit-video-playable-inline) is failing as an invalid media query expression
3024 https://bugs.webkit.org/show_bug.cgi?id=153111
3026 Reviewed by Dean Jackson.
3028 Test: fast/media/video-playable-inline-media-query.html
3030 * css/MediaQueryEvaluator.cpp:
3031 (WebCore::video_playable_inlineMediaFeatureEval):
3032 (WebCore::isRunningOnIPhoneOrIPod): Deleted.
3033 Make the media query work regardless of the platform.
3034 It should just check the web view's settings.
3036 * css/MediaQueryExp.cpp:
3037 (WebCore::featureWithoutValue):
3038 This media query expects no value, include it in the list
3039 so it is not treated as invalid.
3041 2016-01-15 Zalan Bujtas <zalan@apple.com>
3043 ASSERTION FAILED: canHaveChildren() || canHaveGeneratedChildren() in WebCore::RenderElement::insertChildInternal
3044 https://bugs.webkit.org/show_bug.cgi?id=123331
3046 Reviewed by Darin Adler.
3048 Do not set named flow fragment bit on the flow until after the renderer is attached. Setting/resetting it too early
3049 could affect the attach/detach process itself (This is similar to attaching a multi column flow thread).
3051 Test: fast/regions/input-box-with-region-assert.html
3053 * rendering/RenderBlockFlow.cpp:
3054 (WebCore::RenderBlockFlow::willBeDestroyed):
3055 (WebCore::RenderBlockFlow::createRenderNamedFlowFragmentIfNeeded):
3056 (WebCore::RenderBlockFlow::setRenderNamedFlowFragment):
3058 2016-01-15 Simon Fraser <simon.fraser@apple.com>
3060 Add kdebug_trace signposts for a few WebCore operations
3061 https://bugs.webkit.org/show_bug.cgi?id=153136
3062 rdar://problem/24208487
3064 Reviewed by Sam Weinig.
3066 Add trace points for style recalc, layout, view painting and layer painting.
3069 (WebCore::Document::recalcStyle):
3070 * page/FrameView.cpp:
3071 (WebCore::FrameView::layout):
3072 (WebCore::FrameView::paintContents):
3073 * platform/graphics/ca/GraphicsLayerCA.cpp:
3074 (WebCore::GraphicsLayerCA::platformCALayerPaintContents):
3076 2016-01-15 Andreas Kling <akling@apple.com>
3078 Use BumpArena for style sheet object tree.
3079 <https://webkit.org/b/152696>
3081 Reviewed by Antti Koivisto.
3083 Give each StyleSheetContents its own BumpArena, and plumb it down through CSSParser
3084 to allocate StyleRule, StyleProperties and CSSSelectorList's selector arrays there.
3086 This basically means that most objects that make up a given style sheet will end up
3087 in one (or a few) contiguous region(s) of memory, instead of being scattered all
3088 over the malloc heap.
3090 In the common case (no CSSOM manipulation), the lifetimes of these objects are very
3091 predictable: everything tends to die when the StyleSheetContents dies.
3092 This dramatically improves space-efficiency in those cases, and allows us to return
3093 contiguous chunks of memory to the system once a style sheet is no longer needed.
3095 One-off CSS parses that don't work within a StyleSheetContents context will have
3096 their StyleRules & co allocated through FastMalloc just like before.
3098 Bonus: give SelectorQueryCache a dedicated BumpArena as well, since it has very
3099 predictable lifetime.
3101 * css/CSSGrammar.y.in:
3102 * css/CSSKeyframesRule.h:
3103 (WebCore::StyleRuleKeyframes::create):
3104 * css/CSSParser.cpp:
3105 (WebCore::CSSParser::createStyleProperties):
3106 (WebCore::CSSParser::createMediaRule):
3107 (WebCore::CSSParser::createSupportsRule):
3108 (WebCore::CSSParser::createKeyframesRule):
3109 (WebCore::CSSParser::setArena):
3110 (WebCore::CSSParser::arena):
3111 (WebCore::CSSParser::createStyleRule):
3112 (WebCore::CSSParser::createFontFaceRule):
3113 (WebCore::CSSParser::createPageRule):
3114 (WebCore::CSSParser::createRegionRule):
3115 (WebCore::CSSParser::createViewportRule):
3117 * css/CSSParserValues.cpp:
3118 (WebCore::CSSParserSelector::parsePseudoElementCueFunctionSelector):
3119 (WebCore::CSSParserSelector::adoptSelectorVector):
3120 * css/CSSParserValues.h:
3121 * css/CSSSelectorList.cpp:
3122 (WebCore::CSSSelectorList::CSSSelectorList):
3123 (WebCore::CSSSelectorList::adoptSelectorVector):
3124 (WebCore::CSSSelectorList::deleteSelectors):
3125 * css/CSSSelectorList.h:
3126 * css/StyleProperties.cpp:
3127 (WebCore::ImmutableStyleProperties::create):
3128 (WebCore::StyleProperties::immutableCopyIfNeeded):
3129 * css/StyleProperties.h:
3130 * css/StyleRule.cpp:
3131 (WebCore::StyleRule::create):
3132 (WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount):
3133 (WebCore::StyleRuleRegion::StyleRuleRegion):
3135 (WebCore::StyleRule::create):
3136 (WebCore::StyleRule::parserAdoptSelectorVector):
3137 (WebCore::StyleRuleFontFace::create):
3138 (WebCore::StyleRulePage::create):
3139 (WebCore::StyleRulePage::parserAdoptSelectorVector):
3140 (WebCore::StyleRuleMedia::create):
3141 (WebCore::StyleRuleSupports::create):
3142 (WebCore::StyleRuleRegion::create):
3143 (WebCore::StyleRuleViewport::create):
3144 * css/StyleSheetContents.cpp:
3145 (WebCore::StyleSheetContents::StyleSheetContents):
3146 (WebCore::StyleSheetContents::parseAuthorStyleSheet):
3147 (WebCore::StyleSheetContents::parseStringAtPosition):
3148 * css/StyleSheetContents.h:
3149 * dom/SelectorQuery.cpp:
3150 (WebCore::SelectorQueryCache::SelectorQueryCache):
3151 (WebCore::SelectorQueryCache::add):
3152 * dom/SelectorQuery.h:
3153 * svg/SVGFontFaceElement.cpp:
3154 (WebCore::SVGFontFaceElement::SVGFontFaceElement):
3156 2016-01-15 Dave Hyatt <hyatt@apple.com>
3158 Avoid downloading the wrong image for <picture> elements.
3159 https://bugs.webkit.org/show_bug.cgi?id=153027
3161 Reviewed by Dean Jackson.
3163 No tests, since they are always flaky.
3165 * html/HTMLImageElement.cpp:
3166 (WebCore::HTMLImageElement::HTMLImageElement):
3167 (WebCore::HTMLImageElement::~HTMLImageElement):
3168 (WebCore::HTMLImageElement::createForJSConstructor):
3169 (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
3170 (WebCore::HTMLImageElement::insertedInto):
3171 (WebCore::HTMLImageElement::removedFrom):
3172 (WebCore::HTMLImageElement::pictureElement):
3173 (WebCore::HTMLImageElement::setPictureElement):
3174 (WebCore::HTMLImageElement::width):
3175 * html/HTMLImageElement.h:
3176 (WebCore::HTMLImageElement::hasShadowControls):
3177 * html/HTMLPictureElement.h:
3178 * html/parser/HTMLConstructionSite.cpp:
3179 (WebCore::HTMLConstructionSite::createHTMLElement):
3180 * html/parser/HTMLPreloadScanner.cpp:
3181 (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
3183 Images that are built underneath a <picture> element are now connected
3184 to that picture element via a setPictureNode call from the parser. This
3185 ensures that the correct <source> elements are examined before checking the image.
3187 This connection between images and their picture owners is handled using a static
3188 HashMap in HTMLImageElement. This connection is made both from the parser and from
3189 DOM insertions, and the map is queried now instead of looking directly at the
3190 image's parentNode().
3192 2016-01-15 Youenn Fablet <youenn.fablet@crf.canon.fr>
3194 [Streams API] Expose ReadableStream and relatives to Worker
3195 https://bugs.webkit.org/show_bug.cgi?id=152066
3197 Reviewed by Darin Adler.
3199 Covered by rebased tests.
3201 * Modules/streams/ByteLengthQueuingStrategy.idl:
3202 * Modules/streams/CountQueuingStrategy.idl:
3203 * Modules/streams/ReadableStream.idl:
3204 * Modules/streams/ReadableStreamController.idl:
3205 * Modules/streams/ReadableStreamReader.idl:
3207 2016-01-15 Youenn Fablet <youenn.fablet@crf.canon.fr>
3209 CORS: Fix the handling of redirected request containing Origin null.
3210 https://bugs.webkit.org/show_bug.cgi?id=128816
3212 Reviewed by Brent Fulgham.
3214 Merging Blink patch from George Ancil (https://chromiumcodereview.appspot.com/20735002).
3216 This patch removes the check for securityOrigin->isUnique() in passesAccessControlCheck().
3217 This check prevented a redirected request with "Origin: null" from being
3218 successful even when the response contains "Access-Control-Allow-Origin: null"
3220 Tests: http/tests/xmlhttprequest/access-control-sandboxed-iframe-allow-origin-null.html
3221 http/tests/xmlhttprequest/redirect-cors-origin-null.html
3223 * loader/CrossOriginAccessControl.cpp:
3224 (WebCore::passesAccessControlCheck):
3226 2016-01-14 Commit Queue <commit-queue@webkit.org>
3228 Unreviewed, rolling out r195064.
3229 https://bugs.webkit.org/show_bug.cgi?id=153118
3231 test fails most of the time (Requested by alexchristensen on
3236 "Avoid downloading the wrong image for <picture> elements."
3237 https://bugs.webkit.org/show_bug.cgi?id=153027
3238 http://trac.webkit.org/changeset/195064
3240 2016-01-14 Ryosuke Niwa <rniwa@webkit.org>
3242 createElement should not lowercase non-ASCII characters
3243 https://bugs.webkit.org/show_bug.cgi?id=153114
3245 Reviewed by Alex Christensen.
3247 According to step 2 in https://dom.spec.whatwg.org/#dom-document-createelement, document.createElement should not
3248 lowercase non-ASCII letters, and this is also what Firefox does. Match that behavior by lowercasing the tag name
3249 by convertToASCIILowercase() instead of lower() in createElement.
3251 Also merged HTMLDocument::createElement into Document::createElement for simplicity and avoid duplicating
3252 the call to isValidName and setting a DOM exception.
3254 No new tests since the behavior change is covered by the existing W3C tests.
3257 (WebCore::Document::createElement): Create a HTML element with ASCII-lowercased tag name inside a HTML document.
3259 * html/HTMLDocument.cpp:
3260 (WebCore::addLocalNameToSet):
3261 (WebCore::HTMLDocument::createElement): Merged into Document::createElement.
3262 * html/HTMLDocument.h:
3264 2016-01-14 Brady Eidson <beidson@apple.com>
3266 Modern IDB: Support opening and deleting SQLite databases on disk.
3267 https://bugs.webkit.org/show_bug.cgi?id=153084
3269 Reviewed by Alex Christensen, Sam Weinig and Andy Estes (oh my!).
3271 No new tests (Infrastructure, no testable change in behavior).
3273 * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
3274 (WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot):
3275 * Modules/indexeddb/IDBDatabaseIdentifier.h:
3277 * Modules/indexeddb/server/IDBServer.cpp:
3278 (WebCore::IDBServer::IDBServer::create):
3279 (WebCore::IDBServer::IDBServer::IDBServer):
3280 (WebCore::IDBServer::IDBServer::createBackingStore):
3281 * Modules/indexeddb/server/IDBServer.h:
3283 * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3284 (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
3285 (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
3286 (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
3287 * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
3289 * Modules/indexeddb/shared/InProcessIDBServer.cpp:
3290 (WebCore::InProcessIDBServer::create):
3291 (WebCore::InProcessIDBServer::InProcessIDBServer):
3292 * Modules/indexeddb/shared/InProcessIDBServer.h:
3294 2016-01-14 Myles C. Maxfield <mmaxfield@apple.com>
3296 Mixing Content Blocking of fonts and display:none rules causes battery drain
3297 https://bugs.webkit.org/show_bug.cgi?id=153051
3298 <rdar://problem/23187709>
3300 Reviewed by Alex Christensen.
3302 If we have applied a rule before and we are not applying it again, don't
3303 resolve the style again.
3305 Test: http/tests/contentextensions/font-display-none-repeated-layout.html
3307 * contentextensions/ContentExtensionStyleSheet.cpp:
3308 (WebCore::ContentExtensions::ContentExtensionStyleSheet::addDisplayNoneSelector):
3309 * contentextensions/ContentExtensionStyleSheet.h:
3310 * dom/ExtensionStyleSheets.cpp:
3311 (WebCore::ExtensionStyleSheets::addDisplayNoneSelector):
3313 2016-01-14 Ryosuke Niwa <rniwa@webkit.org>
3315 Add document.defineCustomElement
3316 https://bugs.webkit.org/show_bug.cgi?id=153092
3318 Reviewed by Chris Dumez.
3320 Added document.defineCustomElement and added a constructor to HTMLElement which can be called
3321 as "super" in a subclass of HTMLElement. This is a prototype of new custom elements API and
3322 willfully violates the current specification at http://w3c.github.io/webcomponents/spec/custom/
3324 Each author defined class can define multiple elements using distinct tag names. In such cases,
3325 the super call must specify the tag name. e.g.
3327 class SomeCustomElement extends HTMLElement { constructor(name) { super(name); } }
3328 document.defineCustomElement('some-custom-element', SomeCustomElement);
3329 document.defineCustomElement('other-custom-element', SomeCustomElement);
3330 new SomeCustomElement('some-custom-element');
3332 When a class is associated with exactly one tag name, the argument can be omitted. e.g.
3334 class AnotherCustomElement extends HTMLElement {}
3335 document.defineCustomElement('another-custom-element', AnotherCustomElement);
3336 new AnotherCustomElement();
3338 We allow only subclassing of HTMLElement and only in (X)HTML namespace.
3340 Tests: fast/custom-elements/Document-defineCustomElement.html
3341 fast/custom-elements/HTMLElement-constructor.html
3344 * WebCore.xcodeproj/project.pbxproj:
3346 * bindings/js/JSCustomElementInterface.cpp: Added. Abstracts an author-defined class associated
3347 with a custom element. It's a Active DOM object and lives until the associated document dies.
3348 (WebCore::JSCustomElementInterface::JSCustomElementInterface):
3349 (WebCore::JSCustomElementInterface::~JSCustomElementInterface):
3350 * bindings/js/JSCustomElementInterface.h: Added.
3351 (WebCore::JSCustomElementInterface::create):
3352 (WebCore::JSCustomElementInterface::scriptExecutionContext):
3353 (WebCore::JSCustomElementInterface::constructor):
3355 * bindings/js/JSDocumentCustom.cpp:
3356 (WebCore::JSDocument::defineCustomElement): Added. Define a custom element by associating a tag
3357 name with an author defined JS class after validating arguments.
3359 * bindings/js/JSHTMLElementCustom.cpp:
3360 (WebCore::constructJSHTMLElement): Added. Look up the tag name based on new.target if one is not
3361 specified. If a tag name is specified, check that new.target is associated with the tag name.
3363 * dom/CustomElementDefinitions.cpp: Added.
3364 (WebCore::CustomElementDefinitions::checkName): Added. Restricts tag names similarly to
3365 http://w3c.github.io/webcomponents/spec/custom/#dfn-custom-element-type
3366 (WebCore::CustomElementDefinitions::defineElement): Added. Associates a JS class with a tag name.
3367 (WebCore::CustomElementDefinitions::findInterface): Added. Finds a JS class by a tag name.
3368 (WebCore::CustomElementDefinitions::findName): Added. Finds a tag name by a JS class.
3369 * dom/CustomElementDefinitions.h: Added.
3370 (WebCore::CustomElementDefinitions::CustomElementInfo): Added.
3373 (WebCore::Document::ensureCustomElementDefinitions): Added.
3375 (WebCore::Document::customElementDefinitions): Added.
3378 * html/HTMLElement.idl:
3380 2016-01-14 Simon Fraser <simon.fraser@apple.com>
3382 Remove workaround for rdar://problem/23623670
3383 https://bugs.webkit.org/show_bug.cgi?id=153107
3384 rdar://problem/23633319
3386 Reviewed by Tim Horton.
3388 Remove the code that uses IOSurfaceAcceleratorTransformSurface() when copying from
3389 back-to-front buffer, now that CGIOSurfaceContextCreate()-code path works correctly.
3391 * platform/graphics/cocoa/IOSurface.h:
3392 * platform/graphics/cocoa/IOSurface.mm:
3393 (IOSurface::ensurePlatformContext):
3394 (IOSurface::copyToSurface): Deleted.
3396 2016-01-14 Beth Dakin <bdakin@apple.com>
3398 WK1 and WK2 should share more candidate request code
3399 https://bugs.webkit.org/show_bug.cgi?id=153108
3401 Reviewed by Simon Fraser.
3403 requestCandidatesForSelection() does not need to be exposed as an
3404 EditorClient function. WK1 can just call invoke this code from the existing
3405 respondToChangedSelection EditorClient function, which is what WK2 does.
3406 * editing/Editor.cpp:
3407 (WebCore::Editor::respondToChangedSelection):
3408 * loader/EmptyClients.h:
3409 * page/EditorClient.h:
3410 (WebCore::EditorClient::supportsGlobalSelection):
3412 2016-01-14 Beth Dakin <bdakin@apple.com>
3414 WK2: Request completion candidates when needed
3415 https://bugs.webkit.org/show_bug.cgi?id=153040
3417 rdar://problem/24155631
3419 Reviewed by Enrica Casucci and Tim Horton.
3421 Helper functions for stringForCandidateRequest() and
3422 handleAcceptedCandidate()
3423 * editing/Editor.cpp:
3424 (WebCore::candidateRangeForSelection):
3425 (WebCore::candidateWouldReplaceText):
3427 Request candidates for the word that is currently being typed so long as the
3428 candidate would replace that word. Otherwise, use String().
3429 (WebCore::Editor::stringForCandidateRequest):
3431 When a candidate has been accepted, insert the text.
3432 (WebCore::Editor::handleAcceptedCandidate):
3435 2016-01-14 Daniel Bates <dabates@apple.com>
3437 Disallow use of Geolocation service from unique origins
3438 https://bugs.webkit.org/show_bug.cgi?id=153102
3439 <rdar://problem/23055645>
3441 Reviewed by Alexey Proskuryakov.
3443 Tests: fast/dom/Geolocation/dataURL-getCurrentPosition.html
3444 fast/dom/Geolocation/dataURL-watchPosition.html
3445 fast/dom/Geolocation/srcdoc-getCurrentPosition.html
3446 fast/dom/Geolocation/srcdoc-watchPosition.html
3447 http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition.html
3448 http/tests/security/sandboxed-iframe-geolocation-watchPosition.html
3450 * Modules/geolocation/Geolocation.cpp:
3451 (WebCore::Geolocation::securityOrigin): Convenience function to get the SecurityOrigin object
3452 associated with this script execution context.
3453 (WebCore::Geolocation::startRequest): Notify requester POSITION_UNAVAILABLE when requested
3454 from a document with a unique origin.
3455 * Modules/geolocation/Geolocation.h:
3456 * page/SecurityOrigin.h:
3457 (WebCore::SecurityOrigin::canRequestGeolocation): Added.
3459 2016-01-14 Daniel Bates <dabates@apple.com>
3461 [XSS Auditor] Extract attribute truncation logic and formalize string canonicalization
3462 https://bugs.webkit.org/show_bug.cgi?id=152874
3464 Reviewed by Brent Fulgham.
3466 Derived from Blink patch (by Tom Sepez <tsepez@chromium.org>):
3467 <https://src.chromium.org/viewvc/blink?revision=176339&view=revision>
3469 Extract the src-like and script-like attribute truncation logic into independent functions
3470 towards making it more straightforward to re-purpose this logic. Additionally, formalize the
3471 concept of string canonicalization as a member function that consolidates the process of
3472 decoding URL escape sequences, truncating the decoded string (if applicable), and removing
3473 characters that are considered noise.
3475 * html/parser/XSSAuditor.cpp:
3476 (WebCore::truncateForSrcLikeAttribute): Extracted from XSSAuditor::decodedSnippetForAttribute().
3477 (WebCore::truncateForScriptLikeAttribute): Ditto.
3478 (WebCore::XSSAuditor::init): Write in terms of XSSAuditor::canonicalize().
3479 (WebCore::XSSAuditor::filterCharacterToken): Updated to make use of formalized canonicalization methods.
3480 (WebCore::XSSAuditor::filterScriptToken): Ditto.
3481 (WebCore::XSSAuditor::filterObjectToken): Ditto.
3482 (WebCore::XSSAuditor::filterParamToken): Ditto.
3483 (WebCore::XSSAuditor::filterEmbedToken): Ditto.
3484 (WebCore::XSSAuditor::filterAppletToken): Ditto.
3485 (WebCore::XSSAuditor::filterFrameToken): Ditto.
3486 (WebCore::XSSAuditor::filterInputToken): Ditto.
3487 (WebCore::XSSAuditor::filterButtonToken): Ditto.
3488 (WebCore::XSSAuditor::eraseDangerousAttributesIfInjected): Ditto.
3489 (WebCore::XSSAuditor::eraseAttributeIfInjected): Updated code to use early return style and avoid an unnecessary string
3490 comparison when we know that a src attribute was injected.
3491 (WebCore::XSSAuditor::canonicalizedSnippetForTagName): Renamed; formerly known as XSSAuditor::decodedSnippetForName(). Updated
3492 to make use of XSSAuditor::canonicalize().
3493 (WebCore::XSSAuditor::snippetFromAttribute): Renamed; formerly known as XSSAuditor::decodedSnippetForAttribute(). Moved
3494 truncation logic from here to WebCore::truncateFor{Script, Src}LikeAttribute.
3495 (WebCore::XSSAuditor::canonicalize): Added.
3496 (WebCore::XSSAuditor::canonicalizedSnippetForJavaScript): Added.
3497 (WebCore::canonicalize): Deleted.
3498 (WebCore::XSSAuditor::decodedSnippetForName): Deleted.
3499 (WebCore::XSSAuditor::decodedSnippetForAttribute): Deleted.
3500 (WebCore::XSSAuditor::decodedSnippetForJavaScript): Deleted.
3501 * html/parser/XSSAuditor.h: Define enum class for the various attribute truncation styles.
3503 2016-01-14 Daniel Bates <dabates@apple.com>
3505 [XSS Auditor] Partial bypass when web server collapses path components
3506 https://bugs.webkit.org/show_bug.cgi?id=152872
<