Changes in releases/WebKitGTK/webkit-2.16 [217367:219817] in webkit
- Location:
- releases/WebKitGTK/webkit-2.16
- Files:
-
- 58 added
- 154 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified releases/WebKitGTK/webkit-2.16/ChangeLog ¶
r217367 r219817 1 2017-07-24 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 Unreviewed. Update OptionsGTK.cmake and NEWS for 2.16.6 release. 4 5 * Source/cmake/OptionsGTK.cmake: 6 7 2017-06-26 Carlos Garcia Campos <cgarcia@igalia.com> 8 9 Unreviewed. Update OptionsGTK.cmake and NEWS for 2.16.5 release. 10 11 * Source/cmake/OptionsGTK.cmake: 12 13 2017-06-20 Carlos Garcia Campos <cgarcia@igalia.com> 14 15 Unreviewed. Update OptionsGTK.cmake and NEWS for 2.16.4 release. 16 17 * Source/cmake/OptionsGTK.cmake: 18 1 19 2017-05-24 Carlos Garcia Campos <cgarcia@igalia.com> 2 20 -
TabularUnified releases/WebKitGTK/webkit-2.16/JSTests/ChangeLog ¶
r217367 r219817 1 2017-06-26 Saam Barati <sbarati@apple.com> 2 3 Crash in JSC::Lexer<unsigned char>::setCode 4 https://bugs.webkit.org/show_bug.cgi?id=172754 5 6 Reviewed by Mark Lam. 7 8 * stress/dont-reserve-huge-capacity-lexer.js: Added. 9 (catch): 10 11 2017-04-13 Mark Lam <mark.lam@apple.com> 12 13 Should use flushDirect() when flushing the scopeRegister due to needsScopeRegister(). 14 https://bugs.webkit.org/show_bug.cgi?id=170661 15 <rdar://problem/31579046> 16 17 Reviewed by Filip Pizlo. 18 19 * stress/regress-170661.js: Added. 20 21 2017-04-20 Mark Lam <mark.lam@apple.com> 22 23 virtualThunkFor() needs to materialize its of tagMaskRegister for tail calls. 24 https://bugs.webkit.org/show_bug.cgi?id=171079 25 <rdar://problem/31684756> 26 27 Reviewed by Saam Barati. 28 29 * stress/regress-171079.js: Added. 30 31 2017-05-05 Saam Barati <sbarati@apple.com> 32 33 putDirectIndex does not properly do defineOwnProperty 34 https://bugs.webkit.org/show_bug.cgi?id=171591 35 <rdar://problem/31735695> 36 37 Reviewed by Geoffrey Garen. 38 39 * stress/array-prototype-splice-making-typed-array.js: 40 (test): 41 * stress/array-species-config-array-constructor.js: 42 (shouldThrow): 43 (test): 44 * stress/put-direct-index-broken-2.js: Added. 45 (assert): 46 (test): 47 (makeLengthWritable): 48 (set get restoreOldDesc): 49 * stress/put-direct-index-broken.js: Added. 50 (whatToTest): 51 (tryRunning): 52 (tryItOut): 53 * stress/put-indexed-getter-setter.js: Added. 54 (foo.X.prototype.set 7): 55 (foo.X.prototype.get 7): 56 (foo.X): 57 (foo): 58 59 2017-05-17 Filip Pizlo <fpizlo@apple.com> 60 61 Unreviewed, address mlam's review feedback. 62 63 * stress/arguments-elimination-varargs-too-many-args-arg-count.js: 64 65 2017-05-17 Filip Pizlo <fpizlo@apple.com> 66 67 JSC: Incorrect LoadVarargs handling in ArgumentsEliminationPhase::transform 68 https://bugs.webkit.org/show_bug.cgi?id=172208 69 70 Reviewed by Saam Barati. 71 72 * stress/arguments-elimination-varargs-too-many-args-arg-count.js: Added. 73 (foo): 74 (bar): 75 (baz): 76 77 2017-04-17 Mark Lam <mark.lam@apple.com> 78 79 JSArray::appendMemcpy() needs to handle copying from Undecided indexing type too. 80 https://bugs.webkit.org/show_bug.cgi?id=170896 81 <rdar://problem/31651319> 82 83 Reviewed by JF Bastien and Keith Miller. 84 85 * stress/regress-170896.js: Added. 86 87 2017-05-25 Saam Barati <sbarati@apple.com> 88 89 Our for-in optimization in the bytecode generator does its static analysis incorrectly 90 https://bugs.webkit.org/show_bug.cgi?id=172532 91 <rdar://problem/32369452> 92 93 Reviewed by Mark Lam. 94 95 * stress/for-in-invalidation-for-any-write.js: Added. 96 (assert): 97 (test): 98 (test.i): 99 100 2017-04-14 Saam Barati <sbarati@apple.com> 101 102 ParseInt intrinsic in DFG backend doesn't properly flush its operands 103 https://bugs.webkit.org/show_bug.cgi?id=170865 104 105 Reviewed by Mark Lam and Geoffrey Garen. 106 107 * stress/parse-int-intrinsic-dfg-backend-flush.js: Added. 108 (assert): 109 (foo): 110 1 111 2017-05-10 Filip Pizlo <fpizlo@apple.com> 2 112 -
TabularUnified releases/WebKitGTK/webkit-2.16/JSTests/stress/array-prototype-splice-making-typed-array.js ¶
r217367 r219817 11 11 test(function() { 12 12 // This should not crash. 13 14 // FIXME: this might need to be updated as we make our splice implementation15 // more ES6 compliant: https://bugs.webkit.org/show_bug.cgi?id=15964516 13 let x = [1,2,3,4,5]; 17 14 x.constructor = Uint8Array; 18 15 delete x[2]; 19 16 assert(!(2 in x)); 20 let removed = x.splice(1,3); 21 assert(removed instanceof Uint8Array); 22 assert(removed.length === 3); 23 assert(removed[0] === 2); 24 assert(removed[1] === 0); 25 assert(removed[2] === 4); 17 let err = null; 18 try { 19 let removed = x.splice(1,3); 20 assert(removed instanceof Uint8Array); 21 assert(removed.length === 3); 22 assert(removed[0] === 2); 23 assert(removed[1] === 0); 24 assert(removed[2] === 4); 25 } catch(e) { 26 err = e; 27 } 28 assert(err.toString() === "TypeError: Attempting to configure non-configurable property on a typed array at index: 0"); 26 29 27 30 assert(x instanceof Array); 28 assert(x.length === 2);31 assert(x.length === 5); 29 32 assert(x[0] === 1); 30 assert(x[1] === 5); 33 assert(x[1] === 2); 34 assert(x[2] === undefined); 35 assert(x[3] === 4); 36 assert(x[4] === 5); 31 37 }); 32 38 -
TabularUnified releases/WebKitGTK/webkit-2.16/JSTests/stress/array-species-config-array-constructor.js ¶
r217367 r219817 20 20 Object.defineProperty(Int32Array.prototype, "length", { value: 0, writable: true }); 21 21 22 result = foo.concat([1]); 23 if (!(result instanceof Int32Array)) 24 throw "concat failed"; 22 function shouldThrow(f, m) { 23 let err; 24 try { 25 f(); 26 } catch(e) { 27 err = e; 28 } 29 if (err.toString() !== m) 30 throw new Error("Wrong error: " + err); 31 } 25 32 26 result = foo.splice(); 27 if (!(result instanceof Int32Array)) 28 throw "splice failed"; 29 30 result = foo.slice(); 31 if (!(result instanceof Int32Array)) 32 throw "slice failed"; 33 function test() { 34 const message = "TypeError: Attempting to configure non-configurable property on a typed array at index: 0"; 35 shouldThrow(() => foo.concat([1]), message); 36 foo = [1,2,3,4]; 37 shouldThrow(() => foo.slice(0), message); 38 foo = [1,2,3,4]; 39 let r = foo.splice(); 40 if (!(r instanceof Int32Array)) 41 throw "Bad"; 42 if (r.length !== 0) 43 throw "Bad"; 44 foo = [1,2,3,4]; 45 shouldThrow(() => foo.splice(0), message); 46 } 47 noInline(test); 48 for (let i = 0; i < 3000; ++i) 49 test(); -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog ¶
r217367 r219817 1 2017-05-12 Jiewen Tan <jiewen_tan@apple.com> 2 3 Elements should be inserted into a template element as its content's last child 4 https://bugs.webkit.org/show_bug.cgi?id=171373 5 <rdar://problem/31862949> 6 7 Reviewed by Ryosuke Niwa. 8 9 * fast/dom/HTMLTemplateElement/insert-fostering-child-expected.txt: Added. 10 * fast/dom/HTMLTemplateElement/insert-fostering-child.html: Added. 11 12 2017-05-15 Jiewen Tan <jiewen_tan@apple.com> 13 14 Replace CryptoOperationData with BufferSource for WebKitSubtleCrypto 15 https://bugs.webkit.org/show_bug.cgi?id=172146 16 <rdar://problem/32122256> 17 18 Reviewed by Brent Fulgham. 19 20 * crypto/webkitSubtle/argument-conversion-expected.txt: 21 * crypto/webkitSubtle/import-export-raw-key-leak-expected.txt: Added. 22 * crypto/webkitSubtle/import-export-raw-key-leak.html: Added. 23 24 2017-05-11 Zalan Bujtas <zalan@apple.com> 25 26 AX: Defer text changes until after the tree is clean if needed. 27 https://bugs.webkit.org/show_bug.cgi?id=171546 28 <rdar://problem/31934942> 29 30 Reviewed by Simon Fraser. 31 32 * accessibility/crash-when-render-tree-is-not-clean-expected.txt: Added. 33 * accessibility/crash-when-render-tree-is-not-clean.html: Added. 34 35 2017-05-02 Zalan Bujtas <zalan@apple.com> 36 37 Defer AX cache update when text content changes until after layout is finished. 38 https://bugs.webkit.org/show_bug.cgi?id=171429 39 <rdar://problem/31885984> 40 41 Reviewed by Simon Fraser. 42 43 * accessibility/crash-while-adding-text-child-with-transform-expected.txt: Added. 44 * accessibility/crash-while-adding-text-child-with-transform.html: Added. 45 46 2017-06-17 Antti Koivisto <antti@apple.com> 47 48 Crash due to infinite recursion via FrameSelection::updateAppearanceAfterLayout 49 https://bugs.webkit.org/show_bug.cgi?id=173468 50 51 Reviewed by Ryosuke Niwa. 52 53 * editing/selection/updateAppearanceAfterLayout-recursion-expected.txt: Added. 54 * editing/selection/updateAppearanceAfterLayout-recursion.html: Added. 55 56 2017-06-17 Ryosuke Niwa <rniwa@webkit.org> 57 58 REGRESSION(r209495): materiauxlaverdure.com fails to load 59 https://bugs.webkit.org/show_bug.cgi?id=173301 60 <rdar://problem/32624850> 61 62 Reviewed by Antti Koivisto. 63 64 Rebaselined the existing tests and added a new regression test for serializing CSS properties and values. 65 66 * accessibility/mac/alt-for-css-content-expected.txt: 67 * accessibility/mac/webkit-alt-for-css-content-expected.txt: 68 * editing/pasteboard/cjk-line-height-expected.txt: 69 * fast/css/alt-inherit-initial-expected.txt: 70 * fast/css/alt-inherit-initial.html: 71 * fast/css/content-language-comma-separated-list-expected.txt: 72 * fast/css/content-language-empty-expected.txt: 73 * fast/css/content-language-only-whitespace-expected.txt: 74 * fast/css/content-language-with-whitespace-expected.txt: 75 * fast/css/counters/counter-cssText-expected.txt: 76 * fast/css/counters/counter-cssText.html: 77 * fast/css/font-family-trailing-bracket-gunk-expected.txt: 78 * fast/css/font-family-trailing-bracket-gunk.html: 79 * fast/css/getComputedStyle/computed-style-font-family-expected.txt: 80 * fast/css/getComputedStyle/computed-style-properties-expected.txt: 81 * fast/css/getComputedStyle/computed-style-properties.html: 82 * fast/css/getComputedStyle/font-family-fallback-reset-expected.txt: 83 * fast/css/getComputedStyle/font-family-fallback-reset.html: 84 * fast/css/lang-mapped-to-webkit-locale-expected.txt: 85 * fast/css/lang-mapped-to-webkit-locale.xhtml: 86 * fast/css/serialization-with-double-quotes-expected.txt: Added. 87 * fast/css/serialization-with-double-quotes.html: Added. 88 * fast/css/uri-token-parsing-expected.txt: 89 * fast/css/uri-token-parsing.html: 90 * fast/inspector-support/cssURLQuotes-expected.txt: 91 * fast/inspector-support/style-expected.txt: 92 * fast/text/font-stretch-parse-expected.txt: 93 * fast/text/font-stretch-parse.html: 94 * fast/text/font-style-parse-expected.txt: 95 * fast/text/font-style-parse.html: 96 * fast/text/font-weight-parse-expected.txt: 97 * fast/text/font-weight-parse.html: 98 * media/controls/track-menu.html: 99 * platform/mac-elcapitan/fast/css/getComputedStyle/computed-style-font-family-expected.txt: 100 * platform/mac-elcapitan/fast/text/font-stretch-parse-expected.txt: 101 * platform/mac-elcapitan/fast/text/font-style-parse-expected.txt: 102 * platform/mac-elcapitan/fast/text/font-weight-parse-expected.txt: 103 104 2017-06-09 Brady Eidson <beidson@apple.com> 105 106 Crash when IndexedDB's getAll is used inside a Web Worker. 107 https://bugs.webkit.org/show_bug.cgi?id=172434 108 109 Reviewed by Andy Estes. 110 111 * storage/indexeddb/modern/resources/worker-getall.js: Added. 112 * storage/indexeddb/modern/worker-getall-expected.txt: Added. 113 * storage/indexeddb/modern/worker-getall.html: Added. 114 115 2017-06-08 Ryosuke Niwa <rniwa@webkit.org> 116 117 Crash inside InsertNodeBeforeCommand via InsertParagraphSeparatorCommand 118 https://bugs.webkit.org/show_bug.cgi?id=173085 119 120 Reviewed by Wenson Hsieh. 121 122 Added a regresion test. 123 124 * editing/inserting/insert-horizontal-rule-in-empty-document-crash-expected.txt: Added. 125 * editing/inserting/insert-horizontal-rule-in-empty-document-crash.html: Added. 126 127 2017-06-08 Xabier Rodriguez Calvar <calvaris@igalia.com> 128 129 MediaTime class has rounding issues in different platforms 130 https://bugs.webkit.org/show_bug.cgi?id=172640 131 132 Reviewed by Jer Noble. 133 134 Update expectations because the MediaTime printing changed, but 135 results are the same. 136 137 * media/media-source/media-source-overlapping-append-expected.txt: 138 * media/media-source/media-source-overlapping-decodetime-expected.txt: 139 * media/media-source/media-source-seek-back-expected.txt: 140 * media/media-source/media-source-sequence-timestamps-expected.txt: 141 * media/media-source/media-source-timeoffset-expected.txt: 142 143 2017-06-06 Zalan Bujtas <zalan@apple.com> 144 145 Safari doesn't load newest The Order of the Stick comic. 146 https://bugs.webkit.org/show_bug.cgi?id=172949 147 <rdar://problem/32389730> 148 149 Reviewed by Antti Koivisto. 150 151 * fast/table/floating-table-sibling-is-invisible-expected.html: Added. 152 * fast/table/floating-table-sibling-is-invisible.html: Added. 153 154 2017-06-05 Chris Dumez <cdumez@apple.com> 155 156 ASSERTION FAILED: RunLoop::isMain() in com.apple.WebKit: IPC::Connection::sendSyncMessage + 128 157 https://bugs.webkit.org/show_bug.cgi?id=172943 158 <rdar://problem/31288058> 159 160 Reviewed by Alexey Proskuryakov. 161 162 Make test clean a little bit more robust. 163 164 * storage/domstorage/sessionstorage/set-item-synchronous-keydown.html: 165 166 2017-06-05 Chris Dumez <cdumez@apple.com> 167 168 ASSERTION FAILED: RunLoop::isMain() in com.apple.WebKit: IPC::Connection::sendSyncMessage + 128 169 https://bugs.webkit.org/show_bug.cgi?id=172943 170 <rdar://problem/31288058> 171 172 Reviewed by Alexey Proskuryakov. 173 174 Add better test coverage. 175 176 * storage/domstorage/sessionstorage/set-item-synchronous-keydown-expected.txt: Added. 177 * storage/domstorage/sessionstorage/set-item-synchronous-keydown.html: Added. 178 179 2017-06-12 Carlos Garcia Campos <cgarcia@igalia.com> 180 181 [GTK] Stop dismissing menus attached to the web view for every injected event 182 https://bugs.webkit.org/show_bug.cgi?id=172708 183 184 Reviewed by Alex Christensen. 185 186 * editing/selection/5354455-1.html: No need to click on editable area to focus it, contextClick already focuses 187 it, we even have another test to ensure it. Those fast clicks were causing a double click in GTK+ port which 188 selected the whole line. We don't need to dismiss the context menu either, because contextClick() doesn't really 189 show the menu. 190 * fast/events/context-activated-by-key-event.html: Dismiss the context menu every time we show it. 191 * fast/events/mouse-click-events.html: Dimiss the context menu when testing right click events. 192 193 2017-05-30 Adrian Perez de Castro <aperez@igalia.com> 194 195 [GTK] Test cases for typehead in form menu lists should start from known state 196 https://bugs.webkit.org/show_bug.cgi?id=171792 197 198 Reviewed by Carlos Garcia Campos. 199 200 Since r215188 opening a popup menu in a form pre-selects the active 201 element to mimic GtkComboxBox behavior, but the layout test implicitly 202 assumed that type ahead search always started the beginning of the 203 list, which is no longer true now that GTK+ is informed of which one 204 is the active element. 205 206 * platform/gtk/fast/forms/menulist-typeahead-find.html: Reset menu 207 list to the initial state (no element selected, unfocused) at the 208 beginning of testTypeAheadFunction(). 209 210 2017-05-25 Chris Dumez <cdumez@apple.com> 211 212 imported/w3c/web-platform-tests/html/semantics/forms/form-control-infrastructure/form_owner_and_table_2.html is crashing 213 https://bugs.webkit.org/show_bug.cgi?id=172628 214 <rdar://problem/32418707> 215 216 Reviewed by Sam Weinig. 217 218 Add reduced test case. 219 220 * TestExpectations: 221 Unskip test that is no longer crashing in debug builds. 222 223 * fast/dom/HTMLFormElement/form-removed-during-parsing-crash-expected.txt: Added. 224 * fast/dom/HTMLFormElement/form-removed-during-parsing-crash.html: Added. 225 226 2017-05-25 Zalan Bujtas <zalan@apple.com> 227 228 Frame's composited content is visible when the frame has visibility: hidden. 229 https://bugs.webkit.org/show_bug.cgi?id=125565 230 <rdar://problem/32196849> 231 232 Reviewed by Simon Fraser. 233 234 * compositing/resources/visibility.html: Added. 235 * compositing/visibility/frameset-visibility-hidden-expected.html: Added. 236 * compositing/visibility/frameset-visibility-hidden.html: Added. 237 * compositing/visibility/iframe-visibility-hidden-expected.html: Added. 238 * compositing/visibility/iframe-visibility-hidden.html: Added. 239 * compositing/visibility/object-visibility-hidden-expected.html: Added. 240 * compositing/visibility/object-visibility-hidden.html: Added. 241 242 2017-05-25 Chris Dumez <cdumez@apple.com> 243 244 DocumentThreadableLoader::redirectReceived() should not rely on the resource's loader 245 https://bugs.webkit.org/show_bug.cgi?id=172578 246 <rdar://problem/30754582> 247 248 Reviewed by Youenn Fablet. 249 250 Add layout test coverage. 251 252 * http/tests/xmlhttprequest/cacheable-cross-origin-redirect-crash-expected.txt: Added. 253 * http/tests/xmlhttprequest/cacheable-cross-origin-redirect-crash.html: Added. 254 255 2017-05-24 Jiewen Tan <jiewen_tan@apple.com> 256 257 Crash on WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance + 1195 258 https://bugs.webkit.org/show_bug.cgi?id=172555 259 <rdar://problem/32004724> 260 261 Reviewed by Ryosuke Niwa. 262 263 * editing/selection/resources/select-iframe-focusin-document-crash-frame.html: Added. 264 * editing/selection/select-iframe-focusin-document-crash-expected.txt: Added. 265 * editing/selection/select-iframe-focusin-document-crash.html: Added. 266 267 2017-03-24 Brent Fulgham <bfulgham@apple.com> 268 269 Handle recursive calls to ProcessingInstruction::checkStyleSheet 270 https://bugs.webkit.org/show_bug.cgi?id=169982 271 <rdar://problem/31083051> 272 273 Reviewed by Antti Koivisto. 274 275 * fast/dom/beforeload/image-removed-during-before-load-expected.txt: Copied from LayoutTests/fast/dom/beforeload/image-removed-during-before-load-expected.txt. 276 * fast/dom/beforeload/image-removed-during-before-load.html: Copied from LayoutTests/fast/dom/beforeload/image-removed-during-before-load.html. 277 * fast/dom/beforeload/recursive-css-pi-before-load-expected.txt: Copied from LayoutTests/fast/dom/beforeload/recursive-css-pi-before-load-expected.txt. 278 * fast/dom/beforeload/recursive-css-pi-before-load.html: Copied from LayoutTests/fast/dom/beforeload/recursive-css-pi-before-load.html. 279 * fast/dom/beforeload/recursive-link-before-load-expected.txt: Copied from LayoutTests/fast/dom/beforeload/recursive-link-before-load-expected.txt. 280 * fast/dom/beforeload/recursive-link-before-load.html: Copied from LayoutTests/fast/dom/beforeload/recursive-link-before-load.html. 281 * fast/dom/beforeload/recursive-xsl-pi-before-load-expected.txt: Copied from LayoutTests/fast/dom/beforeload/recursive-xsl-pi-before-load-expected.txt. 282 * fast/dom/beforeload/recursive-xsl-pi-before-load.html: Copied from LayoutTests/fast/dom/beforeload/recursive-xsl-pi-before-load.html. 283 * fast/dom/beforeload/resources/content.xhtml: Copied from LayoutTests/fast/dom/beforeload/resources/content.xhtml. 284 * fast/dom/beforeload/resources/pass.css: Copied from LayoutTests/fast/dom/beforeload/resources/pass.css. 285 * fast/dom/beforeload/resources/test.xsl: Copied from LayoutTests/fast/dom/beforeload/resources/test.xsl. 286 1 287 2017-03-22 Jiewen Tan <jiewen_tan@apple.com> 2 288 -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/accessibility/mac/alt-for-css-content-expected.txt ¶
r217367 r219817 40 40 AXValue: ALTERNATIVE CONTENT TEST6 41 41 42 alt accessed through Javascript: 'ALTERNATIVE CONTENT TEST2'42 alt accessed through Javascript: "ALTERNATIVE CONTENT TEST2" 43 43 Test7 - alt does not apply to DOM nodes. 44 44 AXRole: AXImage -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/accessibility/mac/webkit-alt-for-css-content-expected.txt ¶
r217367 r219817 40 40 AXValue: ALTERNATIVE CONTENT TEST6 41 41 42 WebKitAlt accessed through Javascript: 'ALTERNATIVE CONTENT TEST2'42 WebKitAlt accessed through Javascript: "ALTERNATIVE CONTENT TEST2" 43 43 Test7 - webkit-alt does not apply to DOM nodes. 44 44 AXRole: AXImage -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/crypto/webkitSubtle/argument-conversion-expected.txt ¶
r217367 r219817 17 17 Passing invalid data to digest() 18 18 PASS crypto.webkitSubtle.digest({name: 'sha-1'}) threw exception TypeError: Not enough arguments. 19 PASS crypto.webkitSubtle.digest({name: 'sha-1'}, null) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.20 PASS crypto.webkitSubtle.digest({name: 'sha-1'}, 10) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.21 PASS crypto.webkitSubtle.digest({name: 'sha-1'}, [10]) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.22 PASS crypto.webkitSubtle.digest({name: 'sha-1'}, [new Uint8Array([0])]) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.19 PASS crypto.webkitSubtle.digest({name: 'sha-1'}, null) threw exception TypeError: Type error. 20 PASS crypto.webkitSubtle.digest({name: 'sha-1'}, 10) threw exception TypeError: Type error. 21 PASS crypto.webkitSubtle.digest({name: 'sha-1'}, [10]) threw exception TypeError: Type error. 22 PASS crypto.webkitSubtle.digest({name: 'sha-1'}, [new Uint8Array([0])]) threw exception TypeError: Type error. 23 23 24 24 Passing invalid algorithmIdentifiers to digest() -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/editing/pasteboard/cjk-line-height-expected.txt ¶
r217367 r219817 2 2 To manually test, copy and paste the selected content below. WebKit should not generate line-height property in the pasted content. 3 3 | <span> 4 | style="font-family: 'Hiragino Kaku Gothic ProN';"4 | style="font-family: "Hiragino Kaku Gothic ProN";" 5 5 | "hello<#selection-caret>" 6 6 | <br> -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/editing/selection/5354455-1.html ¶
r217367 r219817 17 17 y = paragraph.offsetParent.offsetTop + paragraph.offsetTop + paragraph.offsetHeight / 2; 18 18 eventSender.mouseMoveTo(x, y); 19 // Give the editable region focus.20 eventSender.mouseDown();21 eventSender.mouseUp();22 19 // Right click on the paragraph break to select it. 23 20 eventSender.contextClick(); 24 // esc key to kill the context menu. 25 eventSender.keyDown(String.fromCharCode(0x001B), null); 26 21 27 22 document.getElementById(result).innerHTML = window.getSelection().type; 28 23 } -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/alt-inherit-initial-expected.txt ¶
r217367 r219817 12 12 testDiv.style['alt'] = 'initial' 13 13 PASS testDiv.style['alt'] is "initial" 14 PASS window.getComputedStyle(testDiv).getPropertyValue('alt') is " ''"14 PASS window.getComputedStyle(testDiv).getPropertyValue('alt') is "\"\"" 15 15 PASS successfullyParsed is true 16 16 -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/alt-inherit-initial.html ¶
r217367 r219817 31 31 evalAndLog("testDiv.style['alt'] = 'initial'"); 32 32 shouldBeEqualToString("testDiv.style['alt']", "initial"); 33 shouldBeEqualToString("window.getComputedStyle(testDiv).getPropertyValue('alt')", "''");33 shouldBeEqualToString("window.getComputedStyle(testDiv).getPropertyValue('alt')", `""`); 34 34 35 35 </script> -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/content-language-comma-separated-list-expected.txt ¶
r217367 r219817 1 1 Test for bug 76701: map HTTP-EQUIV content-language to -webkit-locale. This particular test tests that a comma-separated list of languages is ignored. This expectation may change, see bug. The HTML5 spec says that content-language should not have multiple languages, and decrees that a content-language containing a comma be ignored; this position has been upheld following significant debate. Firefox accepts a comma-separated list and a CSS :lang selector for any language in the list is matched. It's unclear what IE does. 2 2 3 FAIL languageOfNode('x') should be auto. Was 'ja, zh_CN'.3 FAIL languageOfNode('x') should be auto. Was "ja, zh_CN". 4 4 PASS languageOfNode('y') is "ar" 5 5 PASS successfullyParsed is true -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/content-language-empty-expected.txt ¶
r217367 r219817 1 1 Test for bug 76701: map HTTP-EQUIV content-language to -webkit-locale. This particular test tests that a content-language of empty string is ignored. This expectation may change, see bug. HTML5 decrees that the meta element be ignored in case of the empty string. It's unclear what other browsers do. 2 2 3 FAIL languageOfNode('x') should be auto. Was ''.3 FAIL languageOfNode('x') should be auto. Was "". 4 4 PASS languageOfNode('y') is "ar" 5 5 PASS successfullyParsed is true -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/content-language-only-whitespace-expected.txt ¶
r217367 r219817 1 1 Test for bug 76701: map HTTP-EQUIV content-language to -webkit-locale. This particular test tests that a content-language with whitespace-only content is ignored. This expectation may change, see bug. HTML5 decrees that the meta element be ignored in case of whitespace only content. It's unclear what other browsers do. 2 2 3 FAIL languageOfNode('x') should be auto. Was ' \9 \a '.3 FAIL languageOfNode('x') should be auto. Was " \9 \a ". 4 4 PASS languageOfNode('y') is "ar" 5 5 PASS successfullyParsed is true -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/content-language-with-whitespace-expected.txt ¶
r217367 r219817 1 1 Test for bug 76701: map HTTP-EQUIV content-language to -webkit-locale. This particular test tests that the the pragma-set default language is set to the first sequence of non-whitespace characters of the content-language content. This expectation may change, see bug. This expectation is as per the HTML 5 spec. It appears that Firefox does not exactly do this, but trims the leading and trailing whitespace. It's unclear what IE does. 2 2 3 FAIL languageOfNode('x') should be ja_JP. Was ' \a \9 \9 ja-JP \9 zh_CN \9 \a \a \9 \9 '.3 FAIL languageOfNode('x') should be ja_JP. Was " \a \9 \9 ja-JP \9 zh_CN \9 \a \a \9 \9 ". 4 4 PASS languageOfNode('y') is "ar" 5 5 PASS successfullyParsed is true -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/counters/counter-cssText-expected.txt ¶
r217367 r219817 5 5 6 6 PASS rules[2].style.cssText is "content: counter(section, decimal);" 7 PASS rules[3].style.cssText is "content: counters(section, ':', decimal);"7 PASS rules[3].style.cssText is "content: counters(section, \":\", decimal);" 8 8 PASS rules[4].style.cssText is "content: counter(section, lower-roman);" 9 PASS rules[5].style.cssText is "content: counters(section, ',', upper-roman);"9 PASS rules[5].style.cssText is "content: counters(section, \",\", upper-roman);" 10 10 PASS rules[6].style.cssText is "content: counter(section, none);" 11 11 PASS successfullyParsed is true -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/counters/counter-cssText.html ¶
r217367 r219817 30 30 description("Test the cssText output of counter-valued CSSPrimitiveValues"); 31 31 var rules = document.styleSheets[0].cssRules; 32 shouldBeEqualToString("rules[2].style.cssText", "content: counter(section, decimal);");33 shouldBeEqualToString("rules[3].style.cssText", "content: counters(section, ':', decimal);");34 shouldBeEqualToString("rules[4].style.cssText", "content: counter(section, lower-roman);");35 shouldBeEqualToString("rules[5].style.cssText", "content: counters(section, ',', upper-roman);");36 shouldBeEqualToString("rules[6].style.cssText", "content: counter(section, none);");32 shouldBeEqualToString("rules[2].style.cssText", `content: counter(section, decimal);`); 33 shouldBeEqualToString("rules[3].style.cssText", `content: counters(section, ":", decimal);`); 34 shouldBeEqualToString("rules[4].style.cssText", `content: counter(section, lower-roman);`); 35 shouldBeEqualToString("rules[5].style.cssText", `content: counters(section, ",", upper-roman);`); 36 shouldBeEqualToString("rules[6].style.cssText", `content: counter(section, none);`); 37 37 </script> 38 38 <script src="../../../resources/js-test-post.js"></script> -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/font-family-trailing-bracket-gunk-expected.txt ¶
r217367 r219817 4 4 5 5 6 PASS spanElement.innerHTML is 'foo'7 PASS computedStyle.getPropertyValue('font-family') is " 'Arial [ding dong]', 'Helvetica [Xft]', Courier"6 PASS spanElement.innerHTML is "foo" 7 PASS computedStyle.getPropertyValue('font-family') is "\"Arial [ding dong]\", \"Helvetica [Xft]\", Courier" 8 8 PASS successfullyParsed is true 9 9 -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/font-family-trailing-bracket-gunk.html ¶
r217367 r219817 14 14 15 15 var computedStyle = window.getComputedStyle(spanElement); 16 shouldBe ("spanElement.innerHTML", "'foo'");17 shouldBe ("computedStyle.getPropertyValue('font-family')", "\"'Arial [ding dong]', 'Helvetica [Xft]', Courier\"");16 shouldBeEqualToString("spanElement.innerHTML", "foo"); 17 shouldBeEqualToString("computedStyle.getPropertyValue('font-family')", `"Arial [ding dong]", "Helvetica [Xft]", Courier`); 18 18 19 19 document.body.removeChild(spanElement); -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/getComputedStyle/computed-style-font-family-expected.txt ¶
r217367 r219817 1 1 Font attributes. The font-family should list three families: 2 2 3 font-family: monospace, 'Lucida Grande', sans-serif;3 font-family: monospace, "Lucida Grande", sans-serif; 4 4 font-size: 16px; 5 5 font-style: normal; -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/getComputedStyle/computed-style-properties-expected.txt ¶
r217367 r219817 11 11 12 12 PASS computedStyleFor('outline', null, 'outline-offset') is '5px' 13 PASS computedStyleFor('content', 'before', 'content') is 'text'14 PASS computedStyleFor('content', 'after', 'content') is " 'test 'url(data:image/gif;base64,R0lGODlhAQABAJAAAP8AAAAAACwAAAAAAQABAAACAgQBADs=)"15 PASS computedStyleFor('counter', null, 'counter-reset') is 'section 0'13 PASS computedStyleFor('content', 'before', 'content') is "text" 14 PASS computedStyleFor('content', 'after', 'content') is "\"test \" url(data:image/gif;base64,R0lGODlhAQABAJAAAP8AAAAAACwAAAAAAQABAAACAgQBADs=)" 15 PASS computedStyleFor('counter', null, 'counter-reset') is "section 0" 16 16 PASS str.indexOf('subsection 0') != -1 is true 17 17 PASS str.indexOf('anothercounter 5') != -1 is true 18 PASS computedStyleFor('counter1', 'before', 'counter-increment') is 'section 1'19 PASS computedStyleFor('subcounter2', 'before', 'counter-increment') is 'subsection 1'20 PASS computedStyleFor('subcounter2', 'before', 'content') is "counter(section) '.' counter(subsection) '. '"18 PASS computedStyleFor('counter1', 'before', 'counter-increment') is "section 1" 19 PASS computedStyleFor('subcounter2', 'before', 'counter-increment') is "subsection 1" 20 PASS computedStyleFor('subcounter2', 'before', 'content') is "counter(section) \".\" counter(subsection) \". \"" 21 21 PASS successfullyParsed is true 22 22 -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/getComputedStyle/computed-style-properties.html ¶
r217367 r219817 66 66 shouldBe("computedStyleFor('outline', null, 'outline-offset')", "'5px'"); 67 67 68 shouldBe ("computedStyleFor('content', 'before', 'content')", "'text'");69 shouldBe ("computedStyleFor('content', 'after', 'content')", '"\'test \' url(data:image/gif;base64,R0lGODlhAQABAJAAAP8AAAAAACwAAAAAAQABAAACAgQBADs=)"');70 shouldBe ("computedStyleFor('counter', null, 'counter-reset')", "'section 0'");68 shouldBeEqualToString("computedStyleFor('content', 'before', 'content')", "text"); 69 shouldBeEqualToString("computedStyleFor('content', 'after', 'content')", `"test " url(data:image/gif;base64,R0lGODlhAQABAJAAAP8AAAAAACwAAAAAAQABAAACAgQBADs=)`); 70 shouldBeEqualToString("computedStyleFor('counter', null, 'counter-reset')", "section 0"); 71 71 var str = computedStyleFor('subcounter', null, 'counter-reset'); 72 72 shouldBe("str.indexOf('subsection 0') != -1", "true"); 73 73 shouldBe("str.indexOf('anothercounter 5') != -1", "true"); 74 shouldBe ("computedStyleFor('counter1', 'before', 'counter-increment')", "'section 1'");75 shouldBe ("computedStyleFor('subcounter2', 'before', 'counter-increment')", "'subsection 1'");76 shouldBe ("computedStyleFor('subcounter2', 'before', 'content')", '"counter(section) \'.\' counter(subsection) \'. \'"');74 shouldBeEqualToString("computedStyleFor('counter1', 'before', 'counter-increment')", "section 1"); 75 shouldBeEqualToString("computedStyleFor('subcounter2', 'before', 'counter-increment')", "subsection 1"); 76 shouldBeEqualToString("computedStyleFor('subcounter2', 'before', 'content')", `counter(section) "." counter(subsection) ". "`); 77 77 </script> 78 78 <script src="../../../resources/js-test-post.js"></script> -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/getComputedStyle/font-family-fallback-reset-expected.txt ¶
r217367 r219817 4 4 5 5 6 PASS window.getComputedStyle(outerDiv, null).fontFamily is " 'courier new', cursive"6 PASS window.getComputedStyle(outerDiv, null).fontFamily is "\"courier new\", cursive" 7 7 PASS window.getComputedStyle(timesDiv, null).fontFamily is "foo" 8 8 PASS window.getComputedStyle(cursiveDiv, null).fontFamily is "cursive" -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/getComputedStyle/script-tests/font-family-fallback-reset.js ¶
r217367 r219817 11 11 '</div>'; 12 12 13 shouldBeEqualToString("window.getComputedStyle(outerDiv, null).fontFamily", "'courier new', cursive");13 shouldBeEqualToString("window.getComputedStyle(outerDiv, null).fontFamily", `"courier new", cursive`); 14 14 shouldBeEqualToString("window.getComputedStyle(timesDiv, null).fontFamily", "foo"); 15 15 shouldBeEqualToString("window.getComputedStyle(cursiveDiv, null).fontFamily", "cursive"); -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/lang-mapped-to-webkit-locale-expected.txt ¶
r217367 r219817 20 20 PASS languageOfNode('q4') is "ar" 21 21 PASS languageOfNode('q5') is "auto" 22 PASS languageOfNode('q6') is " ' '"22 PASS languageOfNode('q6') is "\" \"" 23 23 PASS languageOfNode('q7') is "auto" 24 24 PASS languageOfNode('q8') is "xyzzy" 25 PASS languageOfNode('q9') is " '][;][['"25 PASS languageOfNode('q9') is "\"][;][[\"" 26 26 PASS successfullyParsed is true 27 27 -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/lang-mapped-to-webkit-locale.xhtml ¶
r217367 r219817 47 47 shouldBeEqualToString("languageOfNode('q4')", "ar"); 48 48 shouldBeEqualToString("languageOfNode('q5')", "auto"); 49 shouldBeEqualToString("languageOfNode('q6')", "' '");49 shouldBeEqualToString("languageOfNode('q6')", `" "`); 50 50 shouldBeEqualToString("languageOfNode('q7')", "auto"); 51 51 shouldBeEqualToString("languageOfNode('q8')", "xyzzy"); 52 shouldBeEqualToString("languageOfNode('q9')", "'][;][['");52 shouldBeEqualToString("languageOfNode('q9')", `"][;][["`); 53 53 54 54 var successfullyParsed = true; -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/uri-token-parsing-expected.txt ¶
r217367 r219817 13 13 #h { content: url(e); } 14 14 #i { content: url(f); } 15 #j { content: url( 'url(g)'); }15 #j { content: url("url(g)"); } 16 16 #l { content: url(c); } 17 17 #m { content: url(d); } 18 18 #n { content: url(e); } 19 19 #o { content: url(f); } 20 #p { content: url( 'url(g)'); }21 #q { cursor: url( 'url(q)'), default; }22 #r { list-style-image: url( 'url(r)'); }23 #s { background-image: url( 'url(s)'); }24 #t { -webkit-mask-image: url( 'url(t)'); }25 #u { -webkit-border-image: url( 'url(u)') 1 2 3 4 fill stretch round; }26 #v { -webkit-mask-box-image: url( 'url(v)') 1 2 3 4 fill stretch round; }20 #p { content: url("url(g)"); } 21 #q { cursor: url("url(q)"), default; } 22 #r { list-style-image: url("url(r)"); } 23 #s { background-image: url("url(s)"); } 24 #t { -webkit-mask-image: url("url(t)"); } 25 #u { -webkit-border-image: url("url(u)") 1 2 3 4 fill stretch round; } 26 #v { -webkit-mask-box-image: url("url(v)") 1 2 3 4 fill stretch round; } 27 27 #w { content: url(ww); } 28 28 #x { content: url(x%20xx); } … … 38 38 #h { content: url(e); } 39 39 #i { content: url(f); } 40 #j { content: url( 'url(g)'); }40 #j { content: url("url(g)"); } 41 41 #l { content: url(c); } 42 42 #m { content: url(d); } 43 43 #n { content: url(e); } 44 44 #o { content: url(f); } 45 #p { content: url( 'url(g)'); }46 #q { cursor: url( 'url(q)'), default; }47 #r { list-style-image: url( 'url(r)'); }48 #s { background-image: url( 'url(s)'); }49 #t { -webkit-mask-image: url( 'url(t)'); }50 #u { -webkit-border-image: url( 'url(u)') 1 2 3 4 fill stretch round; }51 #v { -webkit-mask-box-image: url( 'url(v)') 1 2 3 4 fill stretch round; }45 #p { content: url("url(g)"); } 46 #q { cursor: url("url(q)"), default; } 47 #r { list-style-image: url("url(r)"); } 48 #s { background-image: url("url(s)"); } 49 #t { -webkit-mask-image: url("url(t)"); } 50 #u { -webkit-border-image: url("url(u)") 1 2 3 4 fill stretch round; } 51 #v { -webkit-mask-box-image: url("url(v)") 1 2 3 4 fill stretch round; } 52 52 #w { content: url(ww); } 53 53 #x { content: url(x%20xx); } -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/uri-token-parsing.html ¶
r217367 r219817 87 87 #h { content: url(e); } 88 88 #i { content: url(f); } 89 #j { content: url( 'url(g)'); }89 #j { content: url("url(g)"); } 90 90 #l { content: url(c); } 91 91 #m { content: url(d); } 92 92 #n { content: url(e); } 93 93 #o { content: url(f); } 94 #p { content: url( 'url(g)'); }95 #q { cursor: url( 'url(q)'), default; }96 #r { list-style-image: url( 'url(r)'); }97 #s { background-image: url( 'url(s)'); }98 #t { -webkit-mask-image: url( 'url(t)'); }99 #u { -webkit-border-image: url( 'url(u)') 1 2 3 4 fill stretch round; }100 #v { -webkit-mask-box-image: url( 'url(v)') 1 2 3 4 fill stretch round; }94 #p { content: url("url(g)"); } 95 #q { cursor: url("url(q)"), default; } 96 #r { list-style-image: url("url(r)"); } 97 #s { background-image: url("url(s)"); } 98 #t { -webkit-mask-image: url("url(t)"); } 99 #u { -webkit-border-image: url("url(u)") 1 2 3 4 fill stretch round; } 100 #v { -webkit-mask-box-image: url("url(v)") 1 2 3 4 fill stretch round; } 101 101 #w { content: url(ww); } 102 102 #x { content: url(x%20xx); } -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/fast/events/context-activated-by-key-event.html ¶
r217367 r219817 12 12 document.getElementById('result').appendChild(document.createTextNode(text)); 13 13 document.getElementById('result').appendChild(document.createElement("br")); 14 } 15 16 function dismissContextMenu() { 17 if (window.eventSender) { 18 // esc key to kill the context menu. 19 eventSender.keyDown(String.fromCharCode(0x001B), null); 20 } 14 21 } 15 22 … … 36 43 if (window.testRunner) { 37 44 eventSender.keyDown('menu'); 45 dismissContextMenu(); 38 46 39 47 var rect = document.getElementById('contenteditable').getBoundingClientRect(); … … 44 52 eventSender.mouseUp(); 45 53 eventSender.keyDown('menu'); 54 dismissContextMenu(); 46 55 47 56 document.getElementById('link').focus(); 48 57 eventSender.keyDown('menu'); 58 dismissContextMenu(); 49 59 50 60 window.getSelection().selectAllChildren(document.getElementById('contenteditable')); 51 61 eventSender.keyDown('menu'); 62 dismissContextMenu(); 52 63 53 64 testRunner.dumpAsText(); -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/fast/events/script-tests/mouse-click-events.js ¶
r217367 r219817 20 20 } 21 21 22 function dismissContextMenu() { 23 if (window.eventSender) { 24 // esc key to kill the context menu. 25 eventSender.keyDown(String.fromCharCode(0x001B), null); 26 } 27 } 28 22 29 div.addEventListener("click", appendEventLog, false); 23 30 div.addEventListener("dblclick", appendEventLog, false); … … 35 42 } 36 43 eventSender.mouseDown(button); 44 if (button == 2) 45 dismissContextMenu(); 37 46 eventSender.mouseUp(button); 38 47 eventSender.mouseDown(button); 48 if (button == 2) 49 dismissContextMenu(); 39 50 eventSender.mouseUp(button); 40 51 // could test dragging here too -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/fast/inspector-support/cssURLQuotes-expected.txt ¶
r217367 r219817 1 1 ALERT: url(file:///unquoted) (URL should not be quoted) 2 2 ALERT: url(file:///noQuotesNeeded) (URL should not be quoted) 3 ALERT: url( 'file:///should(Quote)') (URL should be quoted)3 ALERT: url("file:///should(Quote)") (URL should be quoted) 4 4 -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/fast/inspector-support/style-expected.txt ¶
r217367 r219817 21 21 font-size: 24px (original property was font) 22 22 line-height: normal (original property was font and property was implicitly set.) 23 font-family: 'Lucida Grande'(original property was font)23 font-family: "Lucida Grande" (original property was font) 24 24 -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/imported/w3c/ChangeLog ¶
r217367 r219817 1 2017-06-17 Ryosuke Niwa <rniwa@webkit.org> 2 3 REGRESSION(r209495): materiauxlaverdure.com fails to load 4 https://bugs.webkit.org/show_bug.cgi?id=173301 5 <rdar://problem/32624850> 6 7 Reviewed by Antti Koivisto. 8 9 Rebaselined the tests that are now passing. 10 11 * web-platform-tests/cssom/CSSNamespaceRule-expected.txt: 12 * web-platform-tests/cssom/serialize-values-expected.txt: 13 1 14 2017-05-18 Daniel Bates <dabates@apple.com> 2 15 -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/media/controls/track-menu.html ¶
r217367 r219817 78 78 tester.test("First menu item checkmark image is visible") 79 79 .value(getComputedStyle(checkImage).content) 80 .contains( "url('data:image/svg+xml,<svg xmlns=");80 .contains('url("data:image/svg+xml,<svg xmlns='); 81 81 82 82 var menuItem = menuList.children[1]; -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/media/media-source/media-source-overlapping-append-expected.txt ¶
r217367 r219817 8 8 EVENT(updateend) 9 9 EXPECTED (bufferedSamples.length == '6') OK 10 {PTS({0/1000 , 0.000000}), DTS({0/1000, 0.000000}), duration({1000/1000,1.000000}), flags(1), generation(0)}11 {PTS({1000/1000 , 1.000000}), DTS({1000/1000, 1.000000}), duration({1000/1000,1.000000}), flags(0), generation(0)}12 {PTS({2000/1000 , 2.000000}), DTS({2000/1000, 2.000000}), duration({1000/1000,1.000000}), flags(0), generation(0)}13 {PTS({3000/1000 , 3.000000}), DTS({3000/1000, 3.000000}), duration({1000/1000,1.000000}), flags(1), generation(0)}14 {PTS({4000/1000 , 4.000000}), DTS({4000/1000, 4.000000}), duration({1000/1000,1.000000}), flags(0), generation(0)}15 {PTS({5000/1000 , 5.000000}), DTS({5000/1000, 5.000000}), duration({1000/1000,1.000000}), flags(0), generation(0)}10 {PTS({0/1000 = 0.000000}), DTS({0/1000 = 0.000000}), duration({1000/1000 = 1.000000}), flags(1), generation(0)} 11 {PTS({1000/1000 = 1.000000}), DTS({1000/1000 = 1.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(0)} 12 {PTS({2000/1000 = 2.000000}), DTS({2000/1000 = 2.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(0)} 13 {PTS({3000/1000 = 3.000000}), DTS({3000/1000 = 3.000000}), duration({1000/1000 = 1.000000}), flags(1), generation(0)} 14 {PTS({4000/1000 = 4.000000}), DTS({4000/1000 = 4.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(0)} 15 {PTS({5000/1000 = 5.000000}), DTS({5000/1000 = 5.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(0)} 16 16 RUN(sourceBuffer.appendBuffer(samples)) 17 17 EVENT(updateend) 18 18 EXPECTED (bufferedSamples.length == '6') OK 19 {PTS({0/1000 , 0.000000}), DTS({0/1000, 0.000000}), duration({1000/1000,1.000000}), flags(1), generation(1)}20 {PTS({1000/1000 , 1.000000}), DTS({1000/1000, 1.000000}), duration({1000/1000,1.000000}), flags(0), generation(1)}21 {PTS({2000/1000 , 2.000000}), DTS({2000/1000, 2.000000}), duration({1000/1000,1.000000}), flags(0), generation(1)}22 {PTS({3000/1000 , 3.000000}), DTS({3000/1000, 3.000000}), duration({1000/1000,1.000000}), flags(1), generation(1)}23 {PTS({4000/1000 , 4.000000}), DTS({4000/1000, 4.000000}), duration({1000/1000,1.000000}), flags(0), generation(1)}24 {PTS({5000/1000 , 5.000000}), DTS({5000/1000, 5.000000}), duration({1000/1000,1.000000}), flags(0), generation(1)}19 {PTS({0/1000 = 0.000000}), DTS({0/1000 = 0.000000}), duration({1000/1000 = 1.000000}), flags(1), generation(1)} 20 {PTS({1000/1000 = 1.000000}), DTS({1000/1000 = 1.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(1)} 21 {PTS({2000/1000 = 2.000000}), DTS({2000/1000 = 2.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(1)} 22 {PTS({3000/1000 = 3.000000}), DTS({3000/1000 = 3.000000}), duration({1000/1000 = 1.000000}), flags(1), generation(1)} 23 {PTS({4000/1000 = 4.000000}), DTS({4000/1000 = 4.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(1)} 24 {PTS({5000/1000 = 5.000000}), DTS({5000/1000 = 5.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(1)} 25 25 RUN(sourceBuffer.appendBuffer(samples)) 26 26 EVENT(updateend) 27 27 EXPECTED (bufferedSamples.length == '6') OK 28 {PTS({0/1000 , 0.000000}), DTS({0/1000, 0.000000}), duration({1000/1000,1.000000}), flags(1), generation(2)}29 {PTS({2000/1000 , 2.000000}), DTS({1000/1000, 1.000000}), duration({1000/1000,1.000000}), flags(0), generation(2)}30 {PTS({1000/1000 , 1.000000}), DTS({2000/1000, 2.000000}), duration({1000/1000,1.000000}), flags(0), generation(2)}31 {PTS({3000/1000 , 3.000000}), DTS({3000/1000, 3.000000}), duration({1000/1000,1.000000}), flags(1), generation(2)}32 {PTS({5000/1000 , 5.000000}), DTS({4000/1000, 4.000000}), duration({1000/1000,1.000000}), flags(0), generation(2)}33 {PTS({4000/1000 , 4.000000}), DTS({5000/1000, 5.000000}), duration({1000/1000,1.000000}), flags(0), generation(2)}28 {PTS({0/1000 = 0.000000}), DTS({0/1000 = 0.000000}), duration({1000/1000 = 1.000000}), flags(1), generation(2)} 29 {PTS({2000/1000 = 2.000000}), DTS({1000/1000 = 1.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(2)} 30 {PTS({1000/1000 = 1.000000}), DTS({2000/1000 = 2.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(2)} 31 {PTS({3000/1000 = 3.000000}), DTS({3000/1000 = 3.000000}), duration({1000/1000 = 1.000000}), flags(1), generation(2)} 32 {PTS({5000/1000 = 5.000000}), DTS({4000/1000 = 4.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(2)} 33 {PTS({4000/1000 = 4.000000}), DTS({5000/1000 = 5.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(2)} 34 34 END OF TEST 35 35 -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/media/media-source/media-source-overlapping-decodetime-expected.txt ¶
r217367 r219817 10 10 EVENT(updateend) 11 11 EXPECTED (bufferedSamples.length == '7') OK 12 {PTS({0/1000 , 0.000000}), DTS({0/1000, 0.000000}), duration({1000/1000,1.000000}), flags(1), generation(0)}13 {PTS({1000/1000 , 1.000000}), DTS({1000/1000, 1.000000}), duration({1000/1000,1.000000}), flags(0), generation(0)}14 {PTS({2000/1000 , 2.000000}), DTS({2000/1000, 2.000000}), duration({1000/1000,1.000000}), flags(0), generation(0)}15 {PTS({3000/1000 , 3.000000}), DTS({3000/1000, 3.000000}), duration({1000/1000,1.000000}), flags(1), generation(0)}16 {PTS({4000/1000 , 4.000000}), DTS({3000/1000, 3.000000}), duration({1000/1000,1.000000}), flags(1), generation(1)}17 {PTS({5000/1000 , 5.000000}), DTS({4000/1000, 4.000000}), duration({1000/1000,1.000000}), flags(0), generation(1)}18 {PTS({6000/1000 , 6.000000}), DTS({5000/1000, 5.000000}), duration({1000/1000,1.000000}), flags(0), generation(1)}12 {PTS({0/1000 = 0.000000}), DTS({0/1000 = 0.000000}), duration({1000/1000 = 1.000000}), flags(1), generation(0)} 13 {PTS({1000/1000 = 1.000000}), DTS({1000/1000 = 1.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(0)} 14 {PTS({2000/1000 = 2.000000}), DTS({2000/1000 = 2.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(0)} 15 {PTS({3000/1000 = 3.000000}), DTS({3000/1000 = 3.000000}), duration({1000/1000 = 1.000000}), flags(1), generation(0)} 16 {PTS({4000/1000 = 4.000000}), DTS({3000/1000 = 3.000000}), duration({1000/1000 = 1.000000}), flags(1), generation(1)} 17 {PTS({5000/1000 = 5.000000}), DTS({4000/1000 = 4.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(1)} 18 {PTS({6000/1000 = 6.000000}), DTS({5000/1000 = 5.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(1)} 19 19 END OF TEST 20 20 -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/media/media-source/media-source-seek-back-expected.txt ¶
r217367 r219817 13 13 EVENT(seeked) 14 14 EXPECTED (enqueuedSamples.length == '1') OK 15 {PTS({0/1000 , 0.000000}), DTS({0/1000, 0.000000}), duration({1000/1000,1.000000}), flags(1), generation(0)}15 {PTS({0/1000 = 0.000000}), DTS({0/1000 = 0.000000}), duration({1000/1000 = 1.000000}), flags(1), generation(0)} 16 16 END OF TEST 17 17 -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/media/media-source/media-source-sequence-timestamps-expected.txt ¶
r217367 r219817 8 8 EVENT(updateend) 9 9 EXPECTED (bufferedSamples.length == '6') OK 10 {PTS({0/1 , 0.000000}), DTS({0/1, 0.000000}), duration({1000/1000,1.000000}), flags(1), generation(0)}11 {PTS({1000/1000 , 1.000000}), DTS({1000/1000, 1.000000}), duration({1000/1000,1.000000}), flags(0), generation(0)}12 {PTS({2000/1000 , 2.000000}), DTS({2000/1000, 2.000000}), duration({1000/1000,1.000000}), flags(0), generation(0)}13 {PTS({3000/1000 , 3.000000}), DTS({3000/1000, 3.000000}), duration({1000/1000,1.000000}), flags(1), generation(0)}14 {PTS({4000/1000 , 4.000000}), DTS({4000/1000, 4.000000}), duration({1000/1000,1.000000}), flags(0), generation(0)}15 {PTS({5000/1000 , 5.000000}), DTS({5000/1000, 5.000000}), duration({1000/1000,1.000000}), flags(0), generation(0)}10 {PTS({0/1 = 0.000000}), DTS({0/1 = 0.000000}), duration({1000/1000 = 1.000000}), flags(1), generation(0)} 11 {PTS({1000/1000 = 1.000000}), DTS({1000/1000 = 1.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(0)} 12 {PTS({2000/1000 = 2.000000}), DTS({2000/1000 = 2.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(0)} 13 {PTS({3000/1000 = 3.000000}), DTS({3000/1000 = 3.000000}), duration({1000/1000 = 1.000000}), flags(1), generation(0)} 14 {PTS({4000/1000 = 4.000000}), DTS({4000/1000 = 4.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(0)} 15 {PTS({5000/1000 = 5.000000}), DTS({5000/1000 = 5.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(0)} 16 16 END OF TEST 17 17 -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/media/media-source/media-source-timeoffset-expected.txt ¶
r217367 r219817 9 9 EVENT(updateend) 10 10 EXPECTED (bufferedSamples.length == '6') OK 11 {PTS({100000000/10000000 , 10.000000}), DTS({100000000/10000000, 10.000000}), duration({1000/1000,1.000000}), flags(1), generation(0)}12 {PTS({110000000/10000000 , 11.000000}), DTS({110000000/10000000, 11.000000}), duration({1000/1000,1.000000}), flags(0), generation(0)}13 {PTS({120000000/10000000 , 12.000000}), DTS({120000000/10000000, 12.000000}), duration({1000/1000,1.000000}), flags(0), generation(0)}14 {PTS({130000000/10000000 , 13.000000}), DTS({130000000/10000000, 13.000000}), duration({1000/1000,1.000000}), flags(1), generation(0)}15 {PTS({140000000/10000000 , 14.000000}), DTS({140000000/10000000, 14.000000}), duration({1000/1000,1.000000}), flags(0), generation(0)}16 {PTS({150000000/10000000 , 15.000000}), DTS({150000000/10000000, 15.000000}), duration({1000/1000,1.000000}), flags(0), generation(0)}11 {PTS({100000000/10000000 = 10.000000}), DTS({100000000/10000000 = 10.000000}), duration({1000/1000 = 1.000000}), flags(1), generation(0)} 12 {PTS({110000000/10000000 = 11.000000}), DTS({110000000/10000000 = 11.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(0)} 13 {PTS({120000000/10000000 = 12.000000}), DTS({120000000/10000000 = 12.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(0)} 14 {PTS({130000000/10000000 = 13.000000}), DTS({130000000/10000000 = 13.000000}), duration({1000/1000 = 1.000000}), flags(1), generation(0)} 15 {PTS({140000000/10000000 = 14.000000}), DTS({140000000/10000000 = 14.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(0)} 16 {PTS({150000000/10000000 = 15.000000}), DTS({150000000/10000000 = 15.000000}), duration({1000/1000 = 1.000000}), flags(0), generation(0)} 17 17 END OF TEST 18 18 -
TabularUnified releases/WebKitGTK/webkit-2.16/LayoutTests/platform/gtk/fast/forms/menulist-typeahead-find.html ¶
r217367 r219817 20 20 if (!window.eventSender) 21 21 return; 22 23 // Reset menu list to initial state. 24 menulist.selectedIndex = 0; 25 menulist.blur(); 22 26 23 27 eventSender.mouseMoveTo(menulist.offsetLeft + (menulist.offsetWidth / 2), menulist.offsetTop + (menulist.offsetHeight / 2)); -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/ChangeLog ¶
r217367 r219817 1 2017-07-24 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 Unreviewed. Fix the build with GCC 4.9 after merge r217438. 4 5 * bytecompiler/BytecodeGenerator.h: 6 (JSC::StructureForInContext::addGetInst): 7 8 2017-06-26 Saam Barati <sbarati@apple.com> 9 10 Crash in JSC::Lexer<unsigned char>::setCode 11 https://bugs.webkit.org/show_bug.cgi?id=172754 12 13 Reviewed by Mark Lam. 14 15 The lexer was asking one of its buffers to reserve initial space that 16 was O(text size in bytes). For large sources, this would end up causing 17 the vector to overflow and crash. This patch changes this code be like 18 the Lexer's other buffers and to only reserve a small starting buffer. 19 20 * parser/Lexer.cpp: 21 (JSC::Lexer<T>::setCode): 22 23 2017-04-13 Mark Lam <mark.lam@apple.com> 24 25 Should use flushDirect() when flushing the scopeRegister due to needsScopeRegister(). 26 https://bugs.webkit.org/show_bug.cgi?id=170661 27 <rdar://problem/31579046> 28 29 Reviewed by Filip Pizlo. 30 31 Previously, we were using flush() to flush the outermost frame's scopeRegister. 32 This is incorrect because flush() expects the VirtualRegister value passed to 33 it to be that of the top most inlined frame. In the event that we reach a 34 terminal condition while inside an inlined frame, flush() will end up flushing 35 the wrong register. The fix is simply to use flushDirect() instead. 36 37 * dfg/DFGByteCodeParser.cpp: 38 (JSC::DFG::ByteCodeParser::flush): 39 40 2017-04-20 Mark Lam <mark.lam@apple.com> 41 42 virtualThunkFor() needs to materialize its of tagMaskRegister for tail calls. 43 https://bugs.webkit.org/show_bug.cgi?id=171079 44 <rdar://problem/31684756> 45 46 Reviewed by Saam Barati. 47 48 This is needed because tail calls would restore callee saved registers (and 49 therefore, potentially clobber the tag registers) before jumping to the thunk. 50 51 * jit/ThunkGenerators.cpp: 52 (JSC::virtualThunkFor): 53 54 2017-05-05 Keith Miller <keith_miller@apple.com> 55 56 Put does not properly consult the prototype chain 57 https://bugs.webkit.org/show_bug.cgi?id=171754 58 59 Reviewed by Saam Barati. 60 61 We should do a follow up that cleans up the rest of put. See: 62 https://bugs.webkit.org/show_bug.cgi?id=171759 63 64 * runtime/JSCJSValue.cpp: 65 (JSC::JSValue::putToPrimitive): 66 * runtime/JSObject.cpp: 67 (JSC::JSObject::putInlineSlow): 68 * runtime/JSObjectInlines.h: 69 (JSC::JSObject::canPerformFastPutInline): 70 71 2017-07-24 Carlos Garcia Campos <cgarcia@igalia.com> 72 73 Unreviewed. Fix merge r217438. 74 75 See bug #174781. 76 77 * bytecompiler/BytecodeGenerator.cpp: 78 (JSC::StructureForInContext::finalize): Use operand instead of unsignedValue. 79 80 2017-05-05 Saam Barati <sbarati@apple.com> 81 82 putDirectIndex does not properly do defineOwnProperty 83 https://bugs.webkit.org/show_bug.cgi?id=171591 84 <rdar://problem/31735695> 85 86 Reviewed by Geoffrey Garen. 87 88 This patch fixes putDirectIndex and its JIT implementations to be 89 compatible with the ES6 spec. I think our code became out of date 90 when we implemented ArraySpeciesCreate since ArraySpeciesCreate may 91 return arbitrary objects. We perform putDirectIndex on that arbitrary 92 object. The behavior we want is as if we performed defineProperty({configurable:true, enumerable:true, writable:true}). 93 However, we weren't doing this. putDirectIndex assumed it could just splat 94 data into any descendent of JSObject's butterfly. For example, this means 95 we'd just splat into the butterfly of a typed array, even though a typed 96 array doesn't use its butterfly to store its indexed properties in the usual 97 way. Also, typed array properties are non-configurable, so this operation 98 should throw. This also means if we saw a ProxyObject, we'd just splat 99 into its butterfly, but this is obviously wrong because ProxyObject should 100 intercept the defineProperty operation. 101 102 This patch fixes this issue by adding a whitelist of cell types that can 103 go down putDirectIndex's fast path. Anything not in that whitelist will 104 simply call into defineOwnProperty. 105 106 * bytecode/ByValInfo.h: 107 (JSC::jitArrayModePermitsPutDirect): 108 * dfg/DFGArrayMode.cpp: 109 (JSC::DFG::ArrayMode::refine): 110 * jit/JITOperations.cpp: 111 * runtime/ArrayPrototype.cpp: 112 (JSC::arrayProtoFuncSplice): 113 * runtime/ClonedArguments.cpp: 114 (JSC::ClonedArguments::createStructure): 115 * runtime/JSGenericTypedArrayViewInlines.h: 116 (JSC::JSGenericTypedArrayView<Adaptor>::defineOwnProperty): 117 * runtime/JSObject.cpp: 118 (JSC::canDoFastPutDirectIndex): 119 (JSC::JSObject::defineOwnIndexedProperty): 120 (JSC::JSObject::putDirectIndexSlowOrBeyondVectorLength): 121 (JSC::JSObject::putDirectIndexBeyondVectorLength): Deleted. 122 * runtime/JSObject.h: 123 (JSC::JSObject::putDirectIndex): 124 (JSC::JSObject::canSetIndexQuicklyForPutDirect): Deleted. 125 * runtime/JSType.h: 126 127 2017-05-17 Filip Pizlo <fpizlo@apple.com> 128 129 JSC: Incorrect LoadVarargs handling in ArgumentsEliminationPhase::transform 130 https://bugs.webkit.org/show_bug.cgi?id=172208 131 132 Reviewed by Saam Barati. 133 134 * dfg/DFGArgumentsEliminationPhase.cpp: 135 136 2017-04-17 Mark Lam <mark.lam@apple.com> 137 138 JSArray::appendMemcpy() needs to handle copying from Undecided indexing type too. 139 https://bugs.webkit.org/show_bug.cgi?id=170896 140 <rdar://problem/31651319> 141 142 Reviewed by JF Bastien and Keith Miller. 143 144 * runtime/JSArray.cpp: 145 (JSC::JSArray::appendMemcpy): 146 147 2017-05-25 Saam Barati <sbarati@apple.com> 148 149 Our for-in optimization in the bytecode generator does its static analysis incorrectly 150 https://bugs.webkit.org/show_bug.cgi?id=172532 151 <rdar://problem/32369452> 152 153 Reviewed by Mark Lam. 154 155 Our static analysis for when a for-in induction variable 156 is written to tried to its analysis as we generate 157 bytecode. This has issues, since it does not account for 158 the dynamic execution path of the program. Let's consider 159 a program where our old analysis worked: 160 161 ``` 162 for (let p in o) { 163 o[p]; // We can transform this into a fast get_direct_pname 164 p = 20; 165 o[p]; // We cannot transform this since p has been changed. 166 } 167 ``` 168 169 However, our static analysis did not account for loops, which exist 170 in JavaScript. e.g, it would incorrectly compile this program as: 171 ``` 172 for (let p in o) { 173 for (let i = 0; i < 20; ++i) { 174 o[p]; // It transforms this to use get_direct_pname even though p will be over-written if we get here from the inner loop back edge! 175 p = 20; 176 o[p]; // We correctly do not transform this. 177 } 178 } 179 ``` 180 181 Because of this flaw, I've made the optimization more conservative. 182 We now optimistically emit code for the optimized access. However, 183 if a for-in context is *ever* invalidated, before we pop it off 184 the stack, we rewrite the program's optimized accesses to no longer 185 be optimized. To do this, each context keeps track of its optimized 186 accesses. 187 188 This patch also adds a new bytecode, op_nop, which is just a no-op. 189 It was helpful to add this because reverting get_direct_pname to get_by_val 190 will leave us with an extra instruction word because get_direct_pname is 191 has a length of 7 where get_by_val has a length of 6. This leaves us with 192 an extra slot that we fill with an op_nop. 193 194 * bytecode/BytecodeDumper.cpp: 195 (JSC::BytecodeDumper<Block>::dumpBytecode): 196 * bytecode/BytecodeList.json: 197 * bytecode/BytecodeUseDef.h: 198 (JSC::computeUsesForBytecodeOffset): 199 (JSC::computeDefsForBytecodeOffset): 200 * bytecompiler/BytecodeGenerator.cpp: 201 (JSC::BytecodeGenerator::emitGetByVal): 202 (JSC::BytecodeGenerator::popIndexedForInScope): 203 (JSC::BytecodeGenerator::popStructureForInScope): 204 (JSC::BytecodeGenerator::invalidateForInContextForLocal): 205 (JSC::StructureForInContext::pop): 206 (JSC::IndexedForInContext::pop): 207 * bytecompiler/BytecodeGenerator.h: 208 (JSC::StructureForInContext::addGetInst): 209 (JSC::IndexedForInContext::addGetInst): 210 * dfg/DFGByteCodeParser.cpp: 211 (JSC::DFG::ByteCodeParser::parseBlock): 212 * dfg/DFGCapabilities.cpp: 213 (JSC::DFG::capabilityLevel): 214 * jit/JIT.cpp: 215 (JSC::JIT::privateCompileMainPass): 216 * jit/JIT.h: 217 * jit/JITOpcodes.cpp: 218 (JSC::JIT::emit_op_nop): 219 * llint/LowLevelInterpreter.asm: 220 221 2017-04-14 Saam Barati <sbarati@apple.com> 222 223 ParseInt intrinsic in DFG backend doesn't properly flush its operands 224 https://bugs.webkit.org/show_bug.cgi?id=170865 225 226 Reviewed by Mark Lam and Geoffrey Garen. 227 228 The DFG backend code needed to first call .gpr()/.jsValueRegs() 229 before calling flushRegisters(), or the input JSValueOperand would 230 not be flushed. 231 232 * dfg/DFGSpeculativeJIT.cpp: 233 (JSC::DFG::SpeculativeJIT::compileParseInt): 234 235 2017-06-16 Konstantin Tokarev <annulen@yandex.ru> 236 237 REGRESSION(r166799): LogsPageMessagesToSystemConsoleEnabled corrupts non-ASCII characters 238 https://bugs.webkit.org/show_bug.cgi?id=173470 239 240 Reviewed by Joseph Pecoraro. 241 242 ConsoleClient::printConsoleMessageWithArguments() incorrectly uses 243 const char* overload of StringBuilder::append() that assummes Latin1 244 encoding, not UTF8. 245 246 * runtime/ConsoleClient.cpp: 247 (JSC::ConsoleClient::printConsoleMessageWithArguments): 248 249 2017-06-01 Tomas Popela <tpopela@redhat.com>, Mark Lam <mark.lam@apple.com> 250 251 RELEASE_ASSERT_NOT_REACHED() in InferredType::kindForFlags() on Big-Endians 252 https://bugs.webkit.org/show_bug.cgi?id=170945 253 254 Reviewed by Mark Lam. 255 256 Re-define PutByIdFlags as a int32_t enum explicitly because it is 257 stored as an int32_t value in UnlinkedInstruction. This prevents 258 a bug on 64-bit big endian architectures where the word order is 259 inverted (when we convert the UnlinkedInstruction into a CodeBlock 260 Instruction), resulting in the PutByIdFlags value not being stored in 261 the 32-bit word that the rest of the code expects it to be in. 262 263 * bytecode/PutByIdFlags.h: 264 1 265 2017-05-10 Mark Lam <mark.lam@apple.com> 2 266 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/bytecode/ByValInfo.h ¶
r217367 r219817 165 165 } 166 166 167 inline bool jitArrayModePermitsPutDirect(JITArrayMode mode) 168 { 169 // We don't allow typed array putDirect here since putDirect has 170 // defineOwnProperty({configurable: true, writable:true, enumerable:true}) 171 // semantics. Typed array indexed properties are non-configurable by 172 // default, so we can't simply store to a typed array for putDirect. 173 // 174 // We could model putDirect on ScopedArguments and DirectArguments, but we 175 // haven't found any performance incentive to do it yet. 176 switch (mode) { 177 case JITInt32: 178 case JITDouble: 179 case JITContiguous: 180 case JITArrayStorage: 181 return true; 182 default: 183 return false; 184 } 185 } 186 167 187 inline TypedArrayType typedArrayTypeForJITArrayMode(JITArrayMode mode) 168 188 { -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/bytecode/BytecodeList.json ¶
r217367 r219817 153 153 { "name" : "op_watchdog", "length" : 1 }, 154 154 { "name" : "op_log_shadow_chicken_prologue", "length" : 2}, 155 { "name" : "op_log_shadow_chicken_tail", "length" : 3} 155 { "name" : "op_log_shadow_chicken_tail", "length" : 3}, 156 { "name" : "op_nop", "length" : 1 } 156 157 ] 157 158 }, -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/bytecode/BytecodeUseDef.h ¶
r217367 r219817 56 56 case op_watchdog: 57 57 case op_get_argument: 58 case op_nop: 58 59 return; 59 60 case op_assert: … … 364 365 case op_log_shadow_chicken_tail: 365 366 case op_yield: 367 case op_nop: 366 368 #define LLINT_HELPER_OPCODES(opcode, length) case opcode: 367 369 FOR_EACH_LLINT_OPCODE_EXTENSION(LLINT_HELPER_OPCODES); -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/bytecode/CodeBlock.cpp ¶
r217367 r219817 1388 1388 case op_watchdog: { 1389 1389 printLocationAndOp(out, exec, location, it, "watchdog"); 1390 break; 1391 } 1392 case op_nop: { 1393 printLocationAndOp(out, exec, location, it, "nop"); 1390 1394 break; 1391 1395 } -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/bytecode/PutByIdFlags.h ¶
r217367 r219817 30 30 namespace JSC { 31 31 32 enum PutByIdFlags : int ptr_t {32 enum PutByIdFlags : int32_t { 33 33 PutByIdNone = 0, 34 34 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp ¶
r217367 r219817 2794 2794 RegisterID* BytecodeGenerator::emitGetByVal(RegisterID* dst, RegisterID* base, RegisterID* property) 2795 2795 { 2796 for (size_t i = m_forInContextStack.size(); i > 0; i--) {2797 ForInContext& context = m_forInContextStack[i - 1].get();2796 for (size_t i = m_forInContextStack.size(); i--; ) { 2797 ForInContext& context = m_forInContextStack[i].get(); 2798 2798 if (context.local() != property) 2799 2799 continue; 2800 2800 2801 if (!context.isValid()) 2802 break; 2801 unsigned instIndex = instructions().size(); 2803 2802 2804 2803 if (context.type() == ForInContext::IndexedForInContextType) { 2804 static_cast<IndexedForInContext&>(context).addGetInst(instIndex, property->index()); 2805 2805 property = static_cast<IndexedForInContext&>(context).index(); 2806 2806 break; … … 2816 2816 instructions().append(structureContext.enumerator()->index()); 2817 2817 instructions().append(profile); 2818 2819 structureContext.addGetInst(instIndex, property->index(), profile); 2818 2820 return dst; 2819 2821 } … … 4488 4490 if (!localRegister) 4489 4491 return; 4492 4493 ASSERT(m_forInContextStack.last()->type() == ForInContext::IndexedForInContextType); 4494 static_cast<IndexedForInContext&>(m_forInContextStack.last().get()).finalize(*this); 4490 4495 m_forInContextStack.removeLast(); 4491 4496 } … … 4596 4601 if (!localRegister) 4597 4602 return; 4603 ASSERT(m_forInContextStack.last()->type() == ForInContext::StructureForInContextType); 4604 static_cast<StructureForInContext&>(m_forInContextStack.last().get()).finalize(*this); 4598 4605 m_forInContextStack.removeLast(); 4599 4606 } … … 4612 4619 // reassigned, or we'd have to resort to runtime checks to see if the variable had been 4613 4620 // reassigned from its original value. 4614 for (size_t i = m_forInContextStack.size(); i > 0; i--) {4615 ForInContext& context = m_forInContextStack[i - 1].get();4621 for (size_t i = m_forInContextStack.size(); i--; ) { 4622 ForInContext& context = m_forInContextStack[i].get(); 4616 4623 if (context.local() != localRegister) 4617 4624 continue; … … 4967 4974 } 4968 4975 4976 void StructureForInContext::finalize(BytecodeGenerator& generator) 4977 { 4978 if (isValid()) 4979 return; 4980 4981 for (const auto& instTuple : m_getInsts) { 4982 unsigned instIndex = std::get<0>(instTuple); 4983 int propertyRegIndex = std::get<1>(instTuple); 4984 UnlinkedValueProfile valueProfile = std::get<2>(instTuple); 4985 OpcodeID op = generator.instructions()[instIndex].u.opcode; 4986 RELEASE_ASSERT(op == op_get_direct_pname); 4987 ASSERT(opcodeLength(op_get_direct_pname) == 7); 4988 ASSERT(opcodeLength(op_get_by_val) == 6); 4989 4990 // 0. Change the opcode to get_by_val. 4991 generator.instructions()[instIndex].u.opcode = op_get_by_val; 4992 // 1. dst stays the same. 4993 // 2. base stays the same. 4994 // 3. property gets switched to the original property. 4995 generator.instructions()[instIndex + 3].u.operand = propertyRegIndex; 4996 // 4. add an array profile. 4997 generator.instructions()[instIndex + 4].u.operand = generator.newArrayProfile(); 4998 // 5. set the result value profile. 4999 generator.instructions()[instIndex + 5].u.operand = valueProfile; 5000 // 6. nop out the last instruction word. 5001 generator.instructions()[instIndex + 6].u.opcode = op_nop; 5002 } 5003 } 5004 5005 void IndexedForInContext::finalize(BytecodeGenerator& generator) 5006 { 5007 if (isValid()) 5008 return; 5009 5010 for (const auto& instPair : m_getInsts) { 5011 unsigned instIndex = instPair.first; 5012 int propertyRegIndex = instPair.second; 5013 OpcodeID op = generator.instructions()[instIndex].u.opcode; 5014 RELEASE_ASSERT(op == op_get_by_val); 5015 // We just need to perform the get_by_val with the original property here, 5016 // not the indexed one. 5017 generator.instructions()[instIndex + 3].u.operand = propertyRegIndex; 5018 } 5019 } 5020 4969 5021 } // namespace JSC 4970 5022 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h ¶
r217367 r219817 222 222 RegisterID* enumerator() const { return m_enumeratorRegister.get(); } 223 223 224 void addGetInst(unsigned instIndex, int propertyRegIndex, UnlinkedValueProfile valueProfile) 225 { 226 m_getInsts.append(std::tuple<unsigned, int, UnlinkedValueProfile>(instIndex, propertyRegIndex, valueProfile)); 227 } 228 229 void finalize(BytecodeGenerator&); 230 224 231 private: 225 232 RefPtr<RegisterID> m_indexRegister; 226 233 RefPtr<RegisterID> m_propertyRegister; 227 234 RefPtr<RegisterID> m_enumeratorRegister; 235 Vector<std::tuple<unsigned, int, UnlinkedValueProfile>> m_getInsts; 228 236 }; 229 237 … … 243 251 RegisterID* index() const { return m_indexRegister.get(); } 244 252 253 void finalize(BytecodeGenerator&); 254 void addGetInst(unsigned instIndex, int propertyIndex) { m_getInsts.append({ instIndex, propertyIndex }); } 255 245 256 private: 246 257 RefPtr<RegisterID> m_indexRegister; 258 Vector<std::pair<unsigned, int>> m_getInsts; 247 259 }; 248 260 … … 915 927 void prepareLexicalScopeForNextForLoopIteration(VariableEnvironmentNode*, RegisterID* loopSymbolTable); 916 928 int labelScopeDepth() const; 929 UnlinkedArrayProfile newArrayProfile(); 917 930 918 931 private: … … 924 937 UnlinkedArrayAllocationProfile newArrayAllocationProfile(); 925 938 UnlinkedObjectAllocationProfile newObjectAllocationProfile(); 926 UnlinkedArrayProfile newArrayProfile();927 939 UnlinkedValueProfile emitProfiledOpcode(OpcodeID); 928 940 int kill(RegisterID* dst) -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/dfg/DFGArgumentsEliminationPhase.cpp ¶
r217367 r219817 846 846 storeValue(undefined, storeIndex); 847 847 } 848 849 node->remove(); 850 node->origin.exitOK = canExit; 851 break; 848 852 } 849 850 node->remove();851 node->origin.exitOK = canExit;852 break;853 853 } 854 854 } else { -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/dfg/DFGArrayMode.cpp ¶
r217367 r219817 187 187 // to value profiling, but the array profile tells us something else, then we 188 188 // should just trust the array profile. 189 190 auto typedArrayResult = [&] (ArrayMode result) -> ArrayMode { 191 if (node->op() == PutByValDirect) { 192 // This is semantically identical to defineOwnProperty({configurable: true, writable:true, enumerable:true}), 193 // which we can't model as a simple store to the typed array since typed array indexed properties 194 // are non-configurable. 195 return ArrayMode(Array::Generic); 196 } 197 return result; 198 }; 189 199 190 200 switch (type()) { … … 236 246 case Array::Float32Array: 237 247 case Array::Float64Array: 238 switch (node->op()) { 239 case PutByVal: 248 if (node->op() == PutByVal) { 240 249 if (graph.hasExitSite(node->origin.semantic, OutOfBounds) || !isInBounds()) 241 return withSpeculation(Array::OutOfBounds); 242 return withSpeculation(Array::InBounds); 243 default: 244 return withSpeculation(Array::InBounds); 245 } 246 return *this; 250 return typedArrayResult(withSpeculation(Array::OutOfBounds)); 251 } 252 return typedArrayResult(withSpeculation(Array::InBounds)); 247 253 case Array::Unprofiled: 248 254 case Array::SelectUsingPredictions: { … … 275 281 break; 276 282 } 277 283 278 284 if (isInt8ArraySpeculation(base)) 279 return result.withType(Array::Int8Array);285 return typedArrayResult(result.withType(Array::Int8Array)); 280 286 281 287 if (isInt16ArraySpeculation(base)) 282 return result.withType(Array::Int16Array);288 return typedArrayResult(result.withType(Array::Int16Array)); 283 289 284 290 if (isInt32ArraySpeculation(base)) 285 return result.withType(Array::Int32Array);291 return typedArrayResult(result.withType(Array::Int32Array)); 286 292 287 293 if (isUint8ArraySpeculation(base)) 288 return result.withType(Array::Uint8Array);294 return typedArrayResult(result.withType(Array::Uint8Array)); 289 295 290 296 if (isUint8ClampedArraySpeculation(base)) 291 return result.withType(Array::Uint8ClampedArray);297 return typedArrayResult(result.withType(Array::Uint8ClampedArray)); 292 298 293 299 if (isUint16ArraySpeculation(base)) 294 return result.withType(Array::Uint16Array);300 return typedArrayResult(result.withType(Array::Uint16Array)); 295 301 296 302 if (isUint32ArraySpeculation(base)) 297 return result.withType(Array::Uint32Array);303 return typedArrayResult(result.withType(Array::Uint32Array)); 298 304 299 305 if (isFloat32ArraySpeculation(base)) 300 return result.withType(Array::Float32Array);306 return typedArrayResult(result.withType(Array::Float32Array)); 301 307 302 308 if (isFloat64ArraySpeculation(base)) 303 return result.withType(Array::Float64Array);309 return typedArrayResult(result.withType(Array::Float64Array)); 304 310 305 311 if (type() == Array::Unprofiled) -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp ¶
r217367 r219817 626 626 flushDirect(virtualRegisterForArgument(0)); 627 627 if (m_graph.needsScopeRegister()) 628 flush (m_codeBlock->scopeRegister());628 flushDirect(m_codeBlock->scopeRegister()); 629 629 } 630 630 … … 5409 5409 NEXT_OPCODE(op_watchdog); 5410 5410 } 5411 5412 case op_nop: { 5413 addToGraph(Check); // We add a nop here so that basic block linking doesn't break. 5414 NEXT_OPCODE(op_nop); 5415 } 5411 5416 5412 5417 case op_create_lexical_environment: { -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/dfg/DFGCapabilities.cpp ¶
r217367 r219817 189 189 case op_loop_hint: 190 190 case op_watchdog: 191 case op_nop: 191 192 case op_ret: 192 193 case op_end: -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp ¶
r217367 r219817 3140 3140 if (node->child1().useKind() == UntypedUse) { 3141 3141 JSValueOperand value(this, node->child1()); 3142 #if USE(JSVALUE64) 3143 auto result = resultRegs.gpr(); 3144 auto valueReg = value.gpr(); 3145 #else 3146 auto result = resultRegs; 3147 auto valueReg = value.jsValueRegs(); 3148 #endif 3142 3149 3143 3150 flushRegisters(); 3144 #if USE(JSVALUE64) 3145 callOperation(operationParseIntGeneric, resultRegs.gpr(), value.gpr(), radixGPR); 3146 #else 3147 callOperation(operationParseIntGeneric, resultRegs, value.jsValueRegs(), radixGPR); 3148 #endif 3151 callOperation(operationParseIntGeneric, result, valueReg, radixGPR); 3149 3152 m_jit.exceptionCheck(); 3150 3153 } else { … … 3153 3156 speculateString(node->child1(), valueGPR); 3154 3157 3158 #if USE(JSVALUE64) 3159 auto result = resultRegs.gpr(); 3160 #else 3161 auto result = resultRegs; 3162 #endif 3163 3155 3164 flushRegisters(); 3156 #if USE(JSVALUE64) 3157 callOperation(operationParseIntString, resultRegs.gpr(), valueGPR, radixGPR); 3158 #else 3159 callOperation(operationParseIntString, resultRegs, valueGPR, radixGPR); 3160 #endif 3165 callOperation(operationParseIntString, result, valueGPR, radixGPR); 3161 3166 m_jit.exceptionCheck(); 3162 3167 } … … 3164 3169 if (node->child1().useKind() == UntypedUse) { 3165 3170 JSValueOperand value(this, node->child1()); 3171 #if USE(JSVALUE64) 3172 auto result = resultRegs.gpr(); 3173 #else 3174 auto result = resultRegs; 3175 #endif 3176 JSValueRegs valueRegs = value.jsValueRegs(); 3166 3177 3167 3178 flushRegisters(); 3168 #if USE(JSVALUE64) 3169 callOperation(operationParseIntNoRadixGeneric, resultRegs.gpr(), value.jsValueRegs()); 3170 #else 3171 callOperation(operationParseIntNoRadixGeneric, resultRegs, value.jsValueRegs()); 3172 #endif 3179 callOperation(operationParseIntNoRadixGeneric, result, valueRegs); 3173 3180 m_jit.exceptionCheck(); 3174 3181 } else { -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/jit/JIT.cpp ¶
r217367 r219817 330 330 DEFINE_OP(op_loop_hint) 331 331 DEFINE_OP(op_watchdog) 332 DEFINE_OP(op_nop) 332 333 DEFINE_OP(op_lshift) 333 334 DEFINE_OP(op_mod) -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/jit/JIT.h ¶
r217367 r219817 532 532 void emit_op_loop_hint(Instruction*); 533 533 void emit_op_watchdog(Instruction*); 534 void emit_op_nop(Instruction*); 534 535 void emit_op_lshift(Instruction*); 535 536 void emit_op_mod(Instruction*); -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/jit/JITOpcodes.cpp ¶
r217367 r219817 957 957 } 958 958 959 void JIT::emit_op_nop(Instruction*) 960 { 961 } 962 959 963 void JIT::emit_op_new_regexp(Instruction* currentInstruction) 960 964 { -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/jit/JITOperations.cpp ¶
r217367 r219817 548 548 uint32_t index = subscript.asUInt32(); 549 549 ASSERT(isIndex(index)); 550 if (baseObject->canSetIndexQuicklyForPutDirect(index)) { 551 baseObject->setIndexQuickly(callFrame->vm(), index, value); 552 return; 553 } 554 555 // FIXME: This will make us think that in-bounds typed array accesses are actually 556 // out-of-bounds. 557 // https://bugs.webkit.org/show_bug.cgi?id=149886 558 byValInfo->arrayProfile->setOutOfBounds(); 550 551 switch (baseObject->indexingType()) { 552 case ALL_INT32_INDEXING_TYPES: 553 case ALL_DOUBLE_INDEXING_TYPES: 554 case ALL_CONTIGUOUS_INDEXING_TYPES: 555 case ALL_ARRAY_STORAGE_INDEXING_TYPES: 556 if (index < baseObject->butterfly()->vectorLength()) 557 break; 558 FALLTHROUGH; 559 default: 560 byValInfo->arrayProfile->setOutOfBounds(); 561 break; 562 } 563 559 564 baseObject->putDirectIndex(callFrame, index, value, 0, isStrictMode ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow); 560 565 return; … … 696 701 // Attempt to optimize. 697 702 JITArrayMode arrayMode = jitArrayModeForStructure(structure); 698 if (jitArrayModePermitsPut (arrayMode) && arrayMode != byValInfo->arrayMode) {703 if (jitArrayModePermitsPutDirect(arrayMode) && arrayMode != byValInfo->arrayMode) { 699 704 CodeBlock* codeBlock = exec->codeBlock(); 700 705 ConcurrentJSLocker locker(codeBlock->m_lock); -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/jit/ThunkGenerators.cpp ¶
r217367 r219817 184 184 185 185 #if USE(JSVALUE64) 186 GPRReg tagMaskRegister = GPRInfo::tagMaskRegister; 187 if (callLinkInfo.isTailCall()) { 188 // Tail calls could have clobbered the GPRInfo::tagMaskRegister because they 189 // restore callee saved registers before getthing here. So, let's materialize 190 // the TagMask in a temp register and use the temp instead. 191 tagMaskRegister = GPRInfo::regT4; 192 jit.move(CCallHelpers::TrustedImm64(TagMask), tagMaskRegister); 193 } 186 194 slowCase.append( 187 jit.branchTest64( 188 CCallHelpers::NonZero, GPRInfo::regT0, GPRInfo::tagMaskRegister)); 195 jit.branchTest64(CCallHelpers::NonZero, GPRInfo::regT0, tagMaskRegister)); 189 196 #else 190 197 slowCase.append( -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/llint/LowLevelInterpreter.asm ¶
r217367 r219817 1574 1574 1575 1575 1576 _llint_op_nop: 1577 dispatch(1) 1578 1579 1576 1580 _llint_op_switch_string: 1577 1581 traceExecution() -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/parser/Lexer.cpp ¶
r217367 r219817 565 565 566 566 m_buffer8.reserveInitialCapacity(initialReadBufferCapacity); 567 m_buffer16.reserveInitialCapacity( (m_codeEnd - m_code) / 2);567 m_buffer16.reserveInitialCapacity(initialReadBufferCapacity); 568 568 m_bufferForRawTemplateString16.reserveInitialCapacity(initialReadBufferCapacity); 569 569 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/runtime/ArrayPrototype.cpp ¶
r217367 r219817 1030 1030 1031 1031 if (!result) { 1032 if (speciesResult.first == SpeciesConstructResult::CreatedObject) {1032 if (speciesResult.first == SpeciesConstructResult::CreatedObject) 1033 1033 result = speciesResult.second; 1034 1035 for (unsigned k = 0; k < actualDeleteCount; ++k) { 1036 JSValue v = getProperty(exec, thisObj, k + actualStart); 1037 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 1038 if (UNLIKELY(!v)) 1039 continue; 1040 result->putByIndexInline(exec, k, v, true); 1041 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 1042 } 1043 } else { 1034 else { 1044 1035 result = JSArray::tryCreate(vm, exec->lexicalGlobalObject()->arrayStructureForIndexingTypeDuringAllocation(ArrayWithUndecided), actualDeleteCount); 1045 1036 if (UNLIKELY(!result)) { … … 1047 1038 return encodedJSValue(); 1048 1039 } 1049 1050 for (unsigned k = 0; k < actualDeleteCount; ++k) { 1051 JSValue v = getProperty(exec, thisObj, k + actualStart); 1052 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 1053 if (UNLIKELY(!v)) 1054 continue; 1055 result->putDirectIndex(exec, k, v); 1056 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 1057 } 1040 } 1041 for (unsigned k = 0; k < actualDeleteCount; ++k) { 1042 JSValue v = getProperty(exec, thisObj, k + actualStart); 1043 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 1044 if (UNLIKELY(!v)) 1045 continue; 1046 result->putDirectIndex(exec, k, v, 0, PutDirectIndexShouldThrow); 1047 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 1058 1048 } 1059 1049 } -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/runtime/ClonedArguments.cpp ¶
r217367 r219817 154 154 Structure* ClonedArguments::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype, IndexingType indexingType) 155 155 { 156 Structure* structure = Structure::create(vm, globalObject, prototype, TypeInfo( ObjectType, StructureFlags), info(), indexingType);156 Structure* structure = Structure::create(vm, globalObject, prototype, TypeInfo(ClonedArgumentsType, StructureFlags), info(), indexingType); 157 157 PropertyOffset offset; 158 158 structure = structure->addPropertyTransition(vm, structure, vm.propertyNames->length, DontEnum, offset); -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/runtime/ConsoleClient.cpp ¶
r217367 r219817 166 166 String argAsString = arguments->argumentAt(i).toString(arguments->globalState()); 167 167 builder.append(' '); 168 builder.append(argAsString .utf8().data());168 builder.append(argAsString); 169 169 } 170 170 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/runtime/JSArray.cpp ¶
r217367 r219817 482 482 483 483 IndexingType type = indexingType(); 484 IndexingType copyType = mergeIndexingTypeForCopying(otherArray->indexingType()); 484 IndexingType otherType = otherArray->indexingType(); 485 IndexingType copyType = mergeIndexingTypeForCopying(otherType); 485 486 if (type == ArrayWithUndecided && copyType != NonArray) { 486 487 if (copyType == ArrayWithInt32) … … 516 517 ASSERT(copyType == indexingType()); 517 518 518 if (type == ArrayWithDouble) 519 if (UNLIKELY(otherType == ArrayWithUndecided)) { 520 auto* butterfly = this->butterfly(); 521 if (type == ArrayWithDouble) { 522 for (unsigned i = startIndex; i < newLength; ++i) 523 butterfly->contiguousDouble()[i] = PNaN; 524 } else { 525 for (unsigned i = startIndex; i < newLength; ++i) 526 butterfly->contiguousInt32()[i].setWithoutWriteBarrier(JSValue()); 527 } 528 } else if (type == ArrayWithDouble) 519 529 memcpy(butterfly()->contiguousDouble().data() + startIndex, otherArray->butterfly()->contiguousDouble().data(), sizeof(JSValue) * otherLength); 520 530 else -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/runtime/JSCJSValue.cpp ¶
r217367 r219817 161 161 if (propertyName != vm.propertyNames->underscoreProto) { 162 162 for (; !obj->structure()->hasReadOnlyOrGetterSetterPropertiesExcludingProto(); obj = asObject(prototype)) { 163 prototype = obj->getPrototypeDirect(); 163 prototype = obj->getPrototype(vm, exec); 164 RETURN_IF_EXCEPTION(scope, false); 165 164 166 if (prototype.isNull()) 165 167 return typeError(exec, scope, slot.isStrictMode(), ASCIILiteral(ReadonlyPropertyWriteError)); -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h ¶
r217367 r219817 395 395 JSGenericTypedArrayView* thisObject = jsCast<JSGenericTypedArrayView*>(object); 396 396 397 if (parseIndex(propertyName)) { 397 if (std::optional<uint32_t> index = parseIndex(propertyName)) { 398 auto throwTypeErrorIfNeeded = [&] (const char* errorMessage) -> bool { 399 if (shouldThrow) 400 throwTypeError(exec, scope, makeString(errorMessage, String::number(*index))); 401 return false; 402 }; 403 398 404 if (descriptor.isAccessorDescriptor()) 399 return t ypeError(exec, scope, shouldThrow, ASCIILiteral("Attempting to store accessor indexed property on a typed array."));405 return throwTypeErrorIfNeeded("Attempting to store accessor property on a typed array at index: "); 400 406 401 407 if (descriptor.configurable()) 402 return t ypeError(exec, scope, shouldThrow, ASCIILiteral("Attempting to configure non-configurable property."));408 return throwTypeErrorIfNeeded("Attempting to configure non-configurable property on a typed array at index: "); 403 409 404 410 if (!descriptor.enumerable() || !descriptor.writable()) 405 return t ypeError(exec, scope, shouldThrow, ASCIILiteral("Attempting to store non-enumerable or non-writable indexed property on a typed array."));411 return throwTypeErrorIfNeeded("Attempting to store non-enumerable or non-writable property on a typed array at index: "); 406 412 407 413 if (descriptor.value()) { -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/runtime/JSObject.cpp ¶
r217367 r219817 803 803 return proxy->ProxyObject::put(proxy, exec, propertyName, value, slot); 804 804 } 805 JSValue prototype = obj->getPrototypeDirect(); 805 JSValue prototype = obj->getPrototype(vm, exec); 806 RETURN_IF_EXCEPTION(scope, false); 806 807 if (prototype.isNull()) 807 808 break; … … 809 810 } 810 811 811 ASSERT(!structure(vm)->prototypeChainMayInterceptStoreTo(vm, propertyName) || obj == this);812 812 if (!putDirectInternal<PutModePut>(vm, propertyName, value, 0, slot)) 813 813 return typeError(exec, scope, slot.isStrictMode(), ASCIILiteral(ReadonlyPropertyWriteError)); … … 2345 2345 } 2346 2346 2347 ALWAYS_INLINE static bool canDoFastPutDirectIndex(JSObject* object) 2348 { 2349 return isJSArray(object) 2350 || isJSFinalObject(object) 2351 || object->type() == DirectArgumentsType 2352 || object->type() == ScopedArgumentsType 2353 || object->type() == ClonedArgumentsType; 2354 } 2355 2347 2356 // Defined in ES5.1 8.12.9 2348 2357 bool JSObject::defineOwnIndexedProperty(ExecState* exec, unsigned index, const PropertyDescriptor& descriptor, bool throwException) … … 2358 2367 // however if the property currently exists missing attributes will override from their current 'true' 2359 2368 // state (i.e. defineOwnProperty could be used to set a value without needing to entering 'SparseMode'). 2360 if (!descriptor.attributes() && descriptor.value() ) {2369 if (!descriptor.attributes() && descriptor.value() && canDoFastPutDirectIndex(this)) { 2361 2370 ASSERT(!descriptor.isAccessorDescriptor()); 2362 2371 return putDirectIndex(exec, index, descriptor.value(), 0, throwException ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow); … … 2797 2806 } 2798 2807 2799 bool JSObject::putDirectIndex BeyondVectorLength(ExecState* exec, unsigned i, JSValue value, unsigned attributes, PutDirectIndexMode mode)2808 bool JSObject::putDirectIndexSlowOrBeyondVectorLength(ExecState* exec, unsigned i, JSValue value, unsigned attributes, PutDirectIndexMode mode) 2800 2809 { 2801 2810 VM& vm = exec->vm(); 2811 2812 if (!canDoFastPutDirectIndex(this)) { 2813 PropertyDescriptor descriptor; 2814 descriptor.setDescriptor(value, attributes); 2815 return methodTable(vm)->defineOwnProperty(this, exec, Identifier::from(exec, i), descriptor, mode == PutDirectIndexShouldThrow); 2816 } 2802 2817 2803 2818 // i should be a valid array index that is outside of the current vector. … … 2843 2858 if (!value.isInt32()) { 2844 2859 convertInt32ForValue(vm, value); 2845 return putDirectIndex BeyondVectorLength(exec, i, value, attributes, mode);2860 return putDirectIndexSlowOrBeyondVectorLength(exec, i, value, attributes, mode); 2846 2861 } 2847 2862 putByIndexBeyondVectorLengthWithoutAttributes<Int32Shape>(exec, i, value); … … 2857 2872 if (!value.isNumber()) { 2858 2873 convertDoubleToContiguous(vm); 2859 return putDirectIndex BeyondVectorLength(exec, i, value, attributes, mode);2874 return putDirectIndexSlowOrBeyondVectorLength(exec, i, value, attributes, mode); 2860 2875 } 2861 2876 double valueAsDouble = value.asNumber(); 2862 2877 if (valueAsDouble != valueAsDouble) { 2863 2878 convertDoubleToContiguous(vm); 2864 return putDirectIndex BeyondVectorLength(exec, i, value, attributes, mode);2879 return putDirectIndexSlowOrBeyondVectorLength(exec, i, value, attributes, mode); 2865 2880 } 2866 2881 putByIndexBeyondVectorLengthWithoutAttributes<DoubleShape>(exec, i, value); -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/runtime/JSObject.h ¶
r217367 r219817 196 196 JS_EXPORT_PRIVATE static bool putByIndex(JSCell*, ExecState*, unsigned propertyName, JSValue, bool shouldThrow); 197 197 198 // This performs the ECMAScript Set() operation. 198 199 ALWAYS_INLINE bool putByIndexInline(ExecState* exec, unsigned propertyName, JSValue value, bool shouldThrow) 199 200 { … … 209 210 // - accessors are not called. 210 211 // - it will ignore extensibility and read-only properties if PutDirectIndexLikePutDirect is passed as the mode (the default). 211 // This method creates a property with attributes writable, enumerable and configurable all set to true. 212 // This method creates a property with attributes writable, enumerable and configurable all set to true if attributes is zero, 213 // otherwise, it creates a property with the provided attributes. Semantically, this is performing defineOwnProperty. 212 214 bool putDirectIndex(ExecState* exec, unsigned propertyName, JSValue value, unsigned attributes, PutDirectIndexMode mode) 213 215 { 214 if (!attributes && canSetIndexQuicklyForPutDirect(propertyName)) { 216 auto canSetIndexQuicklyForPutDirect = [&] () -> bool { 217 switch (indexingType()) { 218 case ALL_BLANK_INDEXING_TYPES: 219 case ALL_UNDECIDED_INDEXING_TYPES: 220 return false; 221 case ALL_INT32_INDEXING_TYPES: 222 case ALL_DOUBLE_INDEXING_TYPES: 223 case ALL_CONTIGUOUS_INDEXING_TYPES: 224 case ALL_ARRAY_STORAGE_INDEXING_TYPES: 225 return propertyName < m_butterfly.get()->vectorLength(); 226 default: 227 RELEASE_ASSERT_NOT_REACHED(); 228 return false; 229 } 230 }; 231 232 if (!attributes && canSetIndexQuicklyForPutDirect()) { 215 233 setIndexQuickly(exec->vm(), propertyName, value); 216 234 return true; 217 235 } 218 return putDirectIndexBeyondVectorLength(exec, propertyName, value, attributes, mode); 219 } 236 return putDirectIndexSlowOrBeyondVectorLength(exec, propertyName, value, attributes, mode); 237 } 238 // This is semantically equivalent to performing defineOwnProperty(propertyName, {configurable:true, writable:true, enumerable:true, value:value}). 220 239 bool putDirectIndex(ExecState* exec, unsigned propertyName, JSValue value) 221 240 { … … 223 242 } 224 243 225 // A non-throwing version of putDirect and putDirectIndex. 244 // A generally non-throwing version of putDirect and putDirectIndex. 245 // However, it's only guaranteed to not throw based on what the receiver is. 246 // For example, if the receiver is a ProxyObject, this is not guaranteed, since 247 // it may call into arbitrary JS code. It's the responsibility of the user of 248 // this API to ensure that the receiver object is a well known type if they 249 // want to ensure that this won't throw an exception. 226 250 JS_EXPORT_PRIVATE bool putDirectMayBeIndex(ExecState*, PropertyName, JSValue); 227 251 … … 346 370 return i < butterfly->arrayStorage()->vectorLength() 347 371 && !!butterfly->arrayStorage()->m_vector[i]; 348 default:349 RELEASE_ASSERT_NOT_REACHED();350 return false;351 }352 }353 354 bool canSetIndexQuicklyForPutDirect(unsigned i)355 {356 switch (indexingType()) {357 case ALL_BLANK_INDEXING_TYPES:358 case ALL_UNDECIDED_INDEXING_TYPES:359 return false;360 case ALL_INT32_INDEXING_TYPES:361 case ALL_DOUBLE_INDEXING_TYPES:362 case ALL_CONTIGUOUS_INDEXING_TYPES:363 case ALL_ARRAY_STORAGE_INDEXING_TYPES:364 return i < m_butterfly.get()->vectorLength();365 372 default: 366 373 RELEASE_ASSERT_NOT_REACHED(); … … 1014 1021 bool putByIndexBeyondVectorLength(ExecState*, unsigned propertyName, JSValue, bool shouldThrow); 1015 1022 bool putDirectIndexBeyondVectorLengthWithArrayStorage(ExecState*, unsigned propertyName, JSValue, unsigned attributes, PutDirectIndexMode, ArrayStorage*); 1016 JS_EXPORT_PRIVATE bool putDirectIndex BeyondVectorLength(ExecState*, unsigned propertyName, JSValue, unsigned attributes, PutDirectIndexMode);1023 JS_EXPORT_PRIVATE bool putDirectIndexSlowOrBeyondVectorLength(ExecState*, unsigned propertyName, JSValue, unsigned attributes, PutDirectIndexMode); 1017 1024 1018 1025 unsigned getNewVectorLength(unsigned indexBias, unsigned currentVectorLength, unsigned currentLength, unsigned desiredLength); -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/runtime/JSObjectInlines.h ¶
r217367 r219817 70 70 JSObject* obj = this; 71 71 while (true) { 72 if (obj->structure(vm)->hasReadOnlyOrGetterSetterPropertiesExcludingProto() || obj->type() == ProxyObjectType) 72 MethodTable::GetPrototypeFunctionPtr defaultGetPrototype = JSObject::getPrototype; 73 if (obj->structure(vm)->hasReadOnlyOrGetterSetterPropertiesExcludingProto() || obj->methodTable(vm)->getPrototype != defaultGetPrototype) 73 74 return false; 74 75 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/runtime/JSType.h ¶
r217367 r219817 98 98 WebAssemblyFunctionType, 99 99 100 LastJSCObjectType = JSSetType, 100 ClonedArgumentsType, 101 102 LastJSCObjectType = ClonedArgumentsType, 101 103 MaxJSType = 0b11111111, 102 104 }; -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/ThirdParty/ANGLE/ChangeLog ¶
r217367 r219817 1 2017-07-13 Adrian Perez de Castro <aperez@igalia.com> 2 3 eglplatform.h does not support Wayland 4 https://bugs.webkit.org/show_bug.cgi?id=163482 5 6 This makes it possible to build WebKitGTK+ when the target system has only Wayland support, 7 but no X11 (and therefore the X11 headers are not present). 8 9 Reviewed by Alex Christensen. 10 11 * include/EGL/eglplatform.h: Add Wayland typedefs when WL_EGL_PLATFORM is defined (for example 12 by including wayland-egl.h before including EGL/egl.h). Also, include the X11 headers only 13 when ANGLE_USE_X11 is defined and, for consistency with Mesa's version of the header, when 14 MESA_EGL_NO_X11_HEADERS is not defined. 15 1 16 2016-12-20 Tim Horton <timothy_horton@apple.com> 2 17 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/ThirdParty/ANGLE/changes.diff ¶
r217367 r219817 559 559 framebufferFormatInfo.format)) != conversionSet.end()) 560 560 { 561 diff --git a/include/EGL/eglplatform.h b/include/EGL/eglplatform.h 562 index 9bb75910ac0..ccaf7e6f343 100644 563 --- a/include/EGL/eglplatform.h 564 +++ b/include/EGL/eglplatform.h 565 @@ -89,6 +89,12 @@ typedef int EGLNativeDisplayType; 566 typedef void *EGLNativeWindowType; 567 typedef void *EGLNativePixmapType; 568 569 +#elif defined(WL_EGL_PLATFORM) 570 + 571 +typedef struct wl_display *EGLNativeDisplayType; 572 +typedef struct wl_egl_pixmap *EGLNativePixmapType; 573 +typedef struct wl_egl_window *EGLNativeWindowType; 574 + 575 #elif defined(__ANDROID__) || defined(ANDROID) 576 577 #include <android/native_window.h> 578 @@ -107,6 +113,8 @@ typedef intptr_t EGLNativePixmapType; 579 580 #elif defined(__unix__) 581 582 +#if defined(ANGLE_USE_X11) && !defined(MESA_EGL_NO_X11_HEADERS) 583 + 584 /* X11 (tentative) */ 585 #include <X11/Xlib.h> 586 #include <X11/Xutil.h> 587 @@ -116,6 +124,14 @@ typedef Pixmap EGLNativePixmapType; 588 typedef Window EGLNativeWindowType; 589 590 #else 591 + 592 +typedef void *EGLNativeDisplayType; 593 +typedef khronos_uintptr_t EGLNativePixmapType; 594 +typedef khronos_uintptr_t EGLNativeWindowType; 595 + 596 +#endif /* ANGLE_USE_X11 && !MESA_EGL_NO_X11_HEADERS */ 597 + 598 +#else 599 #error "Platform not recognized" 600 #endif 601 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/ThirdParty/ANGLE/include/EGL/eglplatform.h ¶
r217367 r219817 90 90 typedef void *EGLNativePixmapType; 91 91 92 #elif defined(WL_EGL_PLATFORM) 93 94 typedef struct wl_display *EGLNativeDisplayType; 95 typedef struct wl_egl_pixmap *EGLNativePixmapType; 96 typedef struct wl_egl_window *EGLNativeWindowType; 97 92 98 #elif defined(__ANDROID__) || defined(ANDROID) 93 99 … … 107 113 108 114 #elif defined(__unix__) 115 116 #if defined(ANGLE_USE_X11) && !defined(MESA_EGL_NO_X11_HEADERS) 109 117 110 118 /* X11 (tentative) */ … … 129 137 130 138 #else 139 140 typedef void *EGLNativeDisplayType; 141 typedef khronos_uintptr_t EGLNativePixmapType; 142 typedef khronos_uintptr_t EGLNativeWindowType; 143 144 #endif /* ANGLE_USE_X11 && !MESA_EGL_NO_X11_HEADERS */ 145 146 #else 131 147 #error "Platform not recognized" 132 148 #endif -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WTF/ChangeLog ¶
r217367 r219817 1 2017-06-08 Xabier Rodriguez Calvar <calvaris@igalia.com> 2 3 MediaTime class has rounding issues in different platforms 4 https://bugs.webkit.org/show_bug.cgi?id=172640 5 6 Reviewed by Jer Noble. 7 8 The way a timescale is set when creating a MediaTime from a double 9 can create rounding issues in different platforms because in some 10 rounding is made and in others, it truncates. This way we ensure a 11 common behavior. 12 13 Dumping MediaTimes is also confusing and by the output you don't 14 know if it's containing a double or a fraction. Now, if it 15 contains a double, it only prints the double because printing the 16 fraction is misleading (it currently prints the double read as an 17 integer) and if it contains a fraction it shows the fraction and 18 its double representation separated by an = instead of a ,. 19 20 * wtf/MediaTime.cpp: 21 (WTF::MediaTime::createWithDouble): When creating MediaTime from 22 double, we round instead of leaving it to the cast operation. 23 (WTF::MediaTime::dump): 24 1 25 2017-04-21 Konstantin Tokarev <annulen@yandex.ru> 2 26 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WTF/wtf/MediaTime.cpp ¶
r217367 r219817 146 146 while (doubleTime * timeScale > std::numeric_limits<int64_t>::max()) 147 147 timeScale /= 2; 148 return MediaTime(static_cast<int64_t>( doubleTime * timeScale), timeScale, Valid);148 return MediaTime(static_cast<int64_t>(std::round(doubleTime * timeScale)), timeScale, Valid); 149 149 } 150 150 … … 495 495 } 496 496 497 void MediaTime::dump(PrintStream &out) const 498 { 499 out.print("{", m_timeValue, "/", m_timeScale, ", ", toDouble(), "}"); 497 void MediaTime::dump(PrintStream& out) const 498 { 499 out.print("{"); 500 if (!hasDoubleValue()) 501 out.print(m_timeValue, "/", m_timeScale, " = "); 502 out.print(toDouble(), "}"); 500 503 } 501 504 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog ¶
r217367 r219817 1 2017-07-12 Carlos Alberto Lopez Perez <clopez@igalia.com> 2 3 REGRESSION(r219332): [GTK] 9 new failures on fast/forms spinbutton related tests 4 https://bugs.webkit.org/show_bug.cgi?id=174395 5 6 Reviewed by Carlos Garcia Campos. 7 8 Covered by existing tests. 9 10 Before r219332 the height of the spin button widget was 11 calculated as the maximum value between the individual button 12 ( the [+] or [-] ) width (33 pixels) and height (16 pixels). 13 And r219332 caused the height of the widget to be calculated as 14 the height of the button (16 pixels), which was incorrect as 15 each button should be first expanded vertically to fit the 16 preferred size of the widget. 17 18 Fix this by making the calculations about the spin button widget 19 on a new function spinButtonSize() that takes this into account, 20 and use this values both for adjusting the style of the input 21 field and the spin button widget itself. 22 23 * rendering/RenderThemeGtk.cpp: 24 (WebCore::spinButtonSize): 25 (WebCore::RenderThemeGtk::adjustTextFieldStyle): 26 (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle): 27 28 2017-07-11 Carlos Alberto Lopez Perez <clopez@igalia.com> 29 30 [GTK] Spin buttons on input type number appear over the value itself for small widths 31 https://bugs.webkit.org/show_bug.cgi?id=173572 32 33 Reviewed by Carlos Garcia Campos. 34 35 When drawing the spin buttons, override the width of the input 36 element to increment it with the width of the spin button. 37 This ensures that we don't end up covering the input values with 38 the spin buttons. 39 40 Do this also for user controlled styles, because most web authors 41 won't test how their site renders on WebKitGTK+, and they will 42 assume spin buttons in the order of 13 pixels wide (that is what 43 most browsers use), but the GTK+ spin button is much wider (66 pixels). 44 45 Test: platform/gtk/fast/forms/number/number-size-spinbutton-nocover.html 46 47 * rendering/RenderTheme.cpp: 48 (WebCore::RenderTheme::adjustStyle): 49 * rendering/RenderThemeGtk.cpp: 50 (WebCore::RenderThemeGtk::adjustTextFieldStyle): Call the theme's adjustTextFieldStyle() also for user controlled styles. 51 (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle): 52 53 2017-05-12 Jiewen Tan <jiewen_tan@apple.com> 54 55 Elements should be inserted into a template element as its content's last child 56 https://bugs.webkit.org/show_bug.cgi?id=171373 57 <rdar://problem/31862949> 58 59 Reviewed by Ryosuke Niwa. 60 61 Before this change, our HTML parser obeys the following premises: 62 1) A fostering child whose parent is a table should be inserted before its parent and under its grandparent. 63 2) When inserting into a template element, an element should be inserted into its content. 64 65 Let's walk through the example: 66 a) Before eventhandler takes place 67 template 68 table 69 svg <- parser 70 b) After eventhandler takes place 71 template 72 table 73 svg <- parser 74 c) after parsing svg 75 template 76 content 77 svg 78 (table) 79 table 80 81 Finally, in the example, the svg element will be inserted into the content of the template element while 82 having its next sibling point to the table element. However, the table element is actually under the 83 template element not its content. 84 85 This messy tree is constructed because the second premise is incompleted. It should be: When inserting into 86 a template element, an element should be inserted into its content as its last child. 87 Quoted from Step 3 of https://html.spec.whatwg.org/multipage/syntax.html#appropriate-place-for-inserting-a-node 88 A correct tree will then looks like: 89 template 90 content 91 svg 92 table 93 94 Tests: fast/dom/HTMLTemplateElement/insert-fostering-child-crash.html 95 fast/dom/HTMLTemplateElement/insert-fostering-child.html 96 97 * html/parser/HTMLConstructionSite.cpp: 98 (WebCore::insert): 99 By nullifying task.nextChild, it will force the parser to append the element as task.parent's last child. 100 101 2017-05-15 Jiewen Tan <jiewen_tan@apple.com> 102 103 Replace CryptoOperationData with BufferSource for WebKitSubtleCrypto 104 https://bugs.webkit.org/show_bug.cgi?id=172146 105 <rdar://problem/32122256> 106 107 Reviewed by Brent Fulgham. 108 109 In this patch, we replaces CryptoOperationData with BufferSource for WebKitSubtleCrypto in 110 the custom binding codes. 111 112 Test: crypto/webkitSubtle/import-export-raw-key-leak.html 113 114 * bindings/js/JSWebKitSubtleCryptoCustom.cpp: 115 (WebCore::JSWebKitSubtleCrypto::encrypt): 116 (WebCore::JSWebKitSubtleCrypto::decrypt): 117 (WebCore::JSWebKitSubtleCrypto::sign): 118 (WebCore::JSWebKitSubtleCrypto::verify): 119 (WebCore::JSWebKitSubtleCrypto::digest): 120 (WebCore::JSWebKitSubtleCrypto::importKey): 121 (WebCore::JSWebKitSubtleCrypto::unwrapKey): 122 * crypto/WebKitSubtleCrypto.idl: 123 124 2017-05-13 Zalan Bujtas <zalan@apple.com> 125 126 AccessibilityRenderObject::textUnderElement needs to assert on unclean tree. 127 https://bugs.webkit.org/show_bug.cgi?id=172065 128 129 Reviewed by Simon Fraser. 130 131 r192103 changed the assert logic incorrectly. If the tree is dirty, regardless of the renderer's type, 132 TextIterator will end up forcing style update/layout on the render tree. 133 The original assert would have hit with bug 171546 prior to r216726. 134 135 * accessibility/AccessibilityRenderObject.cpp: 136 (WebCore::AccessibilityRenderObject::textUnderElement): 137 138 2017-05-11 Zalan Bujtas <zalan@apple.com> 139 140 AX: Defer text changes until after the tree is clean if needed. 141 https://bugs.webkit.org/show_bug.cgi?id=171546 142 <rdar://problem/31934942> 143 144 Reviewed by Simon Fraser. 145 146 While updating an accessibility object state, we might 147 trigger unintentional style updates. This style update could 148 end up destroying renderes that are still referenced by functions 149 on the callstack. 150 To avoid that, defer such changes and let AXObjectCache operate on a clean tree. 151 152 Test: accessibility/crash-when-render-tree-is-not-clean.html 153 154 * accessibility/AXObjectCache.cpp: 155 (WebCore::AXObjectCache::remove): 156 (WebCore::AXObjectCache::handleAttributeChanged): 157 (WebCore::AXObjectCache::labelChanged): 158 (WebCore::AXObjectCache::performDeferredCacheUpdate): 159 (WebCore::AXObjectCache::deferRecomputeIsIgnored): 160 (WebCore::AXObjectCache::deferTextChangedIfNeeded): 161 (WebCore::AXObjectCache::recomputeDeferredIsIgnored): Deleted. 162 (WebCore::AXObjectCache::deferTextChanged): Deleted. 163 * accessibility/AXObjectCache.h: Decouple different type of changes. 164 (WebCore::AXObjectCache::deferRecomputeIsIgnored): 165 (WebCore::AXObjectCache::deferTextChangedIfNeeded): 166 (WebCore::AXObjectCache::recomputeDeferredIsIgnored): Deleted. 167 (WebCore::AXObjectCache::deferTextChanged): Deleted. 168 * rendering/RenderBlock.cpp: 169 (WebCore::RenderBlock::deleteLines): 170 * rendering/RenderBlockLineLayout.cpp: 171 (WebCore::RenderBlockFlow::createAndAppendRootInlineBox): 172 * rendering/RenderText.cpp: 173 (WebCore::RenderText::setText): 174 175 2017-05-02 Zalan Bujtas <zalan@apple.com> 176 177 Defer AX cache update when text content changes until after layout is finished. 178 https://bugs.webkit.org/show_bug.cgi?id=171429 179 <rdar://problem/31885984> 180 181 Reviewed by Simon Fraser. 182 183 When the content of the RenderText changes (even as the result of a text-transform change) 184 instead of updating the AX cache eagerly (and trigger layout on a half-backed render tree) 185 we should just defer it until after the subsequent layout is done. 186 187 Test: accessibility/crash-while-adding-text-child-with-transform.html 188 189 * accessibility/AXObjectCache.cpp: 190 (WebCore::AXObjectCache::remove): 191 (WebCore::AXObjectCache::performDeferredCacheUpdate): 192 (WebCore::AXObjectCache::recomputeDeferredIsIgnored): 193 (WebCore::AXObjectCache::deferTextChanged): 194 (WebCore::AXObjectCache::performDeferredIsIgnoredChange): Deleted. 195 * accessibility/AXObjectCache.h: 196 (WebCore::AXObjectCache::deferTextChanged): 197 (WebCore::AXObjectCache::performDeferredCacheUpdate): 198 (WebCore::AXObjectCache::performDeferredIsIgnoredChange): Deleted. 199 * page/FrameView.cpp: 200 (WebCore::FrameView::performPostLayoutTasks): 201 * rendering/RenderText.cpp: 202 (WebCore::RenderText::setText): 203 204 2017-06-19 Brady Eidson <beidson@apple.com> 205 206 Various IndexedDB crashes as an after effect of previous test. 207 <rdar://problem/31418761> and https://bugs.webkit.org/show_bug.cgi?id=170436 208 209 Reviewed by Chris Dumez. 210 211 No new test (No consistent test possible, in practice covered by all existing IDB tests) 212 213 This is timing related, where a UniqueIDBDatabase can be destroyed on the main thread while 214 it still has one task left to try to execute on the IDBServer thread. 215 216 The background thread tasks don't Ref<> the UniqueIDBDatabase, so even though task execution 217 took a Ref<> protector, there was still a small window for a race. 218 219 Should be closed up by making the background thread tasks themselves protect this. 220 221 * Modules/indexeddb/server/UniqueIDBDatabase.cpp: 222 (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask): 223 (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply): 224 (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTask): 225 (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTaskReply): 226 * Modules/indexeddb/server/UniqueIDBDatabase.h: 227 228 2017-06-18 Carlos Garcia Campos <cgarcia@igalia.com> 229 230 [GStreamer] MainThreadNotifier ASSERTION FAILED: m_boundThread == currentThread() in _WebKitWebSrcPrivate::~_WebKitWebSrcPrivate 231 https://bugs.webkit.org/show_bug.cgi?id=152043 232 233 Reviewed by Xabier Rodriguez-Calvar. 234 235 Stop using a WeakPtr in MainThreadNotifier, because it's not thread safe, which causes a crash in debug builds when 236 the notifier is destroyed in a different thread. Make MainThreadNotifier thread safe refcounted instead, and add 237 an invalidate() method to mark it as invalid. 238 239 * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp: 240 (WebCore::InbandTextTrackPrivateGStreamer::handleSample): 241 (WebCore::InbandTextTrackPrivateGStreamer::streamChanged): 242 * platform/graphics/gstreamer/MainThreadNotifier.h: 243 (WebCore::MainThreadNotifier::MainThreadNotifier): Deleted. 244 (WebCore::MainThreadNotifier::notify): Deleted. 245 (WebCore::MainThreadNotifier::cancelPendingNotifications): Deleted. 246 (WebCore::MainThreadNotifier::addPendingNotification): Deleted. 247 (WebCore::MainThreadNotifier::removePendingNotification): Deleted. 248 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: 249 (WebCore::MediaPlayerPrivateGStreamer::videoChangedCallback): 250 (WebCore::MediaPlayerPrivateGStreamer::videoSinkCapsChangedCallback): 251 (WebCore::MediaPlayerPrivateGStreamer::audioChangedCallback): 252 (WebCore::MediaPlayerPrivateGStreamer::textChangedCallback): 253 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: 254 (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase): 255 (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): 256 (WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback): 257 (WebCore::MediaPlayerPrivateGStreamerBase::muteChangedCallback): 258 (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint): 259 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: 260 * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp: 261 (WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer): 262 (WebCore::TrackPrivateBaseGStreamer::~TrackPrivateBaseGStreamer): 263 (WebCore::TrackPrivateBaseGStreamer::disconnect): 264 (WebCore::TrackPrivateBaseGStreamer::activeChangedCallback): 265 (WebCore::TrackPrivateBaseGStreamer::tagsChanged): 266 * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: 267 * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: 268 (webkit_web_src_init): 269 (webKitWebSrcDispose): 270 (webKitWebSrcStop): 271 (webKitWebSrcStart): 272 (webKitWebSrcNeedData): 273 (webKitWebSrcEnoughData): 274 (webKitWebSrcSeek): 275 276 2017-06-17 Antti Koivisto <antti@apple.com> 277 278 Crash due to infinite recursion via FrameSelection::updateAppearanceAfterLayout 279 https://bugs.webkit.org/show_bug.cgi?id=173468 280 281 Reviewed by Ryosuke Niwa. 282 283 Test: editing/selection/updateAppearanceAfterLayout-recursion.html 284 285 Calling FrameSelection::updateAppearanceAfterLayout() from Document::resolveStyle is unsafe 286 because it may cause another call to resolveStyle. We have some cases where the style 287 is still unclean when updateAppearanceAfterLayout() is called. This can lead to infinite 288 recursion. 289 290 The test case is not the common stack seen in CrashTracer (couldn't quit replicate it) but 291 the updateAppearanceAfterLayout/resolveStyle recursion is the same. 292 293 * dom/Document.cpp: 294 (WebCore::Document::resolveStyle): 295 296 Normally selection appearance update is done in post-layout but not all style resolutions schedule a layout. 297 Invoke it asynchronously in that case instead of the previous synchronous call. 298 299 * editing/FrameSelection.cpp: 300 (WebCore::FrameSelection::FrameSelection): 301 (WebCore::FrameSelection::updateAppearanceAfterLayout): 302 (WebCore::FrameSelection::scheduleAppearanceUpdateAfterStyleChange): 303 (WebCore::FrameSelection::appearanceUpdateTimerFired): 304 (WebCore::FrameSelection::updateAppearanceAfterLayoutOrStyleChange): 305 * editing/FrameSelection.h: 306 307 2017-06-17 Ryosuke Niwa <rniwa@webkit.org> 308 309 REGRESSION(r209495): materiauxlaverdure.com fails to load 310 https://bugs.webkit.org/show_bug.cgi?id=173301 311 <rdar://problem/32624850> 312 313 Reviewed by Antti Koivisto. 314 315 The bug was caused by WebKit wrapping CSS string values with single quotation marks instead of 316 double quotation marks as spec'ed in https://drafts.csswg.org/cssom/#serialize-a-string and 317 implemented in Firefox and Chrome. 318 319 The website eval's the computed value of the `content` CSS property with the value `'{name: "flat"}'` 320 after stripping single quotation marks from both ends. Prior to r209495, WebKit serialized this CSS value 321 in single quotations without escaping double quotations. After r209495, double quotations are escaped 322 with backslashes as `'{name: \"flat\"}'`. As a result, `eval` is invoked with `{name: \"flat\"}` 323 after stripping single quotations from both ends, which resulted in an exception. 324 325 Chrome and Firefox don't encounter this exception despite of the fact they escape double quotations 326 as well because serialize with double quotations as `"{name: \"flat\"}"`. Because there is no code 327 to strip double quotations, eval is invoked with the same string, resulting in the entire value as 328 being parsed as string, instead of an object with a single key "name" with the value of "flat" as 329 was the case in WebKit prior to r209495. While this behavior was most certainly not the intent of 330 the website author, Chrome and Firefox don't encounter an exception and the website continues to work. 331 332 This patch aligns WebKit's behavior to that of the CSS OM specification, Firefox, and Chrome by 333 serializing CSS string values using double quotation marks instead of single quotation marks. 334 335 Note: inline change log comments are added below for every call site of serializeString for clarity. 336 337 Test: fast/css/getPropertyValue-serialization-with-double-quotes.html 338 339 * css/CSSBasicShapes.cpp: 340 (WebCore::buildPathString): Use double quotation marks in path(~) of shapes. 341 * css/CSSMarkup.cpp: 342 (WebCore::serializeString): 343 (WebCore::serializeURL): Use double quotation marks to serialize URLs. 344 (WebCore::serializeAsStringOrCustomIdent): Use double quotation marks to serialize strings. We still avoid 345 using wrapping the value with double quotations when the value can be an identifier. See r209495. 346 (WebCore::serializeFontFamily): Ditto for font-family names such as "San Francisco". 347 * css/CSSMarkup.h: 348 * css/CSSNamespaceRule.cpp: 349 (WebCore::CSSNamespaceRule::cssText): Use double quotation marks to serialize namespace URIs. 350 * css/CSSPrimitiveValue.cpp: 351 (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Use double quotation marks to serialize 352 the separators; e.g. counter(sectionNumber, ".") to produce "1.". 353 * css/CSSSelector.cpp: 354 (WebCore::CSSSelector::selectorText): Use double quotation marks to serialize attribute values. 355 * css/parser/CSSParserToken.cpp: 356 (WebCore::CSSParserToken::serialize): Use double quotation marks to serialize strings in @support. 357 * editing/EditingStyle.cpp: 358 (WebCore::StyleChange::extractTextStyles): Updated to strip double quotation marks in font family names to 359 maintain the compatibility with old versions of Microsoft Outlook. 360 * html/HTMLElement.cpp: 361 (WebCore::HTMLElement::mapLanguageAttributeToLocale): Use double quotations marks to serialize the value 362 of the lang content attribute. It doesn't matter which one is used here because it's only a temporary value 363 only fed into the CSS parser to set the equivalent CSS value from the content attribute. 364 365 2017-06-14 Miguel Gomez <magomez@igalia.com> 366 367 REGRESSION(r216901): ImageDecoders: rendering of large images is broken since r216901 368 https://bugs.webkit.org/show_bug.cgi?id=172502 369 370 Reviewed by Carlos Garcia Campos. 371 372 When using GTK and WPE image decoders, the decoded frames are stored inside a Vector of 373 ImageFrames inside the decoders. These ImageFrames have and ImageBackingStore with the 374 pixels. When a NativeImagePtr is requested, a cairo surface is created from the data 375 in those ImageBackingStores, but the data keeps being owned by the backing stores. Due 376 to this, if the decoder that created the image gets destroyed, the backing stores for 377 the decoded frames get destroyed as well, causing the cairo surfaces that were using 378 that data to contain garbage (and potentially cause a crash). 379 380 To fix this, we change ImageBackingStore so the pixels are stored in a SharedBuffer. The 381 buffer will be reffed everytime a cairo surface is created with it, and the cairo surfaces 382 will unref the buffer when they are destroyed. This way, the pixel data won't be freed 383 while there are cairo surfaces using it. 384 385 No new tests, no behaviour change. 386 387 * platform/graphics/ImageBackingStore.h: 388 (WebCore::ImageBackingStore::setSize): 389 (WebCore::ImageBackingStore::ImageBackingStore): 390 * platform/image-decoders/cairo/ImageBackingStoreCairo.cpp: 391 (WebCore::ImageBackingStore::image): 392 393 2017-06-13 Jer Noble <jer.noble@apple.com> 394 395 Protect lifetime of media element during HTMLMediaElement::notifyAboutPlaying() 396 https://bugs.webkit.org/show_bug.cgi?id=173320 397 <rdar://problem/32590276> 398 399 Reviewed by Brent Fulgham. 400 401 * html/HTMLMediaElement.cpp: 402 (WebCore::HTMLMediaElement::notifyAboutPlaying): 403 404 2017-06-09 Brady Eidson <beidson@apple.com> 405 406 Crash when IndexedDB's getAll is used inside a Web Worker. 407 https://bugs.webkit.org/show_bug.cgi?id=172434 408 409 Reviewed by Andy Estes. 410 411 Test: storage/indexeddb/modern/worker-getall.html 412 413 * Modules/indexeddb/IDBGetAllResult.cpp: 414 (WebCore::IDBGetAllResult::IDBGetAllResult): Add an isolated-copying constructor. 415 (WebCore::IDBGetAllResult::isolatedCopy): 416 * Modules/indexeddb/IDBGetAllResult.h: 417 418 * Modules/indexeddb/shared/IDBResultData.cpp: 419 (WebCore::IDBResultData::isolatedCopy): Actually copy the IDBGetAllResult. 420 421 2017-06-08 Ryosuke Niwa <rniwa@webkit.org> 422 423 Crash inside InsertNodeBeforeCommand via InsertParagraphSeparatorCommand 424 https://bugs.webkit.org/show_bug.cgi?id=173085 425 <rdar://problem/32575059> 426 427 Reviewed by Wenson Hsieh. 428 429 The crash was caused by the condition to check for special cases failing when visiblePos is null. 430 Exit early in these extreme cases. 431 432 Also replaced the use of deprecatedNode and deprecatedEditingOffset to modern idioms. 433 434 Test: editing/inserting/insert-horizontal-rule-in-empty-document-crash.html 435 436 * editing/InsertParagraphSeparatorCommand.cpp: 437 (WebCore::InsertParagraphSeparatorCommand::doApply): 438 439 2017-06-06 Zalan Bujtas <zalan@apple.com> 440 441 Safari doesn't load newest The Order of the Stick comic. 442 https://bugs.webkit.org/show_bug.cgi?id=172949 443 <rdar://problem/32389730> 444 445 Reviewed by Antti Koivisto. 446 447 As part of the table layout, RenderTableSection::layoutRows calls the RenderTableCell's layout() directly 448 (skipping the RenderTableRow parent). If during this call the RenderTableCell (or any of its descendant) marks the ancestor 449 chain dirty, this dirty flag on the RenderTableRows will never be cleared and we'll end up early returning from RenderTableSection::paint. 450 For certain type of float objects, we need to invalidate the line layout path during layout (and we mark the ancestors dirty). 451 This patch takes a conservative approach and marks the ancestors dirty only when the renderer is not dirty yet, but 452 as part of webkit.org/b/172947 we should revisit and validate whether the setNeedsLayout() is required at all. 453 454 Test: fast/table/floating-table-sibling-is-invisible.html 455 456 * rendering/RenderBlockFlow.cpp: 457 (WebCore::RenderBlockFlow::invalidateLineLayoutPath): 458 459 2017-06-05 Zalan Bujtas <zalan@apple.com> 460 461 Destroy the associated renderer subtree when display: contents node is deleted. 462 https://bugs.webkit.org/show_bug.cgi?id=172920 463 <rdar://problem/32446045> 464 465 Reviewed by Antti Koivisto. 466 467 Since display: contents node does not create a renderer, we need to explicitly check 468 and distinguish it from the display: none case. 469 470 Covered by existing tests. 471 472 * dom/ContainerNode.cpp: 473 (WebCore::destroyRenderTreeIfNeeded): 474 * dom/Node.cpp: 475 (WebCore::Node::~Node): Promote ASSERT(!renderer()) to ASSERT_WITH_SECURITY_IMPLICATION. 476 * dom/Text.cpp: 477 (WebCore::Text::~Text): Redundant assert. Text is a Node. 478 479 2017-06-05 Carlos Garcia Campos <cgarcia@igalia.com> 480 481 [GStreamer] Deadlock in MediaPlayerPrivateGStreamer::changePipelineState, web process often locks up on seeking in a youtube video that has already fully buffered 482 https://bugs.webkit.org/show_bug.cgi?id=170003 483 484 Reviewed by Michael Catanzaro. 485 486 When video sink is requested to render a frame, the GstBaseSink preroll mutex is taken. Then WebKit media player 487 schedules a repaint in the main thread, taking the draw mutex and waiting on draw condition. It can happen that 488 before the repaint is done in the main thread, a pause is requested in the main thread, causing a change state 489 from PLAYING to PAUSE. When the change state reaches the video sink gst_base_sink_change_state() tries to get 490 the preroll mutex. This causes a deadlock because the main thread is waiting to get the preroll mutex, but the 491 other thread is waiting for the main thread to do the repaint. GStreamer handles this case by calling unlock() 492 on the video sink before trying to get the preroll mutex, but the media player doesn't cancel the pending 493 repaint when using coordinated graphics. This patch adds a new signal to WebKitVideoSink "repaint-cancelled" to 494 notify the media player to cancel the pending prepaint. 495 496 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: 497 (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint): Release the draw mutex and notify the condition. 498 (WebCore::MediaPlayerPrivateGStreamerBase::repaintCancelledCallback): Call cancelRepaint(). 499 (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink): Connect to WebKitVideoSink::repaint-cancelled. 500 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: 501 * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: 502 (webkitVideoSinkRepaintCancelled): Emit WebKitVideoSink::repaint-cancelled. 503 (webkitVideoSinkUnlock): Call webkitVideoSinkRepaintCancelled(). 504 (webkitVideoSinkStop): Ditto. 505 (webkit_video_sink_class_init): Add WebKitVideoSink::repaint-cancelled signal. 506 507 2017-06-01 Carlos Garcia Campos <cgarcia@igalia.com> 508 509 [GTK] Cache RenderThemeGadget hierarchies for rendering themed elements with GTK+ 3.20+ 510 https://bugs.webkit.org/show_bug.cgi?id=162673 511 512 Reviewed by Michael Catanzaro. 513 514 Because of the way the new theming system works in GTK+ >= 3.20 we are currently creating a gadget hierarchy 515 every time we need to render a styled element or get layout information about it. That's happening on every 516 repaint, and it's specially problematic for overlay scrollbar indicators that fade in/out when shown/hidden. We 517 need to cache the gadgets and simply apply the state before every paint or layout query. When using GtkWidgetPath, 518 calling gtk_style_context_save() breaks the gadget hierarchy, and style classes need to be set when building the 519 GtkWidgetPath. That means we can't cache RenderThemeGadgets, call save, apply style classes and state, and then 520 call restore. We need to cache gadget hierarchies with fixed style classes. Fortunately, setting the state does 521 work, so we don't need to also cache a different hierarchy for every possible state. For example, for the 522 particular case of scrollbars we would cache VerticalScrollbarRight, VerticalScrollbarLeft, HorizontalScrollbar, 523 VerticalScrollIndicatorRight, VerticalScrollIndicatorLeft and HorizontalScrollIndicator. In practice, we will 524 only have 4 of those at the same time in the cache. 525 This patch adds RenderThemeWidget to represent a hierarchy of gadgets with fixed style classes that can be 526 cached and reused to render or query style of those "widgets". It also simplifies the RenderThemeGtk and 527 ScrollbarThemeGtk code by removing a lot of duplicated code to build the gadget hierarchies. 528 529 * PlatformGTK.cmake: 530 * platform/gtk/RenderThemeGadget.cpp: 531 (WebCore::createStyleContext): 532 (WebCore::appendElementToPath): 533 (WebCore::RenderThemeGadget::state): 534 (WebCore::RenderThemeGadget::setState): 535 * platform/gtk/RenderThemeGadget.h: 536 * platform/gtk/RenderThemeWidget.cpp: Added. 537 (WebCore::widgetMap): 538 (WebCore::RenderThemeWidget::getOrCreate): 539 (WebCore::RenderThemeWidget::clearCache): 540 (WebCore::RenderThemeWidget::~RenderThemeWidget): 541 (WebCore::RenderThemeScrollbar::RenderThemeScrollbar): 542 (WebCore::RenderThemeScrollbar::stepper): 543 (WebCore::RenderThemeToggleButton::RenderThemeToggleButton): 544 (WebCore::RenderThemeButton::RenderThemeButton): 545 (WebCore::RenderThemeComboBox::RenderThemeComboBox): 546 (WebCore::RenderThemeEntry::RenderThemeEntry): 547 (WebCore::RenderThemeSearchEntry::RenderThemeSearchEntry): 548 (WebCore::RenderThemeSpinButton::RenderThemeSpinButton): 549 (WebCore::RenderThemeSlider::RenderThemeSlider): 550 (WebCore::RenderThemeProgressBar::RenderThemeProgressBar): 551 (WebCore::RenderThemeListView::RenderThemeListView): 552 (WebCore::RenderThemeIcon::RenderThemeIcon): 553 * platform/gtk/RenderThemeWidget.h: Added. 554 (WebCore::RenderThemeEntry::entry): 555 (WebCore::RenderThemeEntry::selection): 556 * platform/gtk/ScrollbarThemeGtk.cpp: 557 (WebCore::ScrollbarThemeGtk::themeChanged): 558 (WebCore::ScrollbarThemeGtk::updateThemeProperties): 559 (WebCore::widgetTypeForScrollbar): 560 (WebCore::contentsRectangle): 561 (WebCore::ScrollbarThemeGtk::trackRect): 562 (WebCore::ScrollbarThemeGtk::backButtonRect): 563 (WebCore::ScrollbarThemeGtk::forwardButtonRect): 564 (WebCore::ScrollbarThemeGtk::paint): 565 (WebCore::ScrollbarThemeGtk::scrollbarThickness): 566 (WebCore::ScrollbarThemeGtk::minimumThumbLength): 567 * rendering/RenderThemeGtk.cpp: 568 (WebCore::createStyleContext): 569 (WebCore::setToggleSize): 570 (WebCore::paintToggle): 571 (WebCore::RenderThemeGtk::paintButton): 572 (WebCore::menuListColor): 573 (WebCore::RenderThemeGtk::popupInternalPaddingBox): 574 (WebCore::RenderThemeGtk::paintMenuList): 575 (WebCore::RenderThemeGtk::adjustTextFieldStyle): 576 (WebCore::RenderThemeGtk::paintTextField): 577 (WebCore::adjustSearchFieldIconStyle): 578 (WebCore::paintSearchFieldIcon): 579 (WebCore::RenderThemeGtk::paintSliderTrack): 580 (WebCore::RenderThemeGtk::adjustSliderThumbSize): 581 (WebCore::RenderThemeGtk::paintSliderThumb): 582 (WebCore::RenderThemeGtk::progressBarRectForBounds): 583 (WebCore::RenderThemeGtk::paintProgressBar): 584 (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle): 585 (WebCore::RenderThemeGtk::paintInnerSpinButton): 586 (WebCore::styleColor): 587 (WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor): 588 (WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor): 589 (WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor): 590 (WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor): 591 (WebCore::RenderThemeGtk::paintMediaButton): 592 593 2017-06-01 Chris Dumez <cdumez@apple.com> 594 595 Make WebCore::defaultPortForProtocol() thread-safe 596 https://bugs.webkit.org/show_bug.cgi?id=172797 597 598 Reviewed by Brent Fulgham. 599 600 Make WebCore::defaultPortForProtocol() thread-safe since it is called from the SecurityOrigin 601 constructor and SecurityOrigin objects are constructed from various threads. 602 603 This should not regress the non-testing code paths since we only pay locking costs if 604 a default port override has been set by the tests. 605 606 * platform/URL.cpp: 607 (WebCore::defaultPortForProtocolMapLock): 608 (WebCore::defaultPortForProtocolMapForTesting): 609 (WebCore::ensureDefaultPortForProtocolMapForTesting): 610 (WebCore::registerDefaultPortForProtocolForTesting): 611 (WebCore::clearDefaultPortForProtocolMapForTesting): 612 (WebCore::defaultPortForProtocol): 613 614 2017-05-30 Dan Bernstein <mitz@apple.com> 615 616 Fixed the build after r217588. 617 618 * page/FrameView.h: Stopped exporting a function defined inline. 619 620 2017-05-30 Zalan Bujtas <zalan@apple.com> 621 622 ASSERTION FAILED: m_layoutPhase == InPostLayerPositionsUpdatedAfterLayout || m_layoutPhase == OutsideLayout 623 https://bugs.webkit.org/show_bug.cgi?id=171501 624 <rdar://problem/31977453> 625 626 Reviewed by Simon Fraser. 627 628 We should be able to paint as long as the tree is clean and we are in paintable state. 629 630 * page/FrameView.cpp: 631 (WebCore::FrameView::paintContents): 632 633 2017-05-30 Jeremy Jones <jeremyj@apple.com> 634 635 m_resourceSelectionTaskQueue tasks should be cleared when player is destroyed to prevent invalid state. 636 https://bugs.webkit.org/show_bug.cgi?id=172726 637 rdar://problem/30867764 638 639 Reviewed by Eric Carlson. 640 641 I haven't found a reproducible way to make a test case for this race condition. 642 643 If m_player is cleared while there is an outstanding task in m_resourceSelectionTaskQueue, 644 that task may assume m_player is not null and crash. It is better to cancel that task than 645 to perform it part way with null checks. 646 647 * html/HTMLMediaElement.cpp: 648 (WebCore::HTMLMediaElement::~HTMLMediaElement): 649 (WebCore::HTMLMediaElement::clearMediaPlayer): 650 651 2017-05-27 Zalan Bujtas <zalan@apple.com> 652 653 enclosingIntRect returns a rect with -1 width/height when the input FloatRect overflows integer. 654 https://bugs.webkit.org/show_bug.cgi?id=172676 655 656 Reviewed by Simon Fraser. 657 658 Clamp integer values soon after the enclosing rectangle is resolved. 659 660 * platform/graphics/FloatRect.cpp: 661 (WebCore::enclosingIntRect): 662 663 2017-05-26 Youenn Fablet <youenn@apple.com> 664 665 Minor clean-up related to DocumentThreadableLoader redirections 666 https://bugs.webkit.org/show_bug.cgi?id=172647 667 668 Reviewed by Chris Dumez. 669 670 No change of behavior. 671 672 Decrementing m_options redirect count directly instead of using an 673 additional counter. 674 675 To compare whether two URLs are same-origin, use scheme+host+port check 676 as per the spec. 677 This is fine as only the initial origin may have specific rules and we 678 are using the scheme+host+port checks when already being gone to 679 another origin. 680 681 * loader/DocumentThreadableLoader.cpp: 682 (WebCore::DocumentThreadableLoader::redirectReceived): 683 * loader/DocumentThreadableLoader.h: 684 * loader/SubresourceLoader.cpp: 685 (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl): 686 687 2017-05-25 Chris Dumez <cdumez@apple.com> 688 689 imported/w3c/web-platform-tests/html/semantics/forms/form-control-infrastructure/form_owner_and_table_2.html is crashing 690 https://bugs.webkit.org/show_bug.cgi?id=172628 691 <rdar://problem/32418707> 692 693 Reviewed by Sam Weinig. 694 695 In the event where a form is removed synchronously by a script during parsing, 696 FormAssociatedElement::m_formSetByParser may end up referring to a form that 697 is no longer in the document. As a result, we should make sure m_formSetByParser 698 is still connected in FormAssociatedElement::insertedInto() before we call 699 FormAssociatedElement::setForm(m_formSetByParser). 700 701 Test: fast/dom/HTMLFormElement/form-removed-during-parsing-crash.html 702 703 * html/FormAssociatedElement.cpp: 704 (WebCore::FormAssociatedElement::insertedInto): 705 706 2017-05-25 Zalan Bujtas <zalan@apple.com> 707 708 Frame's composited content is visible when the frame has visibility: hidden. 709 https://bugs.webkit.org/show_bug.cgi?id=125565 710 <rdar://problem/32196849> 711 712 Reviewed by Simon Fraser. 713 714 Do not construct composited layers for hidden RenderWidgets (frameset, iframe, object). 715 Note that we still construct layers for the associated renderers as usual. 716 717 Tests: compositing/visibility/frameset-visibility-hidden.html 718 compositing/visibility/iframe-visibility-hidden.html 719 compositing/visibility/object-visibility-hidden.html 720 721 * rendering/RenderLayerCompositor.cpp: 722 (WebCore::RenderLayerCompositor::requiresCompositingForPlugin): 723 (WebCore::RenderLayerCompositor::requiresCompositingForFrame): 724 725 2017-05-25 Chris Dumez <cdumez@apple.com> 726 727 DocumentThreadableLoader::redirectReceived() should not rely on the resource's loader 728 https://bugs.webkit.org/show_bug.cgi?id=172578 729 <rdar://problem/30754582> 730 731 Reviewed by Youenn Fablet. 732 733 DocumentThreadableLoader::redirectReceived() should not rely on the resource's loader. The rest of the methods do not. 734 It is unsafe for it to rely on the resource's loader because it gets cleared when the load completes. A CachedRawresource 735 may be reused from the memory cache once its load has completed. 736 737 This would cause crashes in CachedRawResource::didAddClient() when replaying the redirects because it would call 738 DocumentThreadableLoader::redirectReceived() and potentially not have a loader anymore. To hit this exact code path, 739 you would need to make repeated XHR to a cacheable simple cross-origin resource that has cacheable redirect. 740 741 Test: http/tests/xmlhttprequest/cacheable-cross-origin-redirect-crash.html 742 743 * loader/DocumentThreadableLoader.cpp: 744 (WebCore::DocumentThreadableLoader::redirectReceived): 745 * loader/DocumentThreadableLoader.h: 746 747 2017-05-25 Zalan Bujtas <zalan@apple.com> 748 749 ASSERTION FAILED: !needsStyleRecalc() || !document().childNeedsStyleRecalc() 750 https://bugs.webkit.org/show_bug.cgi?id=172576 751 <rdar://problem/32181979> 752 753 Reviewed by Brent Fulgham. 754 755 Ensure that we clean the subframe's document before start searching for a focusable element. 756 757 Covered by existing test. 758 759 * page/FocusController.cpp: 760 (WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument): 761 762 2017-05-24 Jiewen Tan <jiewen_tan@apple.com> 763 764 Crash on WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance + 1195 765 https://bugs.webkit.org/show_bug.cgi?id=172555 766 <rdar://problem/32004724> 767 768 Reviewed by Ryosuke Niwa. 769 770 setSelectionWithoutUpdatingAppearance could dispatch a synchronous focusin event, 771 which could invoke an event handler that deteles the frame. Therefore, add a 772 protector before the call. 773 774 Test: editing/selection/select-iframe-focusin-document-crash.html 775 776 * editing/FrameSelection.cpp: 777 (WebCore::FrameSelection::setSelection): 778 779 2017-05-23 Zalan Bujtas <zalan@apple.com> 780 781 ASSERTION FAILED: !renderer().view().needsLayout() while running media/video-main-content-autoplay.html 782 https://bugs.webkit.org/show_bug.cgi?id=172476 783 784 Reviewed by Simon Fraser. 785 786 This patch decouples the layout call logic from the post layout task timer setup. 787 Just because we are switching over to asynchronous performPostLayoutTasks() it should not stop us from 788 running layout on a dirty tree (we could encounter a forced layout (which sets m_postLayoutTasksTimer active) 789 and a subsequent tree mutation during performPostLayoutTasks()). 790 791 There are a few different ways to end up here: 792 root layout is done -> call performPostLayoutTasks() synchronously -> 793 1. tree stays clean -> no action needed. 794 2. tree gets dirty -> setup performPostLayoutTasks timer -> run nested layout -> since m_postLayoutTasksTimer is active() 795 we don't try to run performPostLayoutTasks() while in the nested layout and we return with a clean tree. 796 797 * page/FrameView.cpp: 798 (WebCore::FrameView::layout): 799 800 2017-03-24 Brent Fulgham <bfulgham@apple.com> 801 802 Handle recursive calls to ProcessingInstruction::checkStyleSheet 803 https://bugs.webkit.org/show_bug.cgi?id=169982 804 <rdar://problem/31083051> 805 806 Reviewed by Antti Koivisto. 807 808 See if we triggered a recursive load of the stylesheet during the 'beforeload' 809 event handler. If so, reset to a valid state before completing the load. 810 811 We should also check after 'beforeload' that we were not disconnected from (or 812 moved to a new) document. 813 814 I also looked for other cases of this pattern and fixed them, too. 815 816 Tests: fast/dom/beforeload/image-removed-during-before-load.html 817 fast/dom/beforeload/recursive-css-pi-before-load.html 818 fast/dom/beforeload/recursive-link-before-load.html 819 fast/dom/beforeload/recursive-xsl-pi-before-load.html 820 821 * dom/ProcessingInstruction.cpp: 822 (WebCore::ProcessingInstruction::clearExistingCachedSheet): Added. 823 (WebCore::ProcessingInstruction::checkStyleSheet): Prevent recursive calls into 824 this function during 'beforeload' handling. Also, safely handle the case where 825 the element was disconnected in the 'beforeload' handler (similar to what 826 we do in HTMLLinkElement). 827 (WebCore::ProcessingInstruction::setCSSStyleSheet): Drive-by Fix: Protect the 828 current document to match what we do in setXSLStyleSheet. 829 * dom/ProcessingInstruction.h: 830 * html/HTMLLinkElement.cpp: 831 (WebCore::HTMLLinkElement::process): Prevent recursive calls into 832 this function during 'beforeload' handling. 833 * html/HTMLLinkElement.h: 834 * loader/ImageLoader.cpp: 835 (WebCore::ImageLoader::dispatchPendingBeforeLoadEvent): safely handle the case where 836 the element was disconnected in the 'beforeload' handler (similar to what 837 we do in HTMLLinkElement). 838 * style/StyleScope.cpp: 839 (WebCore::Style::Scope::hasPendingSheet): Added. 840 * style/StyleScope.h: 841 1 842 2017-04-09 Fujii Hironori <Hironori.Fujii@sony.com> 2 843 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/Modules/indexeddb/IDBGetAllResult.cpp ¶
r217367 r219817 43 43 } 44 44 45 IDBGetAllResult::IDBGetAllResult(const IDBGetAllResult& that, IsolatedCopyTag) 46 { 47 isolatedCopy(that, *this); 48 } 49 45 50 IDBGetAllResult IDBGetAllResult::isolatedCopy() const 46 51 { 47 IDBGetAllResult result;48 result.m_type = m_type; 52 return { *this, IsolatedCopy }; 53 } 49 54 50 if (WTF::holds_alternative<std::nullptr_t>(m_results)) 51 return result; 55 void IDBGetAllResult::isolatedCopy(const IDBGetAllResult& source, IDBGetAllResult& destination) 56 { 57 destination.m_type = source.m_type; 52 58 53 switch (m_type) { 59 if (WTF::holds_alternative<std::nullptr_t>(source.m_results)) 60 return; 61 62 switch (source.m_type) { 54 63 case IndexedDB::GetAllType::Keys: 55 isolatedCopyOfVariant<IDBKeyData>( m_results, result.m_results);64 isolatedCopyOfVariant<IDBKeyData>(source.m_results, destination.m_results); 56 65 break; 57 66 case IndexedDB::GetAllType::Values: 58 isolatedCopyOfVariant<IDBValue>( m_results, result.m_results);67 isolatedCopyOfVariant<IDBValue>(source.m_results, destination.m_results); 59 68 break; 60 69 } 61 62 return result;63 70 } 64 71 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/Modules/indexeddb/IDBGetAllResult.h ¶
r217367 r219817 55 55 } 56 56 57 enum IsolatedCopyTag { IsolatedCopy }; 58 IDBGetAllResult(const IDBGetAllResult&, IsolatedCopyTag); 57 59 IDBGetAllResult isolatedCopy() const; 58 60 … … 70 72 71 73 private: 74 static void isolatedCopy(const IDBGetAllResult& source, IDBGetAllResult& destination); 75 72 76 IndexedDB::GetAllType m_type { IndexedDB::GetAllType::Keys }; 73 77 WTF::Variant<Vector<IDBKeyData>, Vector<IDBValue>, std::nullptr_t> m_results { nullptr }; -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp ¶
r217367 r219817 1707 1707 void UniqueIDBDatabase::postDatabaseTask(CrossThreadTask&& task) 1708 1708 { 1709 m_databaseQueue.append(WTFMove(task)); 1709 m_databaseQueue.append([protectedThis = makeRef(*this), task = WTFMove(task)]() mutable { 1710 task.performTask(); 1711 }); 1710 1712 ++m_queuedTaskCount; 1711 1713 … … 1716 1718 { 1717 1719 ASSERT(!isMainThread()); 1718 m_databaseReplyQueue.append(WTFMove(task)); 1720 1721 m_databaseReplyQueue.append([protectedThis = makeRef(*this), task = WTFMove(task)]() mutable { 1722 task.performTask(); 1723 }); 1719 1724 ++m_queuedTaskCount; 1720 1725 … … 1730 1735 ASSERT(task); 1731 1736 1732 // Performing the task might end up removing the last reference to this. 1733 Ref<UniqueIDBDatabase> protectedThis(*this); 1734 1735 task->performTask(); 1737 (*task)(); 1736 1738 --m_queuedTaskCount; 1737 1739 1738 // Release the ref in the main thread to ensure it's deleted there as expected in case of being the last reference. 1739 callOnMainThread([protectedThis = WTFMove(protectedThis)] { 1740 // Release the task on the main thread in case it holds the last reference to this, 1741 // as UniqueIDBDatabase objects must be deleted on the main thread. 1742 callOnMainThread([task = WTFMove(task)] { 1740 1743 }); 1741 1744 } … … 1749 1752 ASSERT(task); 1750 1753 1751 // Performing the task might end up removing the last reference to this. 1752 Ref<UniqueIDBDatabase> protectedThis(*this); 1753 1754 task->performTask(); 1754 (*task)(); 1755 1755 --m_queuedTaskCount; 1756 1756 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h ¶
r217367 r219817 266 266 bool m_deleteBackingStoreInProgress { false }; 267 267 268 CrossThreadQueue< CrossThreadTask> m_databaseQueue;269 CrossThreadQueue< CrossThreadTask> m_databaseReplyQueue;268 CrossThreadQueue<Function<void ()>> m_databaseQueue; 269 CrossThreadQueue<Function<void ()>> m_databaseReplyQueue; 270 270 std::atomic<uint64_t> m_queuedTaskCount { 0 }; 271 271 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp ¶
r217367 r219817 95 95 if (source.m_getResult) 96 96 destination.m_getResult = std::make_unique<IDBGetResult>(*source.m_getResult, IDBGetResult::IsolatedCopy); 97 if (source.m_getAllResult) 98 destination.m_getAllResult = std::make_unique<IDBGetAllResult>(*source.m_getAllResult, IDBGetAllResult::IsolatedCopy); 97 99 } 98 100 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/PlatformGTK.cmake ¶
r217367 r219817 208 208 platform/gtk/PlatformWheelEventGtk.cpp 209 209 platform/gtk/RenderThemeGadget.cpp 210 platform/gtk/RenderThemeWidget.cpp 210 211 platform/gtk/ScrollbarThemeGtk.cpp 211 212 platform/gtk/SoundGtk.cpp -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/accessibility/AXObjectCache.cpp ¶
r217367 r219817 712 712 remove(axID); 713 713 m_renderObjectMapping.remove(renderer); 714 if (is<RenderBlock>(*renderer))715 m_deferredIsIgnoredChangeList.remove(downcast<RenderBlock>(renderer));716 714 } 717 715 … … 721 719 return; 722 720 721 if (is<Element>(*node)) 722 m_deferredRecomputeIsIgnoredList.remove(downcast<Element>(node)); 723 m_deferredTextChangedList.remove(node); 723 724 removeNodeForUse(node); 724 725 … … 1431 1432 handleAriaRoleChanged(element); 1432 1433 else if (attrName == altAttr || attrName == titleAttr) 1433 textChanged(element);1434 deferTextChangedIfNeeded(element); 1434 1435 else if (attrName == forAttr && is<HTMLLabelElement>(*element)) 1435 1436 labelChanged(element); … … 1445 1446 postNotification(element, AXObjectCache::AXValueChanged); 1446 1447 else if (attrName == aria_labelAttr || attrName == aria_labeledbyAttr || attrName == aria_labelledbyAttr) 1447 textChanged(element);1448 deferTextChangedIfNeeded(element); 1448 1449 else if (attrName == aria_checkedAttr) 1449 1450 checkedStateChanged(element); … … 1491 1492 ASSERT(is<HTMLLabelElement>(*element)); 1492 1493 HTMLElement* correspondingControl = downcast<HTMLLabelElement>(*element).control(); 1493 textChanged(correspondingControl);1494 deferTextChangedIfNeeded(correspondingControl); 1494 1495 } 1495 1496 … … 2676 2677 } 2677 2678 2678 void AXObjectCache::performDeferredIsIgnoredChange() 2679 { 2680 for (auto* renderer : m_deferredIsIgnoredChangeList) 2681 recomputeIsIgnored(renderer); 2682 m_deferredIsIgnoredChangeList.clear(); 2683 } 2684 2685 void AXObjectCache::recomputeDeferredIsIgnored(RenderBlock& renderer) 2686 { 2687 if (renderer.beingDestroyed()) 2688 return; 2689 m_deferredIsIgnoredChangeList.add(&renderer); 2679 void AXObjectCache::performDeferredCacheUpdate() 2680 { 2681 for (auto* node : m_deferredTextChangedList) 2682 textChanged(node); 2683 m_deferredTextChangedList.clear(); 2684 2685 for (auto* element : m_deferredRecomputeIsIgnoredList) { 2686 if (auto* renderer = element->renderer()) 2687 recomputeIsIgnored(renderer); 2688 } 2689 m_deferredRecomputeIsIgnoredList.clear(); 2690 } 2691 2692 void AXObjectCache::deferRecomputeIsIgnored(Element* element) 2693 { 2694 if (!element) 2695 return; 2696 2697 if (element->renderer() && element->renderer()->beingDestroyed()) 2698 return; 2699 2700 m_deferredRecomputeIsIgnoredList.add(element); 2701 } 2702 2703 void AXObjectCache::deferTextChangedIfNeeded(Node* node) 2704 { 2705 if (!node) 2706 return; 2707 2708 if (node->renderer() && node->renderer()->beingDestroyed()) 2709 return; 2710 2711 auto& document = node->document(); 2712 // FIXME: We should just defer all text changes. 2713 if (document.needsStyleRecalc() || document.inRenderTreeUpdate() || (document.view() && document.view()->isInRenderTreeLayout())) { 2714 m_deferredTextChangedList.add(node); 2715 return; 2716 } 2717 textChanged(node); 2690 2718 } 2691 2719 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/accessibility/AXObjectCache.h ¶
r217367 r219817 46 46 class RenderBlock; 47 47 class RenderObject; 48 class RenderText; 48 49 class ScrollView; 49 50 class VisiblePosition; … … 326 327 static void setShouldRepostNotificationsForTests(bool value); 327 328 #endif 328 void recomputeDeferredIsIgnored(RenderBlock& renderer); 329 void performDeferredIsIgnoredChange(); 329 void deferRecomputeIsIgnored(Element*); 330 void deferTextChangedIfNeeded(Node*); 331 void performDeferredCacheUpdate(); 330 332 331 333 protected: … … 429 431 AXTextStateChangeIntent m_textSelectionIntent; 430 432 bool m_isSynchronizingSelection { false }; 431 ListHashSet<RenderBlock*> m_deferredIsIgnoredChangeList; 433 ListHashSet<Element*> m_deferredRecomputeIsIgnoredList; 434 ListHashSet<Node*> m_deferredTextChangedList; 432 435 }; 433 436 … … 491 494 inline void AXObjectCache::handleAttributeChanged(const QualifiedName&, Element*) { } 492 495 inline void AXObjectCache::recomputeIsIgnored(RenderObject*) { } 493 inline void AXObjectCache::recomputeDeferredIsIgnored(RenderBlock&) { } 494 inline void AXObjectCache::performDeferredIsIgnoredChange() { } 496 inline void AXObjectCache::deferRecomputeIsIgnored(Element*) { } 497 inline void AXObjectCache::deferTextChangedIfNeeded(Node*) { } 498 inline void AXObjectCache::performDeferredCacheUpdate() { } 495 499 inline void AXObjectCache::handleScrolledToAnchor(const Node*) { } 496 500 inline void AXObjectCache::postTextStateChangeNotification(Node*, const AXTextStateChangeIntent&, const VisibleSelection&) { } -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/accessibility/AccessibilityRenderObject.cpp ¶
r217367 r219817 628 628 return ASCIILiteral("\n"); 629 629 630 bool isRenderText = is<RenderText>(*m_renderer);631 632 630 if (shouldGetTextFromNode(mode)) 633 631 return AccessibilityNodeObject::textUnderElement(mode); … … 635 633 // We use a text iterator for text objects AND for those cases where we are 636 634 // explicitly asking for the full text under a given element. 637 bool shouldIncludeAllChildren = mode.childrenInclusion == AccessibilityTextUnderElementMode::TextUnderElementModeIncludeAllChildren; 638 if (isRenderText || shouldIncludeAllChildren) { 635 if (is<RenderText>(*m_renderer) || mode.childrenInclusion == AccessibilityTextUnderElementMode::TextUnderElementModeIncludeAllChildren) { 639 636 // If possible, use a text iterator to get the text, so that whitespace 640 637 // is handled consistently. … … 670 667 return String(); 671 668 672 // The tree should be stable before looking through the children of a non-Render Text object. 673 // Otherwise, further uses of TextIterator will force a layout update, potentially altering 674 // the accessibility tree and causing crashes in the loop that computes the result text. 675 ASSERT((isRenderText || !shouldIncludeAllChildren) || (!nodeDocument->renderView()->layoutState() && !nodeDocument->childNeedsStyleRecalc())); 676 669 // Renders referenced by accessibility objects could get destroyed, if TextIterator ends up triggering 670 // style update/layout here. See also AXObjectCache::deferTextChangedIfNeeded(). 671 ASSERT_WITH_SECURITY_IMPLICATION(!nodeDocument->childNeedsStyleRecalc()); 672 ASSERT_WITH_SECURITY_IMPLICATION(!nodeDocument->view()->isInRenderTreeLayout()); 677 673 return plainText(textRange.get(), textIteratorBehaviorForTextRange()); 678 674 } -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/bindings/js/JSWebKitSubtleCryptoCustom.cpp ¶
r217367 r219817 29 29 #if ENABLE(SUBTLE_CRYPTO) 30 30 31 #include "BufferSource.h" 31 32 #include "CryptoAlgorithm.h" 32 33 #include "CryptoAlgorithmParametersDeprecated.h" … … 40 41 #include "JSCryptoKeyPair.h" 41 42 #include "JSCryptoKeySerializationJWK.h" 42 #include "JSCryptoOperationData.h"43 43 #include "JSDOMPromise.h" 44 44 #include "ScriptState.h" … … 149 149 } 150 150 151 auto data = cryptoOperationDataFromJSValue(state, scope, state.uncheckedArgument(2));151 auto data = BufferSource(convert<IDLBufferSource>(state, state.uncheckedArgument(2))); 152 152 RETURN_IF_EXCEPTION(scope, { }); 153 153 … … 161 161 }; 162 162 163 auto result = algorithm->encrypt(*parameters, *key, data, WTFMove(successCallback), WTFMove(failureCallback));163 auto result = algorithm->encrypt(*parameters, *key, { data.data(), data.length() }, WTFMove(successCallback), WTFMove(failureCallback)); 164 164 if (result.hasException()) { 165 165 propagateException(state, scope, result.releaseException()); … … 194 194 } 195 195 196 auto data = cryptoOperationDataFromJSValue(state, scope, state.uncheckedArgument(2));196 auto data = BufferSource(convert<IDLBufferSource>(state, state.uncheckedArgument(2))); 197 197 RETURN_IF_EXCEPTION(scope, { }); 198 198 … … 206 206 }; 207 207 208 auto result = algorithm->decrypt(*parameters, *key, data, WTFMove(successCallback), WTFMove(failureCallback));208 auto result = algorithm->decrypt(*parameters, *key, { data.data(), data.length() }, WTFMove(successCallback), WTFMove(failureCallback)); 209 209 if (result.hasException()) { 210 210 propagateException(state, scope, result.releaseException()); … … 239 239 } 240 240 241 auto data = cryptoOperationDataFromJSValue(state, scope, state.uncheckedArgument(2));241 auto data = BufferSource(convert<IDLBufferSource>(state, state.uncheckedArgument(2))); 242 242 RETURN_IF_EXCEPTION(scope, { }); 243 243 … … 251 251 }; 252 252 253 auto result = algorithm->sign(*parameters, *key, data, WTFMove(successCallback), WTFMove(failureCallback));253 auto result = algorithm->sign(*parameters, *key, { data.data(), data.length() }, WTFMove(successCallback), WTFMove(failureCallback)); 254 254 if (result.hasException()) { 255 255 propagateException(state, scope, result.releaseException()); … … 284 284 } 285 285 286 auto signature = cryptoOperationDataFromJSValue(state, scope, state.uncheckedArgument(2));287 RETURN_IF_EXCEPTION(scope, { }); 288 289 auto data = cryptoOperationDataFromJSValue(state, scope, state.uncheckedArgument(3));286 auto signature = BufferSource(convert<IDLBufferSource>(state, state.uncheckedArgument(2))); 287 RETURN_IF_EXCEPTION(scope, { }); 288 289 auto data = BufferSource(convert<IDLBufferSource>(state, state.uncheckedArgument(3))); 290 290 RETURN_IF_EXCEPTION(scope, { }); 291 291 … … 299 299 }; 300 300 301 auto result = algorithm->verify(*parameters, *key, signature, data, WTFMove(successCallback), WTFMove(failureCallback));301 auto result = algorithm->verify(*parameters, *key, { signature.data(), signature.length() }, { data.data(), data.length() }, WTFMove(successCallback), WTFMove(failureCallback)); 302 302 if (result.hasException()) { 303 303 propagateException(state, scope, result.releaseException()); … … 322 322 RETURN_IF_EXCEPTION(scope, { }); 323 323 324 auto data = cryptoOperationDataFromJSValue(state, scope, state.uncheckedArgument(1));324 auto data = BufferSource(convert<IDLBufferSource>(state, state.uncheckedArgument(1))); 325 325 RETURN_IF_EXCEPTION(scope, { }); 326 326 … … 334 334 }; 335 335 336 auto result = algorithm->digest(*parameters, data, WTFMove(successCallback), WTFMove(failureCallback));336 auto result = algorithm->digest(*parameters, { data.data(), data.length() }, WTFMove(successCallback), WTFMove(failureCallback)); 337 337 if (result.hasException()) { 338 338 propagateException(state, scope, result.releaseException()); … … 457 457 RETURN_IF_EXCEPTION(scope, { }); 458 458 459 auto data = cryptoOperationDataFromJSValue(state, scope, state.uncheckedArgument(1));459 auto data = BufferSource(convert<IDLBufferSource>(state, state.uncheckedArgument(1))); 460 460 RETURN_IF_EXCEPTION(scope, { }); 461 461 … … 488 488 }; 489 489 490 WebCore::importKey(state, keyFormat, data, WTFMove(algorithm), WTFMove(parameters), extractable, keyUsages, WTFMove(successCallback), WTFMove(failureCallback));490 WebCore::importKey(state, keyFormat, { data.data(), data.length() }, WTFMove(algorithm), WTFMove(parameters), extractable, keyUsages, WTFMove(successCallback), WTFMove(failureCallback)); 491 491 RETURN_IF_EXCEPTION(scope, JSValue()); 492 492 … … 626 626 RETURN_IF_EXCEPTION(scope, { }); 627 627 628 auto wrappedKeyData = cryptoOperationDataFromJSValue(state, scope, state.uncheckedArgument(1));628 auto wrappedKeyData = BufferSource(convert<IDLBufferSource>(state, state.uncheckedArgument(1))); 629 629 RETURN_IF_EXCEPTION(scope, { }); 630 630 … … 692 692 }; 693 693 694 auto result = unwrapAlgorithm->decryptForUnwrapKey(*unwrapAlgorithmParameters, *unwrappingKey, wrappedKeyData, WTFMove(decryptSuccessCallback), WTFMove(decryptFailureCallback));694 auto result = unwrapAlgorithm->decryptForUnwrapKey(*unwrapAlgorithmParameters, *unwrappingKey, { wrappedKeyData.data(), wrappedKeyData.length() }, WTFMove(decryptSuccessCallback), WTFMove(decryptFailureCallback)); 695 695 if (result.hasException()) { 696 696 propagateException(state, scope, result.releaseException()); -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/crypto/WebKitSubtleCrypto.idl ¶
r217367 r219817 29 29 NoInterfaceObject, 30 30 ] interface WebKitSubtleCrypto { 31 [Custom] Promise<ArrayBuffer> encrypt(AlgorithmIdentifier algorithm, Key key, sequence< CryptoOperationData> data);32 [Custom] Promise<ArrayBuffer> decrypt(AlgorithmIdentifier algorithm, Key key, sequence< CryptoOperationData> data);33 [Custom] Promise<ArrayBuffer> sign(AlgorithmIdentifier algorithm, Key key, sequence< CryptoOperationData> data);34 [Custom] Promise<boolean> verify(AlgorithmIdentifier algorithm, Key key, CryptoOperationData signature, sequence<CryptoOperationData> data);35 [Custom] Promise<ArrayBuffer> digest(AlgorithmIdentifier algorithm, sequence< CryptoOperationData> data);31 [Custom] Promise<ArrayBuffer> encrypt(AlgorithmIdentifier algorithm, Key key, sequence<BufferSource> data); 32 [Custom] Promise<ArrayBuffer> decrypt(AlgorithmIdentifier algorithm, Key key, sequence<BufferSource> data); 33 [Custom] Promise<ArrayBuffer> sign(AlgorithmIdentifier algorithm, Key key, sequence<BufferSource> data); 34 [Custom] Promise<boolean> verify(AlgorithmIdentifier algorithm, Key key, BufferSource signature, sequence<BufferSource> data); 35 [Custom] Promise<ArrayBuffer> digest(AlgorithmIdentifier algorithm, sequence<BufferSource> data); 36 36 [Custom] Promise<(CryptoKey or CryptoKeyPair)> generateKey(AlgorithmIdentifier algorithm, optional boolean extractable, optional sequence<KeyUsage> keyUsages); 37 [Custom] Promise<CryptoKey> importKey(KeyFormat format, CryptoOperationDatakeyData, AlgorithmIdentifier? algorithm, optional boolean extractable, optional sequence<KeyUsage> keyUsages);37 [Custom] Promise<CryptoKey> importKey(KeyFormat format, BufferSource keyData, AlgorithmIdentifier? algorithm, optional boolean extractable, optional sequence<KeyUsage> keyUsages); 38 38 [Custom] Promise<ArrayBuffer> exportKey(KeyFormat format, Key key); 39 39 [Custom] Promise<ArrayBuffer> wrapKey(KeyFormat format, Key key, Key wrappingKey, AlgorithmIdentifier wrapAlgorithm); 40 [Custom] Promise<CryptoKey> unwrapKey(KeyFormat format, CryptoOperationDatawrappedKey, Key unwrappingKey, AlgorithmIdentifier unwrapAlgorithm, AlgorithmIdentifier? unwrappedKeyAlgorithm, optional boolean extractable, optional sequence<KeyUsage> keyUsages);40 [Custom] Promise<CryptoKey> unwrapKey(KeyFormat format, BufferSource wrappedKey, Key unwrappingKey, AlgorithmIdentifier unwrapAlgorithm, AlgorithmIdentifier? unwrappedKeyAlgorithm, optional boolean extractable, optional sequence<KeyUsage> keyUsages); 41 41 }; -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/css/CSSMarkup.cpp ¶
r217367 r219817 159 159 } 160 160 161 void serializeString(const String& string, StringBuilder& appendTo , bool useDoubleQuotes)161 void serializeString(const String& string, StringBuilder& appendTo) 162 162 { 163 163 // FIXME: From the CSS OM draft: … … 165 165 // We need to switch to using " instead of ', but this involves patching a large 166 166 // number of tests and changing editing code to not get confused by double quotes. 167 appendTo.append( useDoubleQuotes ? '\"' : '\'');167 appendTo.append('"'); 168 168 169 169 unsigned index = 0; … … 180 180 } 181 181 182 appendTo.append( useDoubleQuotes ? '\"' : '\'');183 } 184 185 String serializeString(const String& string , bool useDoubleQuotes)182 appendTo.append('"'); 183 } 184 185 String serializeString(const String& string) 186 186 { 187 187 StringBuilder builder; 188 serializeString(string, builder , useDoubleQuotes);188 serializeString(string, builder); 189 189 return builder.toString(); 190 190 } -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/css/CSSMarkup.h ¶
r217367 r219817 31 31 // Common serializing methods. See: http://dev.w3.org/csswg/cssom/#common-serializing-idioms 32 32 void serializeIdentifier(const String& identifier, StringBuilder& appendTo, bool skipStartChecks = false); 33 void serializeString(const String&, StringBuilder& appendTo , bool useDoubleQuotes = false);34 String serializeString(const String& , bool useDoubleQuotes = false);33 void serializeString(const String&, StringBuilder& appendTo); 34 String serializeString(const String&); 35 35 String serializeURL(const String&); 36 36 String serializeFontFamily(const String&); -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/css/CSSSelector.cpp ¶
r217367 r219817 698 698 } 699 699 if (cs->match() != CSSSelector::Set) { 700 serializeString(cs->serializingValue(), str , true);700 serializeString(cs->serializingValue(), str); 701 701 if (cs->attributeValueMatchingIsCaseInsensitive()) 702 702 str.appendLiteral(" i]"); -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/dom/ContainerNode.cpp ¶
r217367 r219817 54 54 #include "RenderWidget.h" 55 55 #include "RootInlineBox.h" 56 #include "RuntimeEnabledFeatures.h" 56 57 #include "SVGDocumentExtensions.h" 57 58 #include "SVGElement.h" … … 106 107 static inline void destroyRenderTreeIfNeeded(Node& child) 107 108 { 108 bool childIsHTMLSlotElement = false; 109 childIsHTMLSlotElement = is<HTMLSlotElement>(child); 109 bool isElement = is<Element>(child); 110 auto hasDisplayContents = isElement && downcast<Element>(child).hasDisplayContents(); 111 auto isNamedFlowElement = isElement && downcast<Element>(child).isNamedFlowContentElement(); 110 112 // FIXME: Get rid of the named flow test. 111 bool isElement = is<Element>(child); 112 if (!child.renderer() && !childIsHTMLSlotElement 113 && !(isElement && downcast<Element>(child).isNamedFlowContentElement())) 113 if (!child.renderer() && !hasDisplayContents && !isNamedFlowElement) 114 114 return; 115 115 if (isElement) -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/dom/Document.cpp ¶
r217367 r219817 1835 1835 frameView.viewportContentsChanged(); 1836 1836 1837 // Usually this is handled by post-layout. 1837 1838 if (!frameView.needsLayout()) 1838 frameView.frame().selection(). updateAppearanceAfterLayout();1839 frameView.frame().selection().scheduleAppearanceUpdateAfterStyleChange(); 1839 1840 1840 1841 // As a result of the style recalculation, the currently hovered element might have been … … 1846 1847 if (m_gotoAnchorNeededAfterStylesheetsLoad && !styleScope().hasPendingSheets()) 1847 1848 frameView.scrollToFragment(m_url); 1849 1850 // FIXME: Ideally we would ASSERT(!needsStyleRecalc()) here but we have some cases where it is not true. 1848 1851 } 1849 1852 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/dom/Node.cpp ¶
r217367 r219817 287 287 #endif 288 288 289 ASSERT (!renderer());289 ASSERT_WITH_SECURITY_IMPLICATION(!renderer()); 290 290 ASSERT(!parentNode()); 291 291 ASSERT(!m_previous); -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/dom/ProcessingInstruction.cpp ¶
r217367 r219817 1 1 /* 2 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) 3 * Copyright (C) 2006 , 2008, 2009Apple Inc. All rights reserved.3 * Copyright (C) 2006-2017 Apple Inc. All rights reserved. 4 4 * Copyright (C) 2013 Samsung Electronics. All rights reserved. 5 5 * … … 36 36 #include "XMLDocumentParser.h" 37 37 #include "XSLStyleSheet.h" 38 #include <wtf/SetForScope.h> 38 39 39 40 namespace WebCore { … … 81 82 void ProcessingInstruction::checkStyleSheet() 82 83 { 84 // Prevent recursive loading of stylesheet. 85 if (m_isHandlingBeforeLoad) 86 return; 87 83 88 if (m_target == "xml-stylesheet" && document().frame() && parentNode() == &document()) { 84 89 // see http://www.w3.org/TR/xml-stylesheet/ … … 131 136 132 137 String url = document().completeURL(href).string(); 138 139 Ref<Document> originalDocument = document(); 140 141 { 142 SetForScope<bool> change(m_isHandlingBeforeLoad, true); 133 143 if (!dispatchBeforeLoadEvent(url)) 134 144 return; 145 } 146 147 bool didEventListenerDisconnectThisElement = !isConnected() || &document() != originalDocument.ptr(); 148 if (didEventListenerDisconnectThisElement) 149 return; 135 150 136 151 m_loading = true; 137 152 document().styleScope().addPendingSheet(); 153 154 ASSERT_WITH_SECURITY_IMPLICATION(!m_cachedSheet); 138 155 139 156 #if ENABLE(XSLT) … … 207 224 // getting the sheet text in "strict" mode. This enforces a valid CSS MIME 208 225 // type. 226 Ref<Document> protect(document()); 209 227 parseStyleSheet(sheet->sheetText()); 210 228 } -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/dom/ProcessingInstruction.h ¶
r217367 r219817 1 1 /* 2 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) 3 * Copyright (C) 2006 Apple Inc. All rights reserved.3 * Copyright (C) 2006-2017 Apple Inc. All rights reserved. 4 4 * Copyright (C) 2013 Samsung Electronics. All rights reserved. 5 5 * … … 88 88 bool m_isXSL { false }; 89 89 #endif 90 bool m_isHandlingBeforeLoad { false }; 90 91 }; 91 92 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/dom/Text.cpp ¶
r217367 r219817 55 55 Text::~Text() 56 56 { 57 ASSERT(!renderer());58 57 } 59 58 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/editing/EditingStyle.cpp ¶
r217367 r219817 1705 1705 1706 1706 m_applyFontFace = style.getPropertyValue(CSSPropertyFontFamily); 1707 // Remove singlequotes for Outlook 2007 compatibility. See https://bugs.webkit.org/show_bug.cgi?id=794481708 m_applyFontFace.replaceWithLiteral('\ '', "");1707 // Remove quotes for Outlook 2007 compatibility. See https://bugs.webkit.org/show_bug.cgi?id=79448 1708 m_applyFontFace.replaceWithLiteral('\"', ""); 1709 1709 style.removeProperty(CSSPropertyFontFamily); 1710 1710 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/editing/FrameSelection.cpp ¶
r217367 r219817 112 112 , m_granularity(CharacterGranularity) 113 113 , m_caretBlinkTimer(*this, &FrameSelection::caretBlinkTimerFired) 114 , m_appearanceUpdateTimer(*this, &FrameSelection::appearanceUpdateTimerFired) 114 115 , m_caretInsidePositionFixed(false) 115 116 , m_absCaretBoundsDirty(true) … … 333 334 void FrameSelection::setSelection(const VisibleSelection& selection, SetSelectionOptions options, AXTextStateChangeIntent intent, CursorAlignOnScroll align, TextGranularity granularity) 334 335 { 336 RefPtr<Frame> protectedFrame(m_frame); 335 337 if (!setSelectionWithoutUpdatingAppearance(selection, options, align, granularity)) 336 338 return; … … 2397 2399 void FrameSelection::updateAppearanceAfterLayout() 2398 2400 { 2401 m_appearanceUpdateTimer.stop(); 2402 updateAppearanceAfterLayoutOrStyleChange(); 2403 } 2404 2405 void FrameSelection::scheduleAppearanceUpdateAfterStyleChange() 2406 { 2407 m_appearanceUpdateTimer.startOneShot(0_s); 2408 } 2409 2410 void FrameSelection::appearanceUpdateTimerFired() 2411 { 2412 updateAppearanceAfterLayoutOrStyleChange(); 2413 } 2414 2415 void FrameSelection::updateAppearanceAfterLayoutOrStyleChange() 2416 { 2399 2417 if (auto* client = m_frame->editor().client()) 2400 2418 client->updateEditorStateAfterLayoutIfEditabilityChanged(); -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/editing/FrameSelection.h ¶
r217367 r219817 152 152 153 153 void updateAppearanceAfterLayout(); 154 void scheduleAppearanceUpdateAfterStyleChange(); 154 155 void setNeedsSelectionUpdate(); 155 156 … … 316 317 void caretBlinkTimerFired(); 317 318 319 void updateAppearanceAfterLayoutOrStyleChange(); 320 void appearanceUpdateTimerFired(); 321 318 322 void setCaretVisibility(CaretVisibility); 319 323 bool recomputeCaretRect(); … … 335 339 336 340 Timer m_caretBlinkTimer; 341 Timer m_appearanceUpdateTimer; 337 342 // The painted bounds of the caret in absolute coordinates 338 343 IntRect m_absCaretBounds; -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp ¶
r217367 r219817 186 186 insertionPosition = positionAvoidingSpecialElementBoundary(insertionPosition); 187 187 VisiblePosition visiblePos(insertionPosition, affinity); 188 if (visiblePos.isNull()) 189 return; 190 188 191 calculateStyleBeforeInsertion(insertionPosition); 189 192 … … 266 269 ASSERT(startBlock->firstChild()); 267 270 refNode = startBlock->firstChild(); 268 } 269 else if (insertionPosition.deprecatedNode() == startBlock && nestNewBlock) { 270 refNode = startBlock->traverseToChildAt(insertionPosition.deprecatedEditingOffset()); 271 } else if (insertionPosition.containerNode() == startBlock && nestNewBlock) { 272 refNode = startBlock->traverseToChildAt(insertionPosition.computeOffsetInContainerNode()); 271 273 ASSERT(refNode); // must be true or we'd be in the end of block case 272 274 } else -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/html/FormAssociatedElement.cpp ¶
r217367 r219817 72 72 HTMLElement& element = asHTMLElement(); 73 73 if (m_formSetByParser) { 74 setForm(m_formSetByParser); 74 // The form could have been removed by a script during parsing. 75 if (m_formSetByParser->isConnected()) 76 setForm(m_formSetByParser); 75 77 m_formSetByParser = nullptr; 76 78 } -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/html/HTMLLinkElement.cpp ¶
r217367 r219817 3 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 4 4 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * Copyright (C) 2003 , 2006, 2007, 2008, 2009, 2010, 2014Apple Inc. All rights reserved.5 * Copyright (C) 2003-2017 Apple Inc. All rights reserved. 6 6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com) 7 7 * Copyright (C) 2011 Google Inc. All rights reserved. … … 56 56 #include "StyleSheetContents.h" 57 57 #include <wtf/Ref.h> 58 #include <wtf/SetForScope.h> 58 59 #include <wtf/StdLibExtras.h> 59 60 … … 225 226 } 226 227 228 // Prevent recursive loading of link. 229 if (m_isHandlingBeforeLoad) 230 return; 231 227 232 URL url = getNonEmptyURLAttribute(hrefAttr); 228 233 … … 244 249 } 245 250 251 { 252 SetForScope<bool> change(m_isHandlingBeforeLoad, true); 246 253 if (!shouldLoadLink()) 247 254 return; 255 } 248 256 249 257 m_loading = true; … … 278 286 request.setAsPotentiallyCrossOrigin(crossOrigin(), document()); 279 287 288 ASSERT_WITH_SECURITY_IMPLICATION(!m_cachedSheet); 280 289 m_cachedSheet = document().cachedResourceLoader().requestCSSStyleSheet(WTFMove(request)); 281 290 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/html/HTMLLinkElement.h ¶
r217367 r219817 2 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 3 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 4 * Copyright (C) 2003 , 2008, 2010Apple Inc. All rights reserved.4 * Copyright (C) 2003-2017 Apple Inc. All rights reserved. 5 5 * Copyright (C) 2011 Google Inc. All rights reserved. 6 6 * … … 134 134 bool m_firedLoad; 135 135 bool m_loadedResource; 136 bool m_isHandlingBeforeLoad { false }; 136 137 137 138 PendingSheetType m_pendingSheetType; -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/html/HTMLMediaElement.cpp ¶
r217367 r219817 569 569 m_updatePlaybackControlsManagerQueue.close(); 570 570 m_playbackControlsManagerBehaviorRestrictionsQueue.close(); 571 m_resourceSelectionTaskQueue.close(); 571 572 572 573 m_completelyLoaded = true; … … 1011 1012 void HTMLMediaElement::notifyAboutPlaying() 1012 1013 { 1014 Ref<HTMLMediaElement> protectedThis(*this); // The 'playing' event can make arbitrary DOM mutations. 1013 1015 m_playbackStartedTime = currentMediaTime().toDouble(); 1014 1016 dispatchEvent(Event::create(eventNames().playingEvent, false, true)); … … 5116 5118 m_mediaSession->canProduceAudioChanged(); 5117 5119 5120 m_resourceSelectionTaskQueue.cancelAllTasks(); 5121 5118 5122 updateSleepDisabling(); 5119 5123 } -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/html/parser/HTMLConstructionSite.cpp ¶
r217367 r219817 103 103 static inline void insert(HTMLConstructionSiteTask& task) 104 104 { 105 if (is<HTMLTemplateElement>(*task.parent)) 105 if (is<HTMLTemplateElement>(*task.parent)) { 106 106 task.parent = &downcast<HTMLTemplateElement>(*task.parent).content(); 107 task.nextChild = nullptr; 108 } 107 109 108 110 ASSERT(!task.child->parentNode()); -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/loader/DocumentThreadableLoader.cpp ¶
r217367 r219817 227 227 228 228 Ref<DocumentThreadableLoader> protectedThis(*this); 229 --m_options.maxRedirectCount; 229 230 230 231 // FIXME: We restrict this check to Fetch API for the moment, as this might disrupt WorkerScriptLoader. … … 251 252 252 253 ASSERT(m_resource); 253 ASSERT(m_resource->loader()); 254 ASSERT(m_originalHeaders); 255 256 // Use a unique for subsequent loads if needed. 257 // https://fetch.spec.whatwg.org/#concept-http-redirect-fetch (Step 10). 254 258 ASSERT(m_options.mode == FetchOptions::Mode::Cors); 255 ASSERT(m_originalHeaders); 256 257 // Loader might have modified the origin to a unique one, let's reuse it for subsequent loads. 258 m_origin = m_resource->loader()->origin(); 259 if (!securityOrigin().canRequest(redirectResponse.url()) && !protocolHostAndPortAreEqual(redirectResponse.url(), request.url())) 260 m_origin = SecurityOrigin::createUnique(); 259 261 260 262 // Except in case where preflight is needed, loading should be able to continue on its own. … … 264 266 265 267 m_options.allowCredentials = DoNotAllowStoredCredentials; 266 m_options.maxRedirectCount -= m_resource->loader()->redirectCount();267 268 268 269 clearResource(); -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/loader/ImageLoader.cpp ¶
r217367 r219817 395 395 return; 396 396 m_hasPendingBeforeLoadEvent = false; 397 Ref<Document> originalDocument = element().document(); 397 398 if (element().dispatchBeforeLoadEvent(m_image->url())) { 399 bool didEventListenerDisconnectThisElement = !element().isConnected() || &element().document() != originalDocument.ptr(); 400 if (didEventListenerDisconnectThisElement) 401 return; 402 398 403 updateRenderer(); 399 404 return; -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/loader/SubresourceLoader.cpp ¶
r217367 r219817 496 496 redirectingToNewOrigin = true; 497 497 else 498 redirectingToNewOrigin = ! SecurityOrigin::create(previousRequest.url())->canRequest(newRequest.url());498 redirectingToNewOrigin = !protocolHostAndPortAreEqual(previousRequest.url(), newRequest.url()); 499 499 } 500 500 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/page/FocusController.cpp ¶
r217367 r219817 379 379 while (is<HTMLFrameOwnerElement>(element)) { 380 380 HTMLFrameOwnerElement& owner = downcast<HTMLFrameOwnerElement>(*element); 381 if (!owner.contentFrame() )381 if (!owner.contentFrame() || !owner.contentFrame()->document()) 382 382 break; 383 owner.contentFrame()->document()->updateLayoutIgnorePendingStylesheets(); 383 384 Element* foundElement = findFocusableElementWithinScope(direction, FocusNavigationScope::scopeOwnedByIFrame(owner), nullptr, event); 384 385 if (!foundElement) -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/page/FrameView.cpp ¶
r217367 r219817 1576 1576 // we call it through the timer here. 1577 1577 m_postLayoutTasksTimer.startOneShot(0); 1578 if (needsLayout())1579 layout();1580 1578 } 1579 if (needsLayout()) 1580 layout(); 1581 1581 } 1582 1582 … … 3541 3541 3542 3542 if (AXObjectCache* cache = frame().document()->existingAXObjectCache()) 3543 cache->performDeferred IsIgnoredChange();3543 cache->performDeferredCacheUpdate(); 3544 3544 } 3545 3545 … … 4429 4429 #endif 4430 4430 4431 if (m_layoutPhase == InViewSizeAdjust)4432 return;4433 4434 TraceScope tracingScope(PaintViewStart, PaintViewEnd);4435 4436 ASSERT(m_layoutPhase == InPostLayerPositionsUpdatedAfterLayout || m_layoutPhase == OutsideLayout);4437 4438 4431 RenderView* renderView = this->renderView(); 4439 4432 if (!renderView) { … … 4441 4434 return; 4442 4435 } 4436 4437 if (!inPaintableState()) 4438 return; 4439 4440 TraceScope tracingScope(PaintViewStart, PaintViewEnd); 4443 4441 4444 4442 ASSERT(!needsLayout()); -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/page/FrameView.h ¶
r217367 r219817 115 115 bool isInLayout() const { return m_layoutPhase != OutsideLayout; } 116 116 bool isInRenderTreeLayout() const { return m_layoutPhase == InRenderTreeLayout; } 117 WEBCORE_EXPORTbool inPaintableState() { return m_layoutPhase != InRenderTreeLayout && m_layoutPhase != InViewSizeAdjust && m_layoutPhase != InPostLayout; }117 bool inPaintableState() { return m_layoutPhase != InRenderTreeLayout && m_layoutPhase != InViewSizeAdjust && m_layoutPhase != InPostLayout; } 118 118 119 119 RenderElement* layoutRoot() const { return m_layoutRoot; } -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/platform/URL.cpp ¶
r217367 r219817 550 550 #endif 551 551 552 static Lock& defaultPortForProtocolMapForTestingLock() 553 { 554 static NeverDestroyed<Lock> lock; 555 return lock; 556 } 557 552 558 using DefaultPortForProtocolMapForTesting = HashMap<String, uint16_t>; 553 static DefaultPortForProtocolMapForTesting & defaultPortForProtocolMapForTesting()554 { 555 static NeverDestroyed<DefaultPortForProtocolMapForTesting>defaultPortForProtocolMap;559 static DefaultPortForProtocolMapForTesting*& defaultPortForProtocolMapForTesting() 560 { 561 static DefaultPortForProtocolMapForTesting* defaultPortForProtocolMap; 556 562 return defaultPortForProtocolMap; 557 563 } 558 564 565 static DefaultPortForProtocolMapForTesting& ensureDefaultPortForProtocolMapForTesting() 566 { 567 DefaultPortForProtocolMapForTesting*& defaultPortForProtocolMap = defaultPortForProtocolMapForTesting(); 568 if (!defaultPortForProtocolMap) 569 defaultPortForProtocolMap = new DefaultPortForProtocolMapForTesting; 570 return *defaultPortForProtocolMap; 571 } 572 559 573 void registerDefaultPortForProtocolForTesting(uint16_t port, const String& protocol) 560 574 { 561 defaultPortForProtocolMapForTesting().add(protocol, port); 575 LockHolder locker(defaultPortForProtocolMapForTestingLock()); 576 ensureDefaultPortForProtocolMapForTesting().add(protocol, port); 562 577 } 563 578 564 579 void clearDefaultPortForProtocolMapForTesting() 565 580 { 566 defaultPortForProtocolMapForTesting().clear(); 581 LockHolder locker(defaultPortForProtocolMapForTestingLock()); 582 if (auto* map = defaultPortForProtocolMapForTesting()) 583 map->clear(); 567 584 } 568 585 569 586 std::optional<uint16_t> defaultPortForProtocol(StringView protocol) 570 587 { 571 const auto& defaultPortForProtocolMap = defaultPortForProtocolMapForTesting(); 572 auto iterator = defaultPortForProtocolMap.find(protocol.toStringWithoutCopying()); 573 if (iterator != defaultPortForProtocolMap.end()) 574 return iterator->value; 588 if (auto* overrideMap = defaultPortForProtocolMapForTesting()) { 589 LockHolder locker(defaultPortForProtocolMapForTestingLock()); 590 ASSERT(overrideMap); // No need to null check again here since overrideMap cannot become null after being non-null. 591 auto iterator = overrideMap->find(protocol.toStringWithoutCopying()); 592 if (iterator != overrideMap->end()) 593 return iterator->value; 594 } 575 595 return URLParser::defaultPortForProtocol(protocol); 576 596 } -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/platform/graphics/FloatRect.cpp ¶
r217367 r219817 216 216 IntRect enclosingIntRect(const FloatRect& rect) 217 217 { 218 IntPoint location = flooredIntPoint(rect.minXMinYCorner()); 219 IntPoint maxPoint = ceiledIntPoint(rect.maxXMaxYCorner()); 220 221 return IntRect(location, maxPoint - location); 218 FloatPoint location = flooredIntPoint(rect.minXMinYCorner()); 219 FloatPoint maxPoint = ceiledIntPoint(rect.maxXMaxYCorner()); 220 return IntRect(IntPoint(location), IntSize(maxPoint - location)); 222 221 } 223 222 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/platform/graphics/ImageBackingStore.h ¶
r217367 r219817 30 30 #include "IntSize.h" 31 31 #include "NativeImage.h" 32 33 #include <wtf/Vector.h> 32 #include "SharedBuffer.h" 34 33 35 34 namespace WebCore { … … 55 54 return false; 56 55 57 unsigned area = size.area().unsafeGet(); 58 if (!m_pixels.tryReserveCapacity(area)) 56 Vector<char> buffer; 57 size_t bufferSize = size.area().unsafeGet() * sizeof(RGBA32); 58 59 if (!buffer.tryReserveCapacity(bufferSize)) 59 60 return false; 60 61 61 m_pixels.resize(area); 62 m_pixelsPtr = m_pixels.data(); 62 buffer.resize(bufferSize); 63 m_pixels = SharedBuffer::adoptVector(buffer); 64 m_pixelsPtr = reinterpret_cast<RGBA32*>(const_cast<char*>(m_pixels->data())); 63 65 m_size = size; 64 66 m_frameRect = IntRect(IntPoint(), m_size); … … 184 186 185 187 ImageBackingStore(const ImageBackingStore& other) 186 : m_pixels(other.m_pixels) 187 , m_size(other.m_size) 188 : m_size(other.m_size) 188 189 , m_premultiplyAlpha(other.m_premultiplyAlpha) 189 190 { 190 191 ASSERT(!m_size.isEmpty() && !isOverSize(m_size)); 191 m_pixelsPtr = m_pixels.data(); 192 m_pixels = other.m_pixels->copy(); 193 m_pixelsPtr = reinterpret_cast<RGBA32*>(const_cast<char*>(m_pixels->data())); 192 194 } 193 195 … … 213 215 } 214 216 215 Vector<RGBA32> m_pixels;217 RefPtr<SharedBuffer> m_pixels; 216 218 RGBA32* m_pixelsPtr { nullptr }; 217 219 IntSize m_size; -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp ¶
r217367 r219817 76 76 77 77 RefPtr<InbandTextTrackPrivateGStreamer> protectedThis(this); 78 m_notifier .notify(MainThreadNotification::NewSample, [protectedThis] {78 m_notifier->notify(MainThreadNotification::NewSample, [protectedThis] { 79 79 protectedThis->notifyTrackOfSample(); 80 80 }); … … 84 84 { 85 85 RefPtr<InbandTextTrackPrivateGStreamer> protectedThis(this); 86 m_notifier .notify(MainThreadNotification::StreamChanged, [protectedThis] {86 m_notifier->notify(MainThreadNotification::StreamChanged, [protectedThis] { 87 87 protectedThis->notifyTrackOfStreamChanged(); 88 88 }); -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/platform/graphics/gstreamer/MainThreadNotifier.h ¶
r217367 r219817 17 17 */ 18 18 19 #ifndef MainThreadNotifier_h 20 #define MainThreadNotifier_h 19 #pragma once 21 20 21 #include <wtf/Atomics.h> 22 22 #include <wtf/Lock.h> 23 23 #include <wtf/MainThread.h> 24 24 #include <wtf/RunLoop.h> 25 #include <wtf/ WeakPtr.h>25 #include <wtf/ThreadSafeRefCounted.h> 26 26 27 27 namespace WebCore { 28 28 29 29 template <typename T> 30 class MainThreadNotifier {30 class MainThreadNotifier final : public ThreadSafeRefCounted<MainThreadNotifier<T>> { 31 31 public: 32 MainThreadNotifier() 33 : m_weakPtrFactory(this) 32 static Ref<MainThreadNotifier> create() 34 33 { 34 return adoptRef(*new MainThreadNotifier()); 35 35 } 36 36 … … 38 38 void notify(T notificationType, const F& callbackFunctor) 39 39 { 40 ASSERT(m_isValid.load()); 40 41 if (isMainThread()) { 41 42 removePendingNotification(notificationType); … … 47 48 return; 48 49 49 auto weakThis = m_weakPtrFactory.createWeakPtr();50 std::function<void ()> callback(callbackFunctor);51 RunLoop::main().dispatch([weakThis, notificationType, callback] {52 if ( weakThis && weakThis->removePendingNotification(notificationType))50 RunLoop::main().dispatch([this, protectedThis = makeRef(*this), notificationType, callback = std::function<void()>(callbackFunctor)] { 51 if (!m_isValid.load()) 52 return; 53 if (removePendingNotification(notificationType)) 53 54 callback(); 54 55 }); … … 57 58 void cancelPendingNotifications(unsigned mask = 0) 58 59 { 60 ASSERT(m_isValid.load()); 59 61 LockHolder locker(m_pendingNotificationsLock); 60 62 if (mask) … … 64 66 } 65 67 68 void invalidate() 69 { 70 ASSERT(m_isValid.load()); 71 m_isValid.store(false); 72 } 73 66 74 private: 75 MainThreadNotifier() 76 { 77 m_isValid.store(true); 78 } 67 79 68 80 bool addPendingNotification(T notificationType) … … 85 97 } 86 98 87 WeakPtrFactory<MainThreadNotifier> m_weakPtrFactory;88 99 Lock m_pendingNotificationsLock; 89 100 unsigned m_pendingNotifications { 0 }; 101 Atomic<bool> m_isValid; 90 102 }; 91 92 103 93 104 } // namespace WebCore 94 105 95 #endif // MainThreadNotifier_h -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp ¶
r217367 r219817 621 621 void MediaPlayerPrivateGStreamer::videoChangedCallback(MediaPlayerPrivateGStreamer* player) 622 622 { 623 player->m_notifier .notify(MainThreadNotification::VideoChanged, [player] { player->notifyPlayerOfVideo(); });623 player->m_notifier->notify(MainThreadNotification::VideoChanged, [player] { player->notifyPlayerOfVideo(); }); 624 624 } 625 625 … … 675 675 void MediaPlayerPrivateGStreamer::videoSinkCapsChangedCallback(MediaPlayerPrivateGStreamer* player) 676 676 { 677 player->m_notifier .notify(MainThreadNotification::VideoCapsChanged, [player] { player->notifyPlayerOfVideoCaps(); });677 player->m_notifier->notify(MainThreadNotification::VideoCapsChanged, [player] { player->notifyPlayerOfVideoCaps(); }); 678 678 } 679 679 … … 686 686 void MediaPlayerPrivateGStreamer::audioChangedCallback(MediaPlayerPrivateGStreamer* player) 687 687 { 688 player->m_notifier .notify(MainThreadNotification::AudioChanged, [player] { player->notifyPlayerOfAudio(); });688 player->m_notifier->notify(MainThreadNotification::AudioChanged, [player] { player->notifyPlayerOfAudio(); }); 689 689 } 690 690 … … 739 739 void MediaPlayerPrivateGStreamer::textChangedCallback(MediaPlayerPrivateGStreamer* player) 740 740 { 741 player->m_notifier .notify(MainThreadNotification::TextChanged, [player] { player->notifyPlayerOfText(); });741 player->m_notifier->notify(MainThreadNotification::TextChanged, [player] { player->notifyPlayerOfText(); }); 742 742 } 743 743 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp ¶
r217367 r219817 201 201 202 202 MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase(MediaPlayer* player) 203 : m_player(player) 203 : m_notifier(MainThreadNotifier<MainThreadNotification>::create()) 204 , m_player(player) 204 205 , m_fpsSink(nullptr) 205 206 , m_readyState(MediaPlayer::HaveNothing) … … 224 225 m_protectionCondition.notifyOne(); 225 226 #endif 226 m_notifier.cancelPendingNotifications(); 227 228 #if USE(GSTREAMER_GL) || USE(COORDINATED_GRAPHICS_THREADED) 229 m_drawTimer.stop(); 230 { 231 LockHolder locker(m_drawMutex); 232 m_drawCondition.notifyOne(); 233 } 234 #endif 227 228 m_notifier->invalidate(); 229 230 cancelRepaint(); 235 231 236 232 if (m_videoSink) { … … 573 569 GST_DEBUG("Volume changed to: %f", player->volume()); 574 570 575 player->m_notifier .notify(MainThreadNotification::VolumeChanged, [player] { player->notifyPlayerOfVolumeChange(); });571 player->m_notifier->notify(MainThreadNotification::VolumeChanged, [player] { player->notifyPlayerOfVolumeChange(); }); 576 572 } 577 573 … … 622 618 { 623 619 // This is called when m_volumeElement receives the notify::mute signal. 624 player->m_notifier .notify(MainThreadNotification::MuteChanged, [player] { player->notifyPlayerOfMute(); });620 player->m_notifier->notify(MainThreadNotification::MuteChanged, [player] { player->notifyPlayerOfMute(); }); 625 621 } 626 622 … … 762 758 if (triggerResize) { 763 759 GST_DEBUG("First sample reached the sink, triggering video dimensions update"); 764 m_notifier .notify(MainThreadNotification::SizeChanged, [this] { m_player->sizeChanged(); });760 m_notifier->notify(MainThreadNotification::SizeChanged, [this] { m_player->sizeChanged(); }); 765 761 } 766 762 … … 802 798 { 803 799 player->triggerRepaint(sample); 800 } 801 802 void MediaPlayerPrivateGStreamerBase::cancelRepaint() 803 { 804 #if USE(TEXTURE_MAPPER_GL) || USE(COORDINATED_GRAPHICS_THREADED) 805 m_drawTimer.stop(); 806 LockHolder locker(m_drawMutex); 807 m_drawCondition.notifyOne(); 808 #endif 809 } 810 811 void MediaPlayerPrivateGStreamerBase::repaintCancelledCallback(MediaPlayerPrivateGStreamerBase* player) 812 { 813 player->cancelRepaint(); 804 814 } 805 815 … … 1141 1151 m_videoSink = webkitVideoSinkNew(); 1142 1152 g_signal_connect_swapped(m_videoSink.get(), "repaint-requested", G_CALLBACK(repaintCallback), this); 1153 g_signal_connect_swapped(m_videoSink.get(), "repaint-cancelled", G_CALLBACK(repaintCancelledCallback), this); 1143 1154 } 1144 1155 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h ¶
r217367 r219817 173 173 void triggerRepaint(GstSample*); 174 174 void repaint(); 175 void cancelRepaint(); 175 176 176 177 static void repaintCallback(MediaPlayerPrivateGStreamerBase*, GstSample*); 178 static void repaintCancelledCallback(MediaPlayerPrivateGStreamerBase*); 177 179 178 180 void notifyPlayerOfVolumeChange(); … … 194 196 }; 195 197 196 MainThreadNotifier<MainThreadNotification> m_notifier;198 Ref<MainThreadNotifier<MainThreadNotification>> m_notifier; 197 199 MediaPlayer* m_player; 198 200 GRefPtr<GstElement> m_pipeline; -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp ¶
r217367 r219817 45 45 46 46 TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer(TrackPrivateBase* owner, gint index, GRefPtr<GstPad> pad) 47 : m_index(index) 47 : m_notifier(MainThreadNotifier<MainThreadNotification>::create()) 48 , m_index(index) 48 49 , m_pad(pad) 49 50 , m_owner(owner) … … 62 63 { 63 64 disconnect(); 65 m_notifier->invalidate(); 64 66 } 65 67 … … 69 71 return; 70 72 71 m_notifier .cancelPendingNotifications();73 m_notifier->cancelPendingNotifications(); 72 74 g_signal_handlers_disconnect_matched(m_pad.get(), G_SIGNAL_MATCH_DATA, 0, 0, nullptr, nullptr, this); 73 75 … … 78 80 void TrackPrivateBaseGStreamer::activeChangedCallback(TrackPrivateBaseGStreamer* track) 79 81 { 80 track->m_notifier .notify(MainThreadNotification::ActiveChanged, [track] { track->notifyTrackOfActiveChanged(); });82 track->m_notifier->notify(MainThreadNotification::ActiveChanged, [track] { track->notifyTrackOfActiveChanged(); }); 81 83 } 82 84 … … 99 101 } 100 102 101 m_notifier .notify(MainThreadNotification::TagsChanged, [this] { notifyTrackOfTagsChanged(); });103 m_notifier->notify(MainThreadNotification::TagsChanged, [this] { notifyTrackOfTagsChanged(); }); 102 104 } 103 105 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h ¶
r217367 r219817 64 64 }; 65 65 66 MainThreadNotifier<MainThreadNotification> m_notifier;66 Ref<MainThreadNotifier<MainThreadNotification>> m_notifier; 67 67 gint m_index; 68 68 AtomicString m_label; -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp ¶
r217367 r219817 59 59 enum { 60 60 REPAINT_REQUESTED, 61 REPAINT_CANCELLED, 61 62 LAST_SIGNAL 62 63 }; … … 191 192 { 192 193 g_signal_emit(sink, webkitVideoSinkSignals[REPAINT_REQUESTED], 0, sample); 194 } 195 196 static void webkitVideoSinkRepaintCancelled(WebKitVideoSink* sink) 197 { 198 g_signal_emit(sink, webkitVideoSinkSignals[REPAINT_CANCELLED], 0); 193 199 } 194 200 … … 285 291 286 292 priv->scheduler.stop(); 293 webkitVideoSinkRepaintCancelled(WEBKIT_VIDEO_SINK(baseSink)); 287 294 288 295 return GST_CALL_PARENT_WITH_DEFAULT(GST_BASE_SINK_CLASS, unlock, (baseSink), TRUE); … … 303 310 304 311 priv->scheduler.stop(); 312 webkitVideoSinkRepaintCancelled(WEBKIT_VIDEO_SINK(baseSink)); 305 313 if (priv->currentCaps) { 306 314 gst_caps_unref(priv->currentCaps); … … 404 412 1, // Only one parameter 405 413 GST_TYPE_SAMPLE); 414 webkitVideoSinkSignals[REPAINT_CANCELLED] = g_signal_new("repaint-cancelled", 415 G_TYPE_FROM_CLASS(klass), 416 G_SIGNAL_RUN_LAST, 417 0, // Class offset 418 nullptr, // Accumulator 419 nullptr, // Accumulator data 420 g_cclosure_marshal_generic, 421 G_TYPE_NONE, // Return type 422 0, // No parameters 423 G_TYPE_NONE); 406 424 } 407 425 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp ¶
r217367 r219817 165 165 166 166 bool createdInMainThread; 167 MainThreadNotifier<MainThreadSourceNotification> notifier;167 RefPtr<MainThreadNotifier<MainThreadSourceNotification>> notifier; 168 168 GRefPtr<GstBuffer> buffer; 169 169 }; … … 278 278 279 279 priv->createdInMainThread = isMainThread(); 280 priv->notifier = MainThreadNotifier<MainThreadSourceNotification>::create(); 280 281 281 282 priv->appsrc = GST_APP_SRC(gst_element_factory_make("appsrc", nullptr)); … … 327 328 static void webKitWebSrcDispose(GObject* object) 328 329 { 329 WebKitWebSrc* src = WEBKIT_WEB_SRC(object); 330 WebKitWebSrcPrivate* priv = src->priv; 330 WebKitWebSrcPrivate* priv = WEBKIT_WEB_SRC(object)->priv; 331 if (priv->notifier) { 332 priv->notifier->invalidate(); 333 priv->notifier = nullptr; 334 } 331 335 332 336 priv->player = nullptr; … … 409 413 if (priv->resource || (priv->loader && !priv->keepAlive)) { 410 414 GRefPtr<WebKitWebSrc> protector = WTF::ensureGRef(src); 411 priv->notifier .cancelPendingNotifications(MainThreadSourceNotification::NeedData | MainThreadSourceNotification::EnoughData | MainThreadSourceNotification::Seek);412 priv->notifier .notify(MainThreadSourceNotification::Stop, [protector, keepAlive = priv->keepAlive] {415 priv->notifier->cancelPendingNotifications(MainThreadSourceNotification::NeedData | MainThreadSourceNotification::EnoughData | MainThreadSourceNotification::Seek); 416 priv->notifier->notify(MainThreadSourceNotification::Stop, [protector, keepAlive = priv->keepAlive] { 413 417 WebKitWebSrcPrivate* priv = protector->priv; 414 418 … … 593 597 locker.unlock(); 594 598 GRefPtr<WebKitWebSrc> protector = WTF::ensureGRef(src); 595 priv->notifier .notify(MainThreadSourceNotification::Start, [protector, request = WTFMove(request)] {599 priv->notifier->notify(MainThreadSourceNotification::Start, [protector, request = WTFMove(request)] { 596 600 WebKitWebSrcPrivate* priv = protector->priv; 597 601 … … 793 797 794 798 GRefPtr<WebKitWebSrc> protector = WTF::ensureGRef(src); 795 priv->notifier .notify(MainThreadSourceNotification::NeedData, [protector] {799 priv->notifier->notify(MainThreadSourceNotification::NeedData, [protector] { 796 800 WebKitWebSrcPrivate* priv = protector->priv; 797 801 if (priv->resource) … … 818 822 819 823 GRefPtr<WebKitWebSrc> protector = WTF::ensureGRef(src); 820 priv->notifier .notify(MainThreadSourceNotification::EnoughData, [protector] {824 priv->notifier->notify(MainThreadSourceNotification::EnoughData, [protector] { 821 825 WebKitWebSrcPrivate* priv = protector->priv; 822 826 if (priv->resource) … … 849 853 850 854 GRefPtr<WebKitWebSrc> protector = WTF::ensureGRef(src); 851 priv->notifier .notify(MainThreadSourceNotification::Seek, [protector] {855 priv->notifier->notify(MainThreadSourceNotification::Seek, [protector] { 852 856 webKitWebSrcStop(protector.get()); 853 857 webKitWebSrcStart(protector.get()); -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/platform/gtk/RenderThemeGadget.cpp ¶
r217367 r219817 61 61 gtk_style_context_set_path(context.get(), path); 62 62 gtk_style_context_set_parent(context.get(), parent); 63 // Unfortunately, we have to explicitly set the state again here for it to take effect.64 gtk_style_context_set_state(context.get(), gtk_widget_path_iter_get_state(path, -1));65 63 return context; 66 64 } … … 73 71 for (const auto* className : info.classList) 74 72 gtk_widget_path_iter_add_class(path, -1, className); 75 gtk_widget_path_iter_set_state(path, -1, static_cast<GtkStateFlags>(gtk_widget_path_iter_get_state(path, -1) | info.state));76 73 } 77 74 … … 145 142 gtk_style_context_get(m_context.get(), gtk_style_context_get_state(m_context.get()), "opacity", &returnValue, nullptr); 146 143 return returnValue; 144 } 145 146 GtkStateFlags RenderThemeGadget::state() const 147 { 148 return gtk_style_context_get_state(m_context.get()); 149 } 150 151 void RenderThemeGadget::setState(GtkStateFlags state) 152 { 153 gtk_style_context_set_state(m_context.get(), state); 147 154 } 148 155 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/platform/gtk/RenderThemeGadget.h ¶
r217367 r219817 57 57 Type type; 58 58 const char* name; 59 GtkStateFlags state;60 59 Vector<const char*> classList; 61 60 }; … … 77 76 78 77 GtkStyleContext* context() const { return m_context.get(); } 78 79 GtkStateFlags state() const; 80 void setState(GtkStateFlags); 79 81 80 82 protected: -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/platform/gtk/ScrollbarThemeGtk.cpp ¶
r217367 r219817 31 31 #include "PlatformContextCairo.h" 32 32 #include "PlatformMouseEvent.h" 33 #include "RenderTheme Gadget.h"33 #include "RenderThemeWidget.h" 34 34 #include "ScrollView.h" 35 35 #include "Scrollbar.h" … … 97 97 void ScrollbarThemeGtk::themeChanged() 98 98 { 99 #if GTK_CHECK_VERSION(3, 20, 0) 100 RenderThemeWidget::clearCache(); 101 #endif 99 102 updateThemeProperties(); 100 103 } … … 103 106 void ScrollbarThemeGtk::updateThemeProperties() 104 107 { 105 auto steppers = static_cast<RenderThemeScrollbarGadget*>(RenderThemeGadget::create({ RenderThemeGadget::Type::Scrollbar, "scrollbar", GTK_STATE_FLAG_NORMAL, { } }).get())->steppers();106 m_hasBackButtonStartPart = s teppers.contains(RenderThemeScrollbarGadget::Steppers::Backward);107 m_hasForwardButtonEndPart = s teppers.contains(RenderThemeScrollbarGadget::Steppers::Forward);108 m_hasBackButtonEndPart = s teppers.contains(RenderThemeScrollbarGadget::Steppers::SecondaryBackward);109 m_hasForwardButtonStartPart = s teppers.contains(RenderThemeScrollbarGadget::Steppers::SecondaryForward);108 auto& scrollbar = static_cast<RenderThemeScrollbar&>(RenderThemeWidget::getOrCreate(RenderThemeWidget::Type::VerticalScrollbarRight)); 109 m_hasBackButtonStartPart = scrollbar.stepper(RenderThemeScrollbarGadget::Steppers::Backward); 110 m_hasForwardButtonEndPart = scrollbar.stepper(RenderThemeScrollbarGadget::Steppers::Forward); 111 m_hasBackButtonEndPart = scrollbar.stepper(RenderThemeScrollbarGadget::Steppers::SecondaryBackward); 112 m_hasForwardButtonStartPart = scrollbar.stepper(RenderThemeScrollbarGadget::Steppers::SecondaryForward); 110 113 } 111 114 #else … … 169 172 } 170 173 171 static std::unique_ptr<RenderThemeGadget> scrollbarGadgetForLayout(Scrollbar& scrollbar) 172 { 173 RenderThemeGadget::Info info = { RenderThemeGadget::Type::Scrollbar, "scrollbar", scrollbarPartStateFlags(scrollbar, AllParts), { } }; 174 static RenderThemeWidget::Type widgetTypeForScrollbar(Scrollbar& scrollbar, GtkStateFlags scrollbarState) 175 { 174 176 if (scrollbar.orientation() == VerticalScrollbar) { 175 info.classList.append("vertical"); 176 info.classList.append("right"); 177 } else { 178 info.classList.append("horizontal"); 179 info.classList.append("bottom"); 180 } 181 if (scrollbar.isOverlayScrollbar()) 182 info.classList.append("overlay-indicator"); 183 if (info.state & GTK_STATE_FLAG_PRELIGHT) 184 info.classList.append("hovering"); 185 186 return RenderThemeGadget::create(info); 187 } 188 189 static std::unique_ptr<RenderThemeBoxGadget> contentsGadgetForLayout(Scrollbar& scrollbar, RenderThemeGadget* parent, IntRect& contentsRect, Vector<int, 4>& steppersPosition) 190 { 191 Vector<RenderThemeGadget::Info> children; 192 auto steppers = static_cast<RenderThemeScrollbarGadget*>(parent)->steppers(); 193 if (steppers.contains(RenderThemeScrollbarGadget::Steppers::Backward)) { 194 steppersPosition[0] = 0; 195 children.append({ RenderThemeGadget::Type::Generic, "button", scrollbarPartStateFlags(scrollbar, BackButtonStartPart), { "up" } }); 196 } 197 if (steppers.contains(RenderThemeScrollbarGadget::Steppers::SecondaryForward)) { 198 steppersPosition[1] = children.size(); 199 children.append({ RenderThemeGadget::Type::Generic, "button", scrollbarPartStateFlags(scrollbar, ForwardButtonStartPart), { "down" } }); 200 } 201 children.append({ RenderThemeGadget::Type::Generic, "trough", scrollbarPartStateFlags(scrollbar, BackTrackPart), { } }); 202 if (steppers.contains(RenderThemeScrollbarGadget::Steppers::SecondaryBackward)) { 203 steppersPosition[2] = children.size(); 204 children.append({ RenderThemeGadget::Type::Generic, "button", scrollbarPartStateFlags(scrollbar, BackButtonEndPart), { "up" } }); 205 } 206 if (steppers.contains(RenderThemeScrollbarGadget::Steppers::Forward)) { 207 steppersPosition[3] = children.size(); 208 children.append({ RenderThemeGadget::Type::Generic, "button", scrollbarPartStateFlags(scrollbar, ForwardButtonEndPart), { "down" } }); 209 } 210 RenderThemeGadget::Info info = { RenderThemeGadget::Type::Generic, "contents", GTK_STATE_FLAG_NORMAL, { } }; 211 auto contentsGadget = std::make_unique<RenderThemeBoxGadget>(info, scrollbar.orientation() == VerticalScrollbar ? GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL, 212 children, parent); 213 214 GtkBorder scrollbarContentsBox = parent->contentsBox(); 215 GtkBorder contentsContentsBox = contentsGadget->contentsBox(); 177 if (scrollbar.scrollableArea().shouldPlaceBlockDirectionScrollbarOnLeft()) 178 return scrollbarState & GTK_STATE_FLAG_PRELIGHT ? RenderThemeWidget::Type::VerticalScrollbarLeft : RenderThemeWidget::Type::VerticalScrollIndicatorLeft; 179 return scrollbarState & GTK_STATE_FLAG_PRELIGHT ? RenderThemeWidget::Type::VerticalScrollbarRight : RenderThemeWidget::Type::VerticalScrollIndicatorRight; 180 } 181 return scrollbarState & GTK_STATE_FLAG_PRELIGHT ? RenderThemeWidget::Type::HorizontalScrollbar : RenderThemeWidget::Type::HorizontalScrollIndicator; 182 } 183 184 static IntRect contentsRectangle(Scrollbar& scrollbar, RenderThemeScrollbar& scrollbarWidget) 185 { 186 GtkBorder scrollbarContentsBox = scrollbarWidget.scrollbar().contentsBox(); 187 GtkBorder contentsContentsBox = scrollbarWidget.contents().contentsBox(); 216 188 GtkBorder padding; 217 189 padding.left = scrollbarContentsBox.left + contentsContentsBox.left; … … 219 191 padding.top = scrollbarContentsBox.top + contentsContentsBox.top; 220 192 padding.bottom = scrollbarContentsBox.bottom + contentsContentsBox.bottom; 221 contentsRect = scrollbar.frameRect();193 IntRect contentsRect = scrollbar.frameRect(); 222 194 contentsRect.move(padding.left, padding.top); 223 195 contentsRect.contract(padding.left + padding.right, padding.top + padding.bottom); 224 return contents Gadget;196 return contentsRect; 225 197 } 226 198 227 199 IntRect ScrollbarThemeGtk::trackRect(Scrollbar& scrollbar, bool /*painting*/) 228 200 { 229 auto scrollbarGadget = scrollbarGadgetForLayout(scrollbar); 230 IntRect rect; 231 Vector<int, 4> steppersPosition(4, -1); 232 auto contentsGadget = contentsGadgetForLayout(scrollbar, scrollbarGadget.get(), rect, steppersPosition); 233 234 if (steppersPosition[0] != -1) { 235 IntSize stepperSize = contentsGadget->child(steppersPosition[0])->preferredSize(); 201 auto scrollbarState = scrollbarPartStateFlags(scrollbar, AllParts); 202 auto& scrollbarWidget = static_cast<RenderThemeScrollbar&>(RenderThemeWidget::getOrCreate(widgetTypeForScrollbar(scrollbar, scrollbarState))); 203 scrollbarWidget.scrollbar().setState(scrollbarState); 204 205 IntRect rect = contentsRectangle(scrollbar, scrollbarWidget); 206 if (auto* backwardStepper = scrollbarWidget.stepper(RenderThemeScrollbarGadget::Steppers::Backward)) { 207 backwardStepper->setState(scrollbarPartStateFlags(scrollbar, BackButtonStartPart)); 208 IntSize stepperSize = backwardStepper->preferredSize(); 236 209 if (scrollbar.orientation() == VerticalScrollbar) { 237 210 rect.move(0, stepperSize.height()); … … 242 215 } 243 216 } 244 if (steppersPosition[1] != -1) { 245 IntSize stepperSize = contentsGadget->child(steppersPosition[1])->preferredSize(); 217 if (auto* secondaryForwardStepper = scrollbarWidget.stepper(RenderThemeScrollbarGadget::Steppers::SecondaryForward)) { 218 secondaryForwardStepper->setState(scrollbarPartStateFlags(scrollbar, ForwardButtonStartPart)); 219 IntSize stepperSize = secondaryForwardStepper->preferredSize(); 246 220 if (scrollbar.orientation() == VerticalScrollbar) { 247 221 rect.move(0, stepperSize.height()); … … 252 226 } 253 227 } 254 if (steppersPosition[2] != -1) { 228 if (auto* secondaryBackwardStepper = scrollbarWidget.stepper(RenderThemeScrollbarGadget::Steppers::SecondaryBackward)) { 229 secondaryBackwardStepper->setState(scrollbarPartStateFlags(scrollbar, BackButtonEndPart)); 255 230 if (scrollbar.orientation() == VerticalScrollbar) 256 rect.contract(0, contentsGadget->child(steppersPosition[2])->preferredSize().height());231 rect.contract(0, secondaryBackwardStepper->preferredSize().height()); 257 232 else 258 rect.contract(contentsGadget->child(steppersPosition[2])->preferredSize().width(), 0); 259 } 260 if (steppersPosition[3] != -1) { 233 rect.contract(secondaryBackwardStepper->preferredSize().width(), 0); 234 } 235 if (auto* forwardStepper = scrollbarWidget.stepper(RenderThemeScrollbarGadget::Steppers::Forward)) { 236 forwardStepper->setState(scrollbarPartStateFlags(scrollbar, ForwardButtonEndPart)); 261 237 if (scrollbar.orientation() == VerticalScrollbar) 262 rect.contract(0, contentsGadget->child(steppersPosition[3])->preferredSize().height());238 rect.contract(0, forwardStepper->preferredSize().height()); 263 239 else 264 rect.contract( contentsGadget->child(steppersPosition[3])->preferredSize().width(), 0);240 rect.contract(forwardStepper->preferredSize().width(), 0); 265 241 } 266 242 … … 328 304 return IntRect(); 329 305 330 auto scrollbarGadget = scrollbarGadgetForLayout(scrollbar); 331 IntRect rect; 332 Vector<int, 4> steppersPosition(4, -1); 333 auto contentsGadget = contentsGadgetForLayout(scrollbar, scrollbarGadget.get(), rect, steppersPosition); 334 335 if (part == BackButtonStartPart) 336 return IntRect(rect.location(), contentsGadget->child(0)->preferredSize()); 337 338 // Secondary back. 339 if (steppersPosition[1] != -1) { 340 IntSize preferredSize = contentsGadget->child(steppersPosition[1])->preferredSize(); 306 auto scrollbarState = scrollbarPartStateFlags(scrollbar, AllParts); 307 auto& scrollbarWidget = static_cast<RenderThemeScrollbar&>(RenderThemeWidget::getOrCreate(widgetTypeForScrollbar(scrollbar, scrollbarState))); 308 scrollbarWidget.scrollbar().setState(scrollbarState); 309 310 IntRect rect = contentsRectangle(scrollbar, scrollbarWidget); 311 if (part == BackButtonStartPart) { 312 auto* backwardStepper = scrollbarWidget.stepper(RenderThemeScrollbarGadget::Steppers::Backward); 313 ASSERT(backwardStepper); 314 backwardStepper->setState(scrollbarPartStateFlags(scrollbar, BackButtonStartPart)); 315 return IntRect(rect.location(), backwardStepper->preferredSize()); 316 } 317 318 if (auto* secondaryForwardStepper = scrollbarWidget.stepper(RenderThemeScrollbarGadget::Steppers::SecondaryForward)) { 319 secondaryForwardStepper->setState(scrollbarPartStateFlags(scrollbar, ForwardButtonStartPart)); 320 IntSize preferredSize = secondaryForwardStepper->preferredSize(); 341 321 if (scrollbar.orientation() == VerticalScrollbar) { 342 322 rect.move(0, preferredSize.height()); … … 348 328 } 349 329 350 if (steppersPosition[3] != -1) { 330 if (auto* secondaryBackwardStepper = scrollbarWidget.stepper(RenderThemeScrollbarGadget::Steppers::SecondaryBackward)) { 331 secondaryBackwardStepper->setState(scrollbarPartStateFlags(scrollbar, BackButtonEndPart)); 351 332 if (scrollbar.orientation() == VerticalScrollbar) 352 rect.contract(0, contentsGadget->child(steppersPosition[3])->preferredSize().height());333 rect.contract(0, secondaryBackwardStepper->preferredSize().height()); 353 334 else 354 rect.contract(contentsGadget->child(steppersPosition[3])->preferredSize().width(), 0); 355 } 356 357 IntSize preferredSize = contentsGadget->child(steppersPosition[2])->preferredSize(); 335 rect.contract(secondaryBackwardStepper->preferredSize().width(), 0); 336 } 337 338 auto* forwardStepper = scrollbarWidget.stepper(RenderThemeScrollbarGadget::Steppers::Forward); 339 ASSERT(forwardStepper); 340 forwardStepper->setState(scrollbarPartStateFlags(scrollbar, ForwardButtonEndPart)); 341 IntSize preferredSize = forwardStepper->preferredSize(); 358 342 if (scrollbar.orientation() == VerticalScrollbar) 359 343 rect.move(0, rect.height() - preferredSize.height()); … … 370 354 return IntRect(); 371 355 372 auto scrollbarGadget = scrollbarGadgetForLayout(scrollbar); 373 IntRect rect; 374 Vector<int, 4> steppersPosition(4, -1); 375 auto contentsGadget = contentsGadgetForLayout(scrollbar, scrollbarGadget.get(), rect, steppersPosition); 376 377 if (steppersPosition[0] != -1) { 378 IntSize preferredSize = contentsGadget->child(steppersPosition[0])->preferredSize(); 356 auto scrollbarState = scrollbarPartStateFlags(scrollbar, AllParts); 357 auto& scrollbarWidget = static_cast<RenderThemeScrollbar&>(RenderThemeWidget::getOrCreate(widgetTypeForScrollbar(scrollbar, scrollbarState))); 358 scrollbarWidget.scrollbar().setState(scrollbarState); 359 360 IntRect rect = contentsRectangle(scrollbar, scrollbarWidget); 361 if (auto* backwardStepper = scrollbarWidget.stepper(RenderThemeScrollbarGadget::Steppers::Backward)) { 362 backwardStepper->setState(scrollbarPartStateFlags(scrollbar, BackButtonStartPart)); 363 IntSize preferredSize = backwardStepper->preferredSize(); 379 364 if (scrollbar.orientation() == VerticalScrollbar) { 380 365 rect.move(0, preferredSize.height()); … … 386 371 } 387 372 388 if (steppersPosition[1] != -1) { 389 IntSize preferredSize = contentsGadget->child(steppersPosition[1])->preferredSize(); 373 if (auto* secondaryForwardStepper = scrollbarWidget.stepper(RenderThemeScrollbarGadget::Steppers::SecondaryForward)) { 374 secondaryForwardStepper->setState(scrollbarPartStateFlags(scrollbar, ForwardButtonStartPart)); 375 IntSize preferredSize = secondaryForwardStepper->preferredSize(); 390 376 if (part == ForwardButtonStartPart) 391 377 return IntRect(rect.location(), preferredSize); … … 400 386 } 401 387 402 // Forward button. 403 IntSize preferredSize = contentsGadget->child(steppersPosition[3])->preferredSize(); 388 auto* forwardStepper = scrollbarWidget.stepper(RenderThemeScrollbarGadget::Steppers::Forward); 389 ASSERT(forwardStepper); 390 forwardStepper->setState(scrollbarPartStateFlags(scrollbar, ForwardButtonEndPart)); 391 IntSize preferredSize = forwardStepper->preferredSize(); 404 392 if (scrollbar.orientation() == VerticalScrollbar) 405 393 rect.move(0, rect.height() - preferredSize.height()); … … 478 466 return true; 479 467 480 bool scrollbarOnLeft = scrollbar.scrollableArea().shouldPlaceBlockDirectionScrollbarOnLeft(); 481 482 RenderThemeGadget::Info info = { RenderThemeGadget::Type::Scrollbar, "scrollbar", scrollbarPartStateFlags(scrollbar, AllParts, true), { } }; 483 if (scrollbar.orientation() == VerticalScrollbar) { 484 info.classList.append("vertical"); 485 info.classList.append(scrollbarOnLeft ? "left" : "right"); 486 } else { 487 info.classList.append("horizontal"); 488 info.classList.append("bottom"); 489 } 468 auto scrollbarState = scrollbarPartStateFlags(scrollbar, AllParts, true); 469 auto& scrollbarWidget = static_cast<RenderThemeScrollbar&>(RenderThemeWidget::getOrCreate(widgetTypeForScrollbar(scrollbar, scrollbarState))); 470 auto& scrollbarGadget = scrollbarWidget.scrollbar(); 471 scrollbarGadget.setState(scrollbarState); 490 472 if (m_usesOverlayScrollbars) 491 info.classList.append("overlay-indicator"); 492 if (info.state & GTK_STATE_FLAG_PRELIGHT) 493 info.classList.append("hovering"); 494 if (scrollbar.pressedPart() != NoPart) 495 info.classList.append("dragging"); 496 auto scrollbarGadget = RenderThemeGadget::create(info); 497 if (m_usesOverlayScrollbars) 498 opacity *= scrollbarGadget->opacity(); 473 opacity *= scrollbarGadget.opacity(); 499 474 if (!opacity) 500 475 return true; 501 476 502 info.type = RenderThemeGadget::Type::Generic; 503 info.name = "contents"; 504 info.state = GTK_STATE_FLAG_NORMAL; 505 info.classList.clear(); 506 Vector<RenderThemeGadget::Info> children; 507 auto steppers = static_cast<RenderThemeScrollbarGadget*>(scrollbarGadget.get())->steppers(); 508 unsigned steppersPosition[4] = { 0, 0, 0, 0 }; 509 if (steppers.contains(RenderThemeScrollbarGadget::Steppers::Backward)) { 510 steppersPosition[0] = children.size(); 511 children.append({ RenderThemeGadget::Type::Generic, "button", scrollbarPartStateFlags(scrollbar, BackButtonStartPart), { "up" } }); 512 } 513 if (steppers.contains(RenderThemeScrollbarGadget::Steppers::SecondaryForward)) { 514 steppersPosition[1] = children.size(); 515 children.append({ RenderThemeGadget::Type::Generic, "button", scrollbarPartStateFlags(scrollbar, ForwardButtonStartPart), { "down" } }); 516 } 517 unsigned troughPosition = children.size(); 518 children.append({ RenderThemeGadget::Type::Generic, "trough", scrollbarPartStateFlags(scrollbar, BackTrackPart), { } }); 519 if (steppers.contains(RenderThemeScrollbarGadget::Steppers::SecondaryBackward)) { 520 steppersPosition[2] = children.size(); 521 children.append({ RenderThemeGadget::Type::Generic, "button", scrollbarPartStateFlags(scrollbar, BackButtonEndPart), { "up" } }); 522 } 523 if (steppers.contains(RenderThemeScrollbarGadget::Steppers::Forward)) { 524 steppersPosition[3] = children.size(); 525 children.append({ RenderThemeGadget::Type::Generic, "button", scrollbarPartStateFlags(scrollbar, ForwardButtonEndPart), { "down" } }); 526 } 527 auto contentsGadget = std::make_unique<RenderThemeBoxGadget>(info, scrollbar.orientation() == VerticalScrollbar ? GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL, 528 children, scrollbarGadget.get()); 529 RenderThemeGadget* troughGadget = contentsGadget->child(troughPosition); 530 531 IntSize preferredSize = contentsGadget->preferredSize(); 532 std::unique_ptr<RenderThemeGadget> sliderGadget; 477 auto& trough = scrollbarWidget.trough(); 478 trough.setState(scrollbarPartStateFlags(scrollbar, BackTrackPart)); 479 480 auto* backwardStepper = scrollbarWidget.stepper(RenderThemeScrollbarGadget::Steppers::Backward); 481 if (backwardStepper) 482 backwardStepper->setState(scrollbarPartStateFlags(scrollbar, BackButtonStartPart)); 483 auto* secondaryForwardStepper = scrollbarWidget.stepper(RenderThemeScrollbarGadget::Steppers::SecondaryForward); 484 if (secondaryForwardStepper) 485 secondaryForwardStepper->setState(scrollbarPartStateFlags(scrollbar, ForwardButtonStartPart)); 486 auto* secondaryBackwardStepper = scrollbarWidget.stepper(RenderThemeScrollbarGadget::Steppers::SecondaryBackward); 487 if (secondaryBackwardStepper) 488 secondaryBackwardStepper->setState(scrollbarPartStateFlags(scrollbar, BackButtonEndPart)); 489 auto* forwardStepper = scrollbarWidget.stepper(RenderThemeScrollbarGadget::Steppers::Forward); 490 if (forwardStepper) 491 forwardStepper->setState(scrollbarPartStateFlags(scrollbar, ForwardButtonEndPart)); 492 493 IntSize preferredSize = scrollbarWidget.contents().preferredSize(); 533 494 int thumbSize = thumbLength(scrollbar); 534 495 if (thumbSize) { 535 info.name = "slider"; 536 info.state = scrollbarPartStateFlags(scrollbar, ThumbPart); 537 sliderGadget = RenderThemeGadget::create(info, troughGadget); 538 preferredSize = preferredSize.expandedTo(sliderGadget->preferredSize()); 539 } 540 preferredSize += scrollbarGadget->preferredSize() - scrollbarGadget->minimumSize(); 496 scrollbarWidget.slider().setState(scrollbarPartStateFlags(scrollbar, ThumbPart)); 497 preferredSize = preferredSize.expandedTo(scrollbarWidget.slider().preferredSize()); 498 } 499 preferredSize += scrollbarGadget.preferredSize() - scrollbarGadget.minimumSize(); 541 500 542 501 FloatRect contentsRect(rect); … … 545 504 if (scrollbar.orientation() == VerticalScrollbar) { 546 505 if (rect.width() != preferredSize.width()) { 547 if (!scrollbar OnLeft)506 if (!scrollbar.scrollableArea().shouldPlaceBlockDirectionScrollbarOnLeft()) 548 507 contentsRect.move(std::abs(rect.width() - preferredSize.width()), 0); 549 508 contentsRect.setWidth(preferredSize.width()); … … 562 521 } 563 522 564 scrollbarGadget->render(graphicsContext.platformContext()->cr(), contentsRect, &contentsRect); 565 contentsGadget->render(graphicsContext.platformContext()->cr(), contentsRect, &contentsRect); 566 567 if (steppers.contains(RenderThemeScrollbarGadget::Steppers::Backward)) { 568 RenderThemeGadget* buttonGadget = contentsGadget->child(steppersPosition[0]); 523 scrollbarGadget.render(graphicsContext.platformContext()->cr(), contentsRect, &contentsRect); 524 scrollbarWidget.contents().render(graphicsContext.platformContext()->cr(), contentsRect, &contentsRect); 525 526 if (backwardStepper) { 569 527 FloatRect buttonRect = contentsRect; 570 528 if (scrollbar.orientation() == VerticalScrollbar) 571 buttonRect.setHeight(b uttonGadget->preferredSize().height());529 buttonRect.setHeight(backwardStepper->preferredSize().height()); 572 530 else 573 buttonRect.setWidth(b uttonGadget->preferredSize().width());574 static_cast<RenderThemeScrollbarGadget *>(scrollbarGadget.get())->renderStepper(graphicsContext.platformContext()->cr(), buttonRect, buttonGadget,531 buttonRect.setWidth(backwardStepper->preferredSize().width()); 532 static_cast<RenderThemeScrollbarGadget&>(scrollbarGadget).renderStepper(graphicsContext.platformContext()->cr(), buttonRect, backwardStepper, 575 533 scrollbar.orientation() == VerticalScrollbar ? GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL, RenderThemeScrollbarGadget::Steppers::Backward); 576 534 if (scrollbar.orientation() == VerticalScrollbar) { … … 582 540 } 583 541 } 584 if (steppers.contains(RenderThemeScrollbarGadget::Steppers::SecondaryForward)) { 585 RenderThemeGadget* buttonGadget = contentsGadget->child(steppersPosition[1]); 542 if (secondaryForwardStepper) { 586 543 FloatRect buttonRect = contentsRect; 587 544 if (scrollbar.orientation() == VerticalScrollbar) 588 buttonRect.setHeight( buttonGadget->preferredSize().height());545 buttonRect.setHeight(secondaryForwardStepper->preferredSize().height()); 589 546 else 590 buttonRect.setWidth( buttonGadget->preferredSize().width());591 static_cast<RenderThemeScrollbarGadget *>(scrollbarGadget.get())->renderStepper(graphicsContext.platformContext()->cr(), buttonRect, buttonGadget,547 buttonRect.setWidth(secondaryForwardStepper->preferredSize().width()); 548 static_cast<RenderThemeScrollbarGadget&>(scrollbarGadget).renderStepper(graphicsContext.platformContext()->cr(), buttonRect, secondaryForwardStepper, 592 549 scrollbar.orientation() == VerticalScrollbar ? GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL, RenderThemeScrollbarGadget::Steppers::SecondaryForward); 593 550 if (scrollbar.orientation() == VerticalScrollbar) { … … 599 556 } 600 557 } 601 602 if (steppers.contains(RenderThemeScrollbarGadget::Steppers::Forward)) { 603 RenderThemeGadget* buttonGadget = contentsGadget->child(steppersPosition[3]); 558 if (secondaryBackwardStepper) { 604 559 FloatRect buttonRect = contentsRect; 605 560 if (scrollbar.orientation() == VerticalScrollbar) { 606 buttonRect.setHeight( buttonGadget->preferredSize().height());561 buttonRect.setHeight(secondaryBackwardStepper->preferredSize().height()); 607 562 buttonRect.move(0, contentsRect.height() - buttonRect.height()); 608 563 } else { 609 buttonRect.setWidth( buttonGadget->preferredSize().width());564 buttonRect.setWidth(secondaryBackwardStepper->preferredSize().width()); 610 565 buttonRect.move(contentsRect.width() - buttonRect.width(), 0); 611 566 } 612 static_cast<RenderThemeScrollbarGadget*>(scrollbarGadget.get())->renderStepper(graphicsContext.platformContext()->cr(), buttonRect, buttonGadget, 567 static_cast<RenderThemeScrollbarGadget&>(scrollbarGadget).renderStepper(graphicsContext.platformContext()->cr(), buttonRect, secondaryBackwardStepper, 568 scrollbar.orientation() == VerticalScrollbar ? GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL, RenderThemeScrollbarGadget::Steppers::SecondaryBackward); 569 if (scrollbar.orientation() == VerticalScrollbar) 570 contentsRect.contract(0, buttonRect.height()); 571 else 572 contentsRect.contract(buttonRect.width(), 0); 573 } 574 if (forwardStepper) { 575 FloatRect buttonRect = contentsRect; 576 if (scrollbar.orientation() == VerticalScrollbar) { 577 buttonRect.setHeight(forwardStepper->preferredSize().height()); 578 buttonRect.move(0, contentsRect.height() - buttonRect.height()); 579 } else { 580 buttonRect.setWidth(forwardStepper->preferredSize().width()); 581 buttonRect.move(contentsRect.width() - buttonRect.width(), 0); 582 } 583 static_cast<RenderThemeScrollbarGadget&>(scrollbarGadget).renderStepper(graphicsContext.platformContext()->cr(), buttonRect, forwardStepper, 613 584 scrollbar.orientation() == VerticalScrollbar ? GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL, RenderThemeScrollbarGadget::Steppers::Forward); 614 585 if (scrollbar.orientation() == VerticalScrollbar) … … 617 588 contentsRect.contract(buttonRect.width(), 0); 618 589 } 619 if (steppers.contains(RenderThemeScrollbarGadget::Steppers::SecondaryBackward)) { 620 RenderThemeGadget* buttonGadget = contentsGadget->child(steppersPosition[2]); 621 FloatRect buttonRect = contentsRect; 622 if (scrollbar.orientation() == VerticalScrollbar) { 623 buttonRect.setHeight(buttonGadget->preferredSize().height()); 624 buttonRect.move(0, contentsRect.height() - buttonRect.height()); 625 } else { 626 buttonRect.setWidth(buttonGadget->preferredSize().width()); 627 buttonRect.move(contentsRect.width() - buttonRect.width(), 0); 628 } 629 static_cast<RenderThemeScrollbarGadget*>(scrollbarGadget.get())->renderStepper(graphicsContext.platformContext()->cr(), buttonRect, buttonGadget, 630 scrollbar.orientation() == VerticalScrollbar ? GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL, RenderThemeScrollbarGadget::Steppers::SecondaryBackward); 631 if (scrollbar.orientation() == VerticalScrollbar) 632 contentsRect.contract(0, buttonRect.height()); 633 else 634 contentsRect.contract(buttonRect.width(), 0); 635 } 636 637 troughGadget->render(graphicsContext.platformContext()->cr(), contentsRect, &contentsRect); 638 if (sliderGadget) { 590 591 trough.render(graphicsContext.platformContext()->cr(), contentsRect, &contentsRect); 592 593 if (thumbSize) { 639 594 if (scrollbar.orientation() == VerticalScrollbar) { 640 595 contentsRect.move(0, thumbPosition(scrollbar)); 641 contentsRect.setWidth(s liderGadget->preferredSize().width());596 contentsRect.setWidth(scrollbarWidget.slider().preferredSize().width()); 642 597 contentsRect.setHeight(thumbSize); 643 598 } else { 644 599 contentsRect.move(thumbPosition(scrollbar), 0); 645 600 contentsRect.setWidth(thumbSize); 646 contentsRect.setHeight(s liderGadget->preferredSize().height());601 contentsRect.setHeight(scrollbarWidget.slider().preferredSize().height()); 647 602 } 648 603 if (contentsRect.intersects(damageRect)) 649 s liderGadget->render(graphicsContext.platformContext()->cr(), contentsRect);604 scrollbarWidget.slider().render(graphicsContext.platformContext()->cr(), contentsRect); 650 605 } 651 606 … … 847 802 int ScrollbarThemeGtk::scrollbarThickness(ScrollbarControlSize) 848 803 { 849 RenderThemeGadget::Info info = { RenderThemeGadget::Type::Scrollbar, "scrollbar", GTK_STATE_FLAG_PRELIGHT, { "vertical", "right", "hovering" } }; 850 if (m_usesOverlayScrollbars) 851 info.classList.append("overlay-indicator"); 852 auto scrollbarGadget = RenderThemeGadget::create(info); 853 info.type = RenderThemeGadget::Type::Generic; 854 info.name = "contents"; 855 info.state = GTK_STATE_FLAG_NORMAL; 856 info.classList.clear(); 857 Vector<RenderThemeGadget::Info> children; 858 auto steppers = static_cast<RenderThemeScrollbarGadget*>(scrollbarGadget.get())->steppers(); 859 if (steppers.contains(RenderThemeScrollbarGadget::Steppers::Backward)) 860 children.append({ RenderThemeGadget::Type::Generic, "button", GTK_STATE_FLAG_NORMAL, { "up" } }); 861 if (steppers.contains(RenderThemeScrollbarGadget::Steppers::SecondaryForward)) 862 children.append({ RenderThemeGadget::Type::Generic, "button", GTK_STATE_FLAG_NORMAL, { "down" } }); 863 unsigned troughPositon = children.size(); 864 children.append({ RenderThemeGadget::Type::Generic, "trough", GTK_STATE_FLAG_PRELIGHT, { } }); 865 if (steppers.contains(RenderThemeScrollbarGadget::Steppers::SecondaryBackward)) 866 children.append({ RenderThemeGadget::Type::Generic, "button", GTK_STATE_FLAG_NORMAL, { "up" } }); 867 if (steppers.contains(RenderThemeScrollbarGadget::Steppers::Forward)) 868 children.append({ RenderThemeGadget::Type::Generic, "button", GTK_STATE_FLAG_NORMAL, { "down" } }); 869 auto contentsGadget = std::make_unique<RenderThemeBoxGadget>(info, GTK_ORIENTATION_VERTICAL, children, scrollbarGadget.get()); 870 info.name = "slider"; 871 auto sliderGadget = RenderThemeGadget::create(info, contentsGadget->child(troughPositon)); 872 IntSize contentsPreferredSize = contentsGadget->preferredSize(); 873 contentsPreferredSize = contentsPreferredSize.expandedTo(sliderGadget->preferredSize()); 874 IntSize preferredSize = contentsPreferredSize + scrollbarGadget->preferredSize() - scrollbarGadget->minimumSize(); 875 804 auto& scrollbarWidget = static_cast<RenderThemeScrollbar&>(RenderThemeWidget::getOrCreate(RenderThemeWidget::Type::VerticalScrollbarRight)); 805 scrollbarWidget.scrollbar().setState(GTK_STATE_FLAG_PRELIGHT); 806 IntSize contentsPreferredSize = scrollbarWidget.contents().preferredSize(); 807 contentsPreferredSize = contentsPreferredSize.expandedTo(scrollbarWidget.slider().preferredSize()); 808 IntSize preferredSize = contentsPreferredSize + scrollbarWidget.scrollbar().preferredSize() - scrollbarWidget.scrollbar().minimumSize(); 876 809 return preferredSize.width(); 877 810 } … … 888 821 int ScrollbarThemeGtk::minimumThumbLength(Scrollbar& scrollbar) 889 822 { 890 RenderThemeGadget::Info info = { RenderThemeGadget::Type::Scrollbar, "scrollbar", GTK_STATE_FLAG_PRELIGHT, { "vertical", "right", "hovering" } }; 891 if (m_usesOverlayScrollbars) 892 info.classList.append("overlay-indicator"); 893 auto scrollbarGadget = RenderThemeGadget::create(info); 894 info.type = RenderThemeGadget::Type::Generic; 895 info.name = "contents"; 896 info.state = GTK_STATE_FLAG_NORMAL; 897 info.classList.clear(); 898 Vector<RenderThemeGadget::Info> children = {{ RenderThemeGadget::Type::Generic, "trough", GTK_STATE_FLAG_PRELIGHT, { } } }; 899 auto contentsGadget = std::make_unique<RenderThemeBoxGadget>(info, GTK_ORIENTATION_VERTICAL, children, scrollbarGadget.get()); 900 info.name = "slider"; 901 IntSize minSize = RenderThemeGadget::create(info, contentsGadget->child(0))->minimumSize(); 823 auto& scrollbarWidget = static_cast<RenderThemeScrollbar&>(RenderThemeWidget::getOrCreate(RenderThemeWidget::Type::VerticalScrollbarRight)); 824 scrollbarWidget.scrollbar().setState(GTK_STATE_FLAG_PRELIGHT); 825 IntSize minSize = scrollbarWidget.slider().minimumSize(); 902 826 return scrollbar.orientation() == VerticalScrollbar ? minSize.height() : minSize.width(); 903 827 } -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/platform/image-decoders/cairo/ImageBackingStoreCairo.cpp ¶
r217367 r219817 33 33 NativeImagePtr ImageBackingStore::image() const 34 34 { 35 return adoptRef(cairo_image_surface_create_for_data( 35 m_pixels->ref(); 36 RefPtr<cairo_surface_t> surface = adoptRef(cairo_image_surface_create_for_data( 36 37 reinterpret_cast<unsigned char*>(const_cast<RGBA32*>(m_pixelsPtr)), 37 38 CAIRO_FORMAT_ARGB32, size().width(), size().height(), size().width() * sizeof(RGBA32))); 39 static cairo_user_data_key_t s_surfaceDataKey; 40 cairo_surface_set_user_data(surface.get(), &s_surfaceDataKey, m_pixels.get(), [](void* data) { static_cast<SharedBuffer*>(data)->deref(); }); 41 42 return surface; 38 43 } 39 44 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/RenderBlock.cpp ¶
r217367 r219817 682 682 { 683 683 if (AXObjectCache* cache = document().existingAXObjectCache()) 684 cache-> recomputeDeferredIsIgnored(*this);684 cache->deferRecomputeIsIgnored(element()); 685 685 } 686 686 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/RenderBlockFlow.cpp ¶
r217367 r219817 3667 3667 // The simple line layout may have become invalid. 3668 3668 m_simpleLineLayout = nullptr; 3669 setLineLayoutPath(UndeterminedPath); 3670 if (needsLayout()) 3671 return; 3672 // FIXME: We should just kick off a subtree layout here (if needed at all) see webkit.org/b/172947. 3669 3673 setNeedsLayout(); 3670 setLineLayoutPath(UndeterminedPath);3671 3674 return; 3672 3675 } -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/RenderBlockLineLayout.cpp ¶
r217367 r219817 131 131 if (UNLIKELY(AXObjectCache::accessibilityEnabled()) && firstRootBox() == rootBox) { 132 132 if (AXObjectCache* cache = document().existingAXObjectCache()) 133 cache-> recomputeDeferredIsIgnored(*this);133 cache->deferRecomputeIsIgnored(element()); 134 134 } 135 135 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/RenderLayerCompositor.cpp ¶
r217367 r219817 2537 2537 2538 2538 RenderWidget& pluginRenderer = downcast<RenderWidget>(renderer); 2539 if (pluginRenderer.style().visibility() != VISIBLE) 2540 return false; 2541 2539 2542 // If we can't reliably know the size of the plugin yet, don't change compositing state. 2540 2543 if (pluginRenderer.needsLayout()) … … 2552 2555 2553 2556 auto& frameRenderer = downcast<RenderWidget>(renderer); 2557 if (frameRenderer.style().visibility() != VISIBLE) 2558 return false; 2559 2554 2560 if (!frameRenderer.requiresAcceleratedCompositing()) 2555 2561 return false; -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/RenderText.cpp ¶
r217367 r219817 1284 1284 1285 1285 if (AXObjectCache* cache = document().existingAXObjectCache()) 1286 cache-> textChanged(this);1286 cache->deferTextChangedIfNeeded(textNode()); 1287 1287 } 1288 1288 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/RenderTheme.cpp ¶
r217367 r219817 92 92 93 93 if (UAHasAppearance && isControlStyled(style, border, background, backgroundColor)) { 94 if (part == MenulistPart) { 94 switch (part) { 95 case MenulistPart: 95 96 style.setAppearance(MenulistButtonPart); 96 97 part = MenulistButtonPart; 97 } else 98 break; 99 case TextFieldPart: 100 adjustTextFieldStyle(styleResolver, style, element); 101 FALLTHROUGH; 102 default: 98 103 style.setAppearance(NoControlPart); 104 break; 105 } 99 106 } 100 107 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/RenderThemeGtk.cpp ¶
r217367 r219817 45 45 #include "RenderObject.h" 46 46 #include "RenderProgress.h" 47 #include "RenderTheme Gadget.h"47 #include "RenderThemeWidget.h" 48 48 #include "ScrollbarThemeGtk.h" 49 49 #include "StringTruncator.h" … … 186 186 switch (themePart) { 187 187 case Entry: 188 case EntrySelection: 188 189 gtk_widget_path_append_type(path.get(), GTK_TYPE_ENTRY); 189 190 gtk_widget_path_iter_add_class(path.get(), -1, GTK_STYLE_CLASS_ENTRY); … … 528 529 return; 529 530 530 RenderThemeGadget::Info info = { 531 .type = RenderThemeGadget::Type::Generic, 532 .name = themePart == CheckButton ? "checkbutton" : "radiobutton", 533 .state = GTK_STATE_FLAG_NORMAL, 534 .classList = { } 535 }; 536 auto parentGadget = RenderThemeGadget::create(info); 537 if (themePart == CheckButton) { 538 info.type = RenderThemeGadget::Type::Check; 539 info.name = "check"; 540 } else { 541 info.type = RenderThemeGadget::Type::Radio; 542 info.name = "radio"; 543 } 544 auto gadget = RenderThemeToggleGadget::create(info); 545 IntSize preferredSize = parentGadget->preferredSize(); 546 preferredSize = preferredSize.expandedTo(gadget->preferredSize()); 531 auto& toggleWidget = static_cast<RenderThemeToggleButton&>(RenderThemeWidget::getOrCreate(themePart == CheckButton ? RenderThemeWidget::Type::CheckButton : RenderThemeWidget::Type::RadioButton)); 532 toggleWidget.button().setState(GTK_STATE_FLAG_NORMAL); 533 toggleWidget.toggle().setState(GTK_STATE_FLAG_NORMAL); 534 IntSize preferredSize = toggleWidget.button().preferredSize(); 535 preferredSize = preferredSize.expandedTo(toggleWidget.toggle().preferredSize()); 547 536 548 537 if (style.width().isIntrinsicOrAuto()) … … 557 546 ASSERT(themePart == CheckButton || themePart == RadioButton); 558 547 559 RenderThemeGadget::Info parentInfo = { 560 .type = RenderThemeGadget::Type::Generic, 561 .name = themePart == CheckButton ? "checkbutton" : "radiobutton", 562 .state = themePartStateFlags(*theme, themePart, renderObject), 563 .classList = { "text-button" } 564 }; 565 auto parentGadget = RenderThemeGadget::create(parentInfo); 566 RenderThemeGadget::Info info; 567 info.state = parentInfo.state; 568 if (themePart == CheckButton) { 569 info.type = RenderThemeGadget::Type::Check; 570 info.name = "check"; 571 } else { 572 info.type = RenderThemeGadget::Type::Radio; 573 info.name = "radio"; 574 } 575 auto gadget = RenderThemeGadget::create(info, parentGadget.get()); 548 auto& toggleWidget = static_cast<RenderThemeToggleButton&>(RenderThemeWidget::getOrCreate(themePart == CheckButton ? RenderThemeWidget::Type::CheckButton : RenderThemeWidget::Type::RadioButton)); 549 auto toggleState = themePartStateFlags(*theme, themePart, renderObject); 550 toggleWidget.button().setState(toggleState); 551 toggleWidget.toggle().setState(toggleState); 576 552 577 553 FloatRect rect = fullRect; … … 580 556 // in the full toggle button region. The reason for not simply forcing toggle 581 557 // buttons to be a smaller size is that we don't want to break site layouts. 582 IntSize preferredSize = parentGadget->preferredSize();583 preferredSize = preferredSize.expandedTo( gadget->preferredSize());558 IntSize preferredSize = toggleWidget.button().preferredSize(); 559 preferredSize = preferredSize.expandedTo(toggleWidget.toggle().preferredSize()); 584 560 shrinkToMinimumSizeAndCenterRectangle(rect, preferredSize); 585 parentGadget->render(paintInfo.context().platformContext()->cr(), rect);586 gadget->render(paintInfo.context().platformContext()->cr(), rect);561 toggleWidget.button().render(paintInfo.context().platformContext()->cr(), rect); 562 toggleWidget.toggle().render(paintInfo.context().platformContext()->cr(), rect); 587 563 588 564 if (theme->isFocused(renderObject)) 589 parentGadget->renderFocus(paintInfo.context().platformContext()->cr(), rect);565 toggleWidget.button().renderFocus(paintInfo.context().platformContext()->cr(), rect); 590 566 } 591 567 #else … … 684 660 bool RenderThemeGtk::paintButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 685 661 { 686 RenderThemeGadget::Info info = { RenderThemeGadget::Type::Generic, "button", themePartStateFlags(*this, Button, renderObject), { "text-button" } }; 687 if (isDefault(renderObject)) 688 info.classList.append("default"); 689 auto gadget = RenderThemeGadget::create(info); 690 gadget->render(paintInfo.context().platformContext()->cr(), rect); 662 auto& buttonWidget = static_cast<RenderThemeButton&>(RenderThemeWidget::getOrCreate(isDefault(renderObject) ? RenderThemeWidget::Type::ButtonDefault : RenderThemeWidget::Type::Button)); 663 buttonWidget.button().setState(themePartStateFlags(*this, Button, renderObject)); 664 buttonWidget.button().render(paintInfo.context().platformContext()->cr(), rect); 691 665 if (isFocused(renderObject)) 692 gadget->renderFocus(paintInfo.context().platformContext()->cr(), rect);666 buttonWidget.button().renderFocus(paintInfo.context().platformContext()->cr(), rect); 693 667 return false; 694 668 } … … 772 746 { 773 747 #if GTK_CHECK_VERSION(3, 20, 0) 774 RenderThemeGadget::Info info { RenderThemeGadget::Type::Generic, "combobox", element->isDisabledFormControl() ? GTK_STATE_FLAG_INSENSITIVE : GTK_STATE_FLAG_NORMAL, { } }; 775 auto comboGadget = RenderThemeGadget::create(info); 776 Vector<RenderThemeGadget::Info> children { 777 { RenderThemeGadget::Type::Generic, "button", info.state, { "combo" } } 778 }; 779 info.name = "box"; 780 info.classList = { "horizontal", "linked" }; 781 return RenderThemeBoxGadget(info, GTK_ORIENTATION_HORIZONTAL, children, comboGadget.get()).child(0)->color(); 748 auto& comboWidget = static_cast<RenderThemeComboBox&>(RenderThemeWidget::getOrCreate(RenderThemeWidget::Type::ComboBox)); 749 GtkStateFlags state = element->isDisabledFormControl() ? GTK_STATE_FLAG_INSENSITIVE : GTK_STATE_FLAG_NORMAL; 750 comboWidget.comboBox().setState(state); 751 comboWidget.button().setState(state); 752 return comboWidget.button().color(); 782 753 #else 783 754 GRefPtr<GtkStyleContext> parentStyleContext = createStyleContext(ComboBox); … … 825 796 return LengthBox(0); 826 797 827 RenderThemeGadget::Info info = { RenderThemeGadget::Type::Generic, "combobox", GTK_STATE_FLAG_NORMAL, { } }; 828 auto comboGadget = RenderThemeGadget::create(info); 829 Vector<RenderThemeGadget::Info> children = { 830 { RenderThemeGadget::Type::Generic, "button", GTK_STATE_FLAG_NORMAL, { "combo" } } 831 }; 832 info.name = "box"; 833 info.classList = { "horizontal", "linked" }; 834 auto boxGadget = std::make_unique<RenderThemeBoxGadget>(info, GTK_ORIENTATION_HORIZONTAL, children, comboGadget.get()); 835 RenderThemeGadget* buttonGadget = boxGadget->child(0); 836 info.classList.removeLast(); 837 auto buttonBoxGadget = RenderThemeGadget::create(info, buttonGadget); 838 info.name = "arrow"; 839 info.classList = { }; 840 auto arrowGadget = RenderThemeGadget::create(info, buttonBoxGadget.get()); 841 GtkBorder comboContentsBox = comboGadget->contentsBox(); 842 GtkBorder boxContentsBox = boxGadget->contentsBox(); 843 GtkBorder buttonContentsBox = buttonGadget->contentsBox(); 844 GtkBorder buttonBoxContentsBox = buttonBoxGadget->contentsBox(); 798 auto& comboWidget = static_cast<RenderThemeComboBox&>(RenderThemeWidget::getOrCreate(RenderThemeWidget::Type::ComboBox)); 799 comboWidget.comboBox().setState(GTK_STATE_FLAG_NORMAL); 800 comboWidget.button().setState(GTK_STATE_FLAG_NORMAL); 801 comboWidget.arrow().setState(GTK_STATE_FLAG_NORMAL); 802 GtkBorder comboContentsBox = comboWidget.comboBox().contentsBox(); 803 GtkBorder boxContentsBox = comboWidget.box().contentsBox(); 804 GtkBorder buttonContentsBox = comboWidget.button().contentsBox(); 805 GtkBorder buttonBoxContentsBox = comboWidget.buttonBox().contentsBox(); 845 806 GtkBorder padding; 846 807 padding.left = comboContentsBox.left + boxContentsBox.left + buttonContentsBox.left + buttonBoxContentsBox.left; … … 849 810 padding.bottom = comboContentsBox.bottom + boxContentsBox.bottom + buttonContentsBox.bottom + buttonBoxContentsBox.bottom; 850 811 851 auto arrowSize = arrowGadget->preferredSize();812 auto arrowSize = comboWidget.arrow().preferredSize(); 852 813 return LengthBox(padding.top, padding.right + (style.direction() == LTR ? arrowSize.width() : 0), 853 814 padding.bottom, padding.left + (style.direction() == RTL ? arrowSize.width() : 0)); … … 856 817 bool RenderThemeGtk::paintMenuList(const RenderObject& renderObject, const PaintInfo& paintInfo, const FloatRect& rect) 857 818 { 858 RenderThemeGadget::Info info = { RenderThemeGadget::Type::Generic, "combobox", themePartStateFlags(*this, ComboBoxButton, renderObject), { } }; 859 auto comboGadget = RenderThemeGadget::create(info); 860 Vector<RenderThemeGadget::Info> children = { 861 { RenderThemeGadget::Type::Generic, "button", info.state, { "combo" } } 862 }; 863 info.name = "box"; 864 info.classList = { "horizontal", "linked" }; 865 auto boxGadget = std::make_unique<RenderThemeBoxGadget>(info, GTK_ORIENTATION_HORIZONTAL, children, comboGadget.get()); 866 RenderThemeGadget* buttonGadget = boxGadget->child(0); 867 info.classList.removeLast(); 868 auto buttonBoxGadget = RenderThemeGadget::create(info, buttonGadget); 869 info.type = RenderThemeGadget::Type::Arrow; 870 info.name = "arrow"; 871 info.classList = { }; 872 auto arrowGadget = RenderThemeGadget::create(info, buttonBoxGadget.get()); 819 auto& comboWidget = static_cast<RenderThemeComboBox&>(RenderThemeWidget::getOrCreate(RenderThemeWidget::Type::ComboBox)); 820 auto comboState = themePartStateFlags(*this, ComboBoxButton, renderObject); 821 comboWidget.comboBox().setState(comboState); 822 comboWidget.button().setState(comboState); 823 comboWidget.arrow().setState(comboState); 873 824 874 825 cairo_t* cr = paintInfo.context().platformContext()->cr(); 875 combo Gadget->render(cr, rect);876 boxGadget->render(cr, rect);826 comboWidget.comboBox().render(cr, rect); 827 comboWidget.box().render(cr, rect); 877 828 FloatRect contentsRect; 878 buttonGadget->render(cr, rect, &contentsRect);879 buttonBoxGadget->render(cr, contentsRect);880 arrowGadget->render(cr, contentsRect);829 comboWidget.button().render(cr, rect, &contentsRect); 830 comboWidget.buttonBox().render(cr, contentsRect); 831 comboWidget.arrow().render(cr, contentsRect); 881 832 if (isFocused(renderObject)) 882 buttonGadget->renderFocus(cr, rect);833 comboWidget.button().renderFocus(cr, rect); 883 834 884 835 return false; … … 981 932 982 933 #if GTK_CHECK_VERSION(3, 20, 0) 934 935 static IntSize spinButtonSize() 936 { 937 auto& spinButtonWidget = static_cast<RenderThemeSpinButton&>(RenderThemeWidget::getOrCreate(RenderThemeWidget::Type::SpinButton)); 938 spinButtonWidget.spinButton().setState(GTK_STATE_FLAG_NORMAL); 939 spinButtonWidget.entry().setState(GTK_STATE_FLAG_NORMAL); 940 spinButtonWidget.up().setState(GTK_STATE_FLAG_NORMAL); 941 spinButtonWidget.down().setState(GTK_STATE_FLAG_NORMAL); 942 943 IntSize preferredSize = spinButtonWidget.spinButton().preferredSize(); 944 preferredSize = preferredSize.expandedTo(spinButtonWidget.entry().preferredSize()); 945 IntSize upPreferredSize = preferredSize.expandedTo(spinButtonWidget.up().preferredSize()); 946 IntSize downPreferredSize = preferredSize.expandedTo(spinButtonWidget.down().preferredSize()); 947 948 return IntSize(upPreferredSize.width() + downPreferredSize.width(), std::max(upPreferredSize.height(), downPreferredSize.height())); 949 } 950 951 983 952 void RenderThemeGtk::adjustTextFieldStyle(StyleResolver&, RenderStyle& style, const Element* element) const 984 953 { … … 986 955 return; 987 956 988 // Spinbuttons need a minimum height to be rendered correctly. 989 RenderThemeGadget::Info info = { RenderThemeGadget::Type::Generic, "spinbutton", GTK_STATE_FLAG_NORMAL, { "horizontal" } }; 990 auto spinbuttonGadget = RenderThemeGadget::create(info); 991 info.type = RenderThemeGadget::Type::TextField; 992 info.name = "entry"; 993 info.classList.clear(); 994 auto entryGadget = RenderThemeGadget::create(info, spinbuttonGadget.get()); 995 info.type = RenderThemeGadget::Type::Icon; 996 info.name = "button"; 997 info.classList.append("up"); 998 auto buttonUpGadget = RenderThemeGadget::create(info, spinbuttonGadget.get()); 999 static_cast<RenderThemeIconGadget*>(buttonUpGadget.get())->setIconSize(RenderThemeIconGadget::IconSizeGtk::Menu); 1000 info.classList[0] = "down"; 1001 auto buttonDownGadget = RenderThemeGadget::create(info, spinbuttonGadget.get()); 1002 static_cast<RenderThemeIconGadget*>(buttonDownGadget.get())->setIconSize(RenderThemeIconGadget::IconSizeGtk::Menu); 1003 IntSize preferredSize = spinbuttonGadget->preferredSize(); 1004 preferredSize = preferredSize.expandedTo(entryGadget->preferredSize()); 1005 IntSize upPreferredSize = preferredSize.expandedTo(buttonUpGadget->preferredSize()); 1006 IntSize downPreferredSize = preferredSize.expandedTo(buttonDownGadget->preferredSize()); 1007 int height = std::max(upPreferredSize.height(), downPreferredSize.height()); 1008 style.setMinHeight(Length(height, Fixed)); 957 style.setMinHeight(Length(spinButtonSize().height(), Fixed)); 958 959 // The default theme for the GTK+ port uses very wide spin buttons (66px) compared to what other 960 // browsers use (~13 px). And unfortunately, most of the web developers won't test how their site 961 // renders on WebKitGTK+. To ensure that spin buttons don't end up covering the values of the input 962 // field, we override the width of the input element and always increment it with the width needed 963 // for the spinbutton (when drawing the spinbutton). 964 int minimumWidth = style.width().intValue() + spinButtonSize().width(); 965 style.setMinWidth(Length(minimumWidth, Fixed)); 1009 966 } 1010 967 1011 968 bool RenderThemeGtk::paintTextField(const RenderObject& renderObject, const PaintInfo& paintInfo, const FloatRect& rect) 1012 969 { 1013 RenderThemeGadget::Info info = { RenderThemeGadget::Type::TextField, "entry", themePartStateFlags(*this, Entry, renderObject), { } };1014 std::unique_ptr<RenderThemeGadget> parentGadget;1015 970 if (is<HTMLInputElement>(renderObject.node()) && shouldHaveSpinButton(downcast<HTMLInputElement>(*renderObject.node()))) { 1016 info.name = "spinbutton";1017 info.classList.append("horizontal");1018 parentGadget = RenderThemeTextFieldGadget::create(info);1019 info.name = "entry";1020 info.classList.clear();1021 }1022 1023 auto entryGadget = RenderThemeTextFieldGadget::create(info, parentGadget.get());1024 if (parentGadget)1025 parentGadget->render(paintInfo.context().platformContext()->cr(), rect);1026 entryGadget->render(paintInfo.context().platformContext()->cr(), rect);971 auto& spinButtonWidget = static_cast<RenderThemeSpinButton&>(RenderThemeWidget::getOrCreate(RenderThemeWidget::Type::SpinButton)); 972 auto spinButtonState = themePartStateFlags(*this, Entry, renderObject); 973 spinButtonWidget.spinButton().setState(spinButtonState); 974 spinButtonWidget.entry().setState(spinButtonState); 975 spinButtonWidget.spinButton().render(paintInfo.context().platformContext()->cr(), rect); 976 spinButtonWidget.entry().render(paintInfo.context().platformContext()->cr(), rect); 977 } else { 978 auto& entryWidget = static_cast<RenderThemeEntry&>(RenderThemeWidget::getOrCreate(RenderThemeWidget::Type::Entry)); 979 entryWidget.entry().setState(themePartStateFlags(*this, Entry, renderObject)); 980 entryWidget.entry().render(paintInfo.context().platformContext()->cr(), rect); 981 } 1027 982 return false; 1028 983 } … … 1066 1021 { 1067 1022 ASSERT(themePart == EntryIconLeft || themePart == EntryIconRight); 1068 RenderThemeGadget::Info info = { RenderThemeGadget::Type::TextField, "entry", GTK_STATE_FLAG_NORMAL, { } }; 1069 auto parentGadget = RenderThemeGadget::create(info); 1070 info.type = RenderThemeGadget::Type::Icon; 1071 info.name = "image"; 1072 if (themePart == EntryIconLeft) 1073 info.classList.append("left"); 1074 else 1075 info.classList.append("right"); 1076 auto gadget = RenderThemeIconGadget::create(info, parentGadget.get()); 1023 auto& searchEntryWidget = static_cast<RenderThemeSearchEntry&>(RenderThemeWidget::getOrCreate(RenderThemeWidget::Type::SearchEntry)); 1024 searchEntryWidget.entry().setState(GTK_STATE_FLAG_NORMAL); 1025 searchEntryWidget.leftIcon().setState(GTK_STATE_FLAG_NORMAL); 1026 searchEntryWidget.rightIcon().setState(GTK_STATE_FLAG_NORMAL); 1077 1027 1078 1028 // Get the icon size based on the font size. 1079 static_cast<RenderThemeIconGadget*>(gadget.get())->setIconSize(style.fontSize()); 1080 IntSize preferredSize = gadget->preferredSize(); 1081 GtkBorder contentsBox = parentGadget->contentsBox(); 1029 auto& icon = static_cast<RenderThemeIconGadget&>(themePart == EntryIconLeft ? searchEntryWidget.leftIcon() : searchEntryWidget.rightIcon()); 1030 icon.setIconSize(style.fontSize()); 1031 IntSize preferredSize = icon.preferredSize(); 1032 GtkBorder contentsBox = searchEntryWidget.entry().contentsBox(); 1082 1033 if (themePart == EntryIconLeft) 1083 1034 preferredSize.expand(contentsBox.left, contentsBox.top + contentsBox.bottom); … … 1166 1117 { 1167 1118 ASSERT(themePart == EntryIconLeft || themePart == EntryIconRight); 1168 RenderThemeGadget::Info info = { RenderThemeGadget::Type::TextField, "entry", themePartStateFlags(*theme, Entry, renderObject), { } }; 1169 auto parentGadget = RenderThemeGadget::create(info); 1170 info.type = RenderThemeGadget::Type::Icon; 1171 info.state = themePartStateFlags(*theme, themePart, renderObject); 1172 info.name = "image"; 1173 if (themePart == EntryIconLeft) 1174 info.classList.append("left"); 1175 else 1176 info.classList.append("right"); 1177 auto gadget = RenderThemeGadget::create(info, parentGadget.get()); 1178 auto* gadgetIcon = static_cast<RenderThemeIconGadget*>(gadget.get()); 1179 gadgetIcon->setIconSize(renderObject.style().fontSize()); 1180 if (themePart == EntryIconLeft) 1181 gadgetIcon->setIconName("edit-find-symbolic"); 1182 else 1183 gadgetIcon->setIconName("edit-clear-symbolic"); 1184 GtkBorder contentsBox = parentGadget->contentsBox(); 1119 auto& searchEntryWidget = static_cast<RenderThemeSearchEntry&>(RenderThemeWidget::getOrCreate(RenderThemeWidget::Type::SearchEntry)); 1120 searchEntryWidget.entry().setState(themePartStateFlags(*theme, Entry, renderObject)); 1121 auto& icon = static_cast<RenderThemeIconGadget&>(themePart == EntryIconLeft ? searchEntryWidget.leftIcon() : searchEntryWidget.rightIcon()); 1122 icon.setState(themePartStateFlags(*theme, themePart, renderObject)); 1123 icon.setIconSize(renderObject.style().fontSize()); 1124 GtkBorder contentsBox = searchEntryWidget.entry().contentsBox(); 1185 1125 IntRect iconRect = rect; 1186 1126 if (themePart == EntryIconLeft) { … … 1189 1129 } else 1190 1130 iconRect.contract(contentsBox.right, contentsBox.top + contentsBox.bottom); 1191 return ! gadget->render(paintInfo.context().platformContext()->cr(), iconRect);1131 return !icon.render(paintInfo.context().platformContext()->cr(), iconRect); 1192 1132 } 1193 1133 bool RenderThemeGtk::paintSearchFieldResultsDecorationPart(const RenderBox& renderObject, const PaintInfo& paintInfo, const IntRect& rect) … … 1310 1250 ASSERT(part == SliderHorizontalPart || part == SliderVerticalPart); 1311 1251 1312 RenderThemeGadget::Info info = { RenderThemeGadget::Type::Generic, "scale", themePartStateFlags(*this, Scale, renderObject), { } }; 1313 if (part == SliderHorizontalPart) 1314 info.classList.append("horizontal"); 1315 else 1316 info.classList.append("vertical"); 1317 auto scaleGadget = RenderThemeGadget::create(info); 1318 info.name = "contents"; 1319 info.classList.clear(); 1320 auto contentsGadget = RenderThemeGadget::create(info, scaleGadget.get()); 1321 info.name = "trough"; 1322 auto troughGadget = RenderThemeGadget::create(info, contentsGadget.get()); 1323 info.name = "slider"; 1324 auto sliderGadget = RenderThemeGadget::create(info, troughGadget.get()); 1325 info.name = "highlight"; 1326 auto highlightGadget = RenderThemeGadget::create(info, troughGadget.get()); 1252 auto& sliderWidget = static_cast<RenderThemeSlider&>(RenderThemeWidget::getOrCreate(part == SliderHorizontalPart ? RenderThemeWidget::Type::HorizontalSlider : RenderThemeWidget::Type::VerticalSlider)); 1253 auto scaleState = themePartStateFlags(*this, Scale, renderObject); 1254 auto& scale = sliderWidget.scale(); 1255 scale.setState(scaleState); 1256 auto& contents = sliderWidget.contents(); 1257 auto& trough = sliderWidget.trough(); 1258 trough.setState(scaleState); 1259 auto& slider = sliderWidget.slider(); 1260 auto& highlight = sliderWidget.highlight(); 1327 1261 1328 1262 // The given rectangle is not calculated based on the scale size, but all the margins and paddings are based on it. 1329 IntSize preferredSize = scale Gadget->preferredSize();1330 preferredSize = preferredSize.expandedTo(contents Gadget->preferredSize());1331 preferredSize = preferredSize.expandedTo(trough Gadget->preferredSize());1263 IntSize preferredSize = scale.preferredSize(); 1264 preferredSize = preferredSize.expandedTo(contents.preferredSize()); 1265 preferredSize = preferredSize.expandedTo(trough.preferredSize()); 1332 1266 FloatRect trackRect = rect; 1333 1267 if (part == SliderHorizontalPart) { … … 1340 1274 1341 1275 FloatRect contentsRect; 1342 scale Gadget->render(paintInfo.context().platformContext()->cr(), trackRect, &contentsRect);1343 contents Gadget->render(paintInfo.context().platformContext()->cr(), contentsRect, &contentsRect);1276 scale.render(paintInfo.context().platformContext()->cr(), trackRect, &contentsRect); 1277 contents.render(paintInfo.context().platformContext()->cr(), contentsRect, &contentsRect); 1344 1278 // Scale trough defines its size querying slider and highlight. 1345 1279 if (part == SliderHorizontalPart) 1346 contentsRect.setHeight(trough Gadget->preferredSize().height() + std::max(sliderGadget->preferredSize().height(), highlightGadget->preferredSize().height()));1280 contentsRect.setHeight(trough.preferredSize().height() + std::max(slider.preferredSize().height(), highlight.preferredSize().height())); 1347 1281 else 1348 contentsRect.setWidth(trough Gadget->preferredSize().width() + std::max(sliderGadget->preferredSize().width(), highlightGadget->preferredSize().width()));1282 contentsRect.setWidth(trough.preferredSize().width() + std::max(slider.preferredSize().width(), highlight.preferredSize().width())); 1349 1283 FloatRect troughRect = contentsRect; 1350 trough Gadget->render(paintInfo.context().platformContext()->cr(), troughRect, &contentsRect);1284 trough.render(paintInfo.context().platformContext()->cr(), troughRect, &contentsRect); 1351 1285 if (isFocused(renderObject)) 1352 trough Gadget->renderFocus(paintInfo.context().platformContext()->cr(), troughRect);1286 trough.renderFocus(paintInfo.context().platformContext()->cr(), troughRect); 1353 1287 1354 1288 LayoutPoint thumbLocation; … … 1367 1301 } else 1368 1302 contentsRect.setHeight(thumbLocation.y()); 1369 highlight Gadget->render(paintInfo.context().platformContext()->cr(), contentsRect);1303 highlight.render(paintInfo.context().platformContext()->cr(), contentsRect); 1370 1304 1371 1305 return false; … … 1378 1312 return; 1379 1313 1380 RenderThemeGadget::Info info = { RenderThemeGadget::Type::Generic, "scale", GTK_STATE_FLAG_NORMAL, { } }; 1381 if (part == SliderHorizontalPart) 1382 info.classList.append("horizontal"); 1383 else 1384 info.classList.append("vertical"); 1385 auto scaleGadget = RenderThemeGadget::create(info); 1386 info.name = "contents"; 1387 info.classList.clear(); 1388 auto contentsGadget = RenderThemeGadget::create(info, scaleGadget.get()); 1389 info.name = "trough"; 1390 auto troughGadget = RenderThemeGadget::create(info, contentsGadget.get()); 1391 info.name = "slider"; 1392 auto sliderGadget = RenderThemeGadget::create(info, troughGadget.get()); 1393 info.name = "highlight"; 1394 auto highlightGadget = RenderThemeGadget::create(info, troughGadget.get()); 1395 1396 IntSize preferredSize = scaleGadget->preferredSize(); 1397 preferredSize = preferredSize.expandedTo(contentsGadget->preferredSize()); 1398 preferredSize = preferredSize.expandedTo(troughGadget->preferredSize()); 1399 preferredSize = preferredSize.expandedTo(sliderGadget->preferredSize()); 1314 auto& sliderWidget = static_cast<RenderThemeSlider&>(RenderThemeWidget::getOrCreate(part == SliderHorizontalPart ? RenderThemeWidget::Type::HorizontalSlider : RenderThemeWidget::Type::VerticalSlider)); 1315 sliderWidget.scale().setState(GTK_STATE_FLAG_NORMAL); 1316 sliderWidget.trough().setState(GTK_STATE_FLAG_NORMAL); 1317 1318 IntSize preferredSize = sliderWidget.scale().preferredSize(); 1319 preferredSize = preferredSize.expandedTo(sliderWidget.contents().preferredSize()); 1320 preferredSize = preferredSize.expandedTo(sliderWidget.trough().preferredSize()); 1321 preferredSize = preferredSize.expandedTo(sliderWidget.slider().preferredSize()); 1400 1322 if (part == SliderThumbHorizontalPart) { 1401 1323 style.setWidth(Length(preferredSize.width(), Fixed)); … … 1413 1335 ASSERT(part == SliderThumbHorizontalPart || part == SliderThumbVerticalPart); 1414 1336 1415 RenderThemeGadget::Info info = { RenderThemeGadget::Type::Generic, "scale", themePartStateFlags(*this, Scale, renderObject), { } }; 1416 if (part == SliderHorizontalPart) 1417 info.classList.append("horizontal"); 1418 else 1419 info.classList.append("vertical"); 1420 auto scaleGadget = RenderThemeGadget::create(info); 1421 info.name = "contents"; 1422 info.classList.clear(); 1423 auto contentsGadget = RenderThemeGadget::create(info, scaleGadget.get()); 1424 info.name = "trough"; 1425 auto troughGadget = RenderThemeGadget::create(info, contentsGadget.get()); 1426 info.name = "slider"; 1427 info.state = themePartStateFlags(*this, ScaleSlider, renderObject); 1428 auto sliderGadget = RenderThemeGadget::create(info, troughGadget.get()); 1429 info.name = "highlight"; 1430 auto highlightGadget = RenderThemeGadget::create(info, troughGadget.get()); 1431 1432 GtkBorder scaleContentsBox = scaleGadget->contentsBox(); 1433 GtkBorder contentsContentsBox = contentsGadget->contentsBox(); 1434 GtkBorder troughContentsBox = troughGadget->contentsBox(); 1337 auto& sliderWidget = static_cast<RenderThemeSlider&>(RenderThemeWidget::getOrCreate(part == SliderThumbHorizontalPart ? RenderThemeWidget::Type::HorizontalSlider : RenderThemeWidget::Type::VerticalSlider)); 1338 auto scaleState = themePartStateFlags(*this, Scale, renderObject); 1339 auto& scale = sliderWidget.scale(); 1340 scale.setState(scaleState); 1341 auto& contents = sliderWidget.contents(); 1342 auto& trough = sliderWidget.trough(); 1343 trough.setState(scaleState); 1344 auto& slider = sliderWidget.slider(); 1345 slider.setState(themePartStateFlags(*this, ScaleSlider, renderObject)); 1346 auto& highlight = sliderWidget.highlight(); 1347 1348 GtkBorder scaleContentsBox = scale.contentsBox(); 1349 GtkBorder contentsContentsBox = contents.contentsBox(); 1350 GtkBorder troughContentsBox = trough.contentsBox(); 1435 1351 GtkBorder padding; 1436 1352 padding.left = scaleContentsBox.left + contentsContentsBox.left + troughContentsBox.left; … … 1440 1356 1441 1357 // Scale trough defines its size querying slider and highlight. 1442 int troughHeight = trough Gadget->preferredSize().height() + std::max(sliderGadget->preferredSize().height(), highlightGadget->preferredSize().height());1358 int troughHeight = trough.preferredSize().height() + std::max(slider.preferredSize().height(), highlight.preferredSize().height()); 1443 1359 IntRect sliderRect(rect.location(), IntSize(troughHeight, troughHeight)); 1444 1360 sliderRect.move(padding.left, padding.top); 1445 1361 sliderRect.contract(padding.left + padding.right, padding.top + padding.bottom); 1446 slider Gadget->render(paintInfo.context().platformContext()->cr(), sliderRect);1362 slider.render(paintInfo.context().platformContext()->cr(), sliderRect); 1447 1363 return false; 1448 1364 } … … 1541 1457 IntRect RenderThemeGtk::progressBarRectForBounds(const RenderObject& renderObject, const IntRect& bounds) const 1542 1458 { 1543 RenderThemeGadget::Info info = { RenderThemeGadget::Type::Generic, "progressbar", GTK_STATE_FLAG_NORMAL, { "horizontal" } };1544 auto progressBarGadget = RenderThemeGadget::create(info);1545 info.name = "trough";1546 info.classList.clear();1547 auto troughGadget = RenderThemeGadget::create(info, progressBarGadget.get());1548 info.name = "progress";1549 if (renderObject.style().direction() == RTL)1550 info.classList.append("right");1551 else1552 info.classList.append("left");1553 1459 const auto& renderProgress = downcast<RenderProgress>(renderObject); 1554 if (renderProgress.isDeterminate()) 1555 info.classList.append("pulse"); 1556 auto progressGadget = RenderThemeGadget::create(info, troughGadget.get()); 1557 IntSize preferredSize = progressBarGadget->preferredSize(); 1558 preferredSize = preferredSize.expandedTo(troughGadget->preferredSize()); 1559 preferredSize = preferredSize.expandedTo(progressGadget->preferredSize()); 1460 auto& progressBarWidget = static_cast<RenderThemeProgressBar&>(RenderThemeWidget::getOrCreate(renderProgress.isDeterminate() ? RenderThemeProgressBar::Type::ProgressBar : RenderThemeProgressBar::Type::IndeterminateProgressBar)); 1461 IntSize preferredSize = progressBarWidget.progressBar().preferredSize(); 1462 preferredSize = preferredSize.expandedTo(progressBarWidget.trough().preferredSize()); 1463 preferredSize = preferredSize.expandedTo(progressBarWidget.progress().preferredSize()); 1560 1464 return IntRect(bounds.x(), bounds.y(), bounds.width(), preferredSize.height()); 1561 1465 } … … 1566 1470 return true; 1567 1471 1568 RenderThemeGadget::Info info = { RenderThemeGadget::Type::Generic, "progressbar", GTK_STATE_FLAG_NORMAL, { "horizontal" } };1569 auto progressBarGadget = RenderThemeGadget::create(info);1570 info.name = "trough";1571 info.classList.clear();1572 auto troughGadget = RenderThemeGadget::create(info, progressBarGadget.get());1573 info.name = "progress";1574 if (renderObject.style().direction() == RTL)1575 info.classList.append("right");1576 else1577 info.classList.append("left");1578 1472 const auto& renderProgress = downcast<RenderProgress>(renderObject); 1579 if (renderProgress.isDeterminate()) 1580 info.classList.append("pulse"); 1581 auto progressGadget = RenderThemeGadget::create(info, troughGadget.get()); 1582 1583 progressBarGadget->render(paintInfo.context().platformContext()->cr(), rect); 1584 troughGadget->render(paintInfo.context().platformContext()->cr(), rect); 1585 progressGadget->render(paintInfo.context().platformContext()->cr(), calculateProgressRect(renderObject, rect)); 1473 auto& progressBarWidget = static_cast<RenderThemeProgressBar&>(RenderThemeWidget::getOrCreate(renderProgress.isDeterminate() ? RenderThemeProgressBar::Type::ProgressBar : RenderThemeProgressBar::Type::IndeterminateProgressBar)); 1474 progressBarWidget.progressBar().render(paintInfo.context().platformContext()->cr(), rect); 1475 progressBarWidget.trough().render(paintInfo.context().platformContext()->cr(), rect); 1476 progressBarWidget.progress().render(paintInfo.context().platformContext()->cr(), calculateProgressRect(renderObject, rect)); 1586 1477 return false; 1587 1478 } … … 1636 1527 void RenderThemeGtk::adjustInnerSpinButtonStyle(StyleResolver&, RenderStyle& style, const Element*) const 1637 1528 { 1638 RenderThemeGadget::Info info = { RenderThemeGadget::Type::Generic, "spinbutton", GTK_STATE_FLAG_NORMAL, { "horizontal" } }; 1639 auto spinbuttonGadget = RenderThemeGadget::create(info); 1640 info.type = RenderThemeGadget::Type::TextField; 1641 info.name = "entry"; 1642 info.classList.clear(); 1643 auto entryGadget = RenderThemeGadget::create(info, spinbuttonGadget.get()); 1644 info.type = RenderThemeGadget::Type::Icon; 1645 info.name = "button"; 1646 info.classList.append("up"); 1647 auto buttonUpGadget = RenderThemeGadget::create(info, spinbuttonGadget.get()); 1648 static_cast<RenderThemeIconGadget*>(buttonUpGadget.get())->setIconSize(RenderThemeIconGadget::IconSizeGtk::Menu); 1649 info.classList[0] = "down"; 1650 auto buttonDownGadget = RenderThemeGadget::create(info, spinbuttonGadget.get()); 1651 static_cast<RenderThemeIconGadget*>(buttonDownGadget.get())->setIconSize(RenderThemeIconGadget::IconSizeGtk::Menu); 1652 IntSize upPreferredSize = buttonUpGadget->preferredSize(); 1653 IntSize downPreferredSize = buttonDownGadget->preferredSize(); 1654 int buttonSize = std::max(std::max(upPreferredSize.width(), downPreferredSize.width()), std::max(upPreferredSize.height(), downPreferredSize.height())); 1655 style.setWidth(Length(buttonSize * 2, Fixed)); 1656 style.setHeight(Length(buttonSize, Fixed)); 1529 style.setWidth(Length(spinButtonSize().width(), Fixed)); 1530 style.setHeight(Length(spinButtonSize().height(), Fixed)); 1657 1531 } 1658 1532 1659 1533 bool RenderThemeGtk::paintInnerSpinButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 1660 1534 { 1661 RenderThemeGadget::Info info = { RenderThemeGadget::Type::Generic, "spinbutton", themePartStateFlags(*this, SpinButton, renderObject), { } }; 1662 auto spinbuttonGadget = RenderThemeGadget::create(info); 1663 info.type = RenderThemeGadget::Type::TextField; 1664 info.name = "entry"; 1665 info.classList.clear(); 1666 auto entryGadget = RenderThemeGadget::create(info, spinbuttonGadget.get()); 1667 info.type = RenderThemeGadget::Type::Icon; 1668 info.name = "button"; 1669 info.classList.append("up"); 1670 info.state = themePartStateFlags(*this, SpinButtonUpButton, renderObject); 1671 auto buttonUpGadget = RenderThemeGadget::create(info, spinbuttonGadget.get()); 1672 auto* gadgetIcon = static_cast<RenderThemeIconGadget*>(buttonUpGadget.get()); 1673 gadgetIcon->setIconSize(RenderThemeIconGadget::IconSizeGtk::Menu); 1674 gadgetIcon->setIconName("list-add-symbolic"); 1675 info.classList[0] = "down"; 1676 info.state = themePartStateFlags(*this, SpinButtonDownButton, renderObject); 1677 auto buttonDownGadget = RenderThemeGadget::create(info, spinbuttonGadget.get()); 1678 gadgetIcon = static_cast<RenderThemeIconGadget*>(buttonDownGadget.get()); 1679 gadgetIcon->setIconSize(RenderThemeIconGadget::IconSizeGtk::Menu); 1680 gadgetIcon->setIconName("list-remove-symbolic"); 1535 auto& spinButtonWidget = static_cast<RenderThemeSpinButton&>(RenderThemeWidget::getOrCreate(RenderThemeWidget::Type::SpinButton)); 1536 auto spinButtonState = themePartStateFlags(*this, SpinButton, renderObject); 1537 spinButtonWidget.spinButton().setState(spinButtonState); 1538 spinButtonWidget.entry().setState(spinButtonState); 1539 auto& up = spinButtonWidget.up(); 1540 up.setState(themePartStateFlags(*this, SpinButtonUpButton, renderObject)); 1541 auto& down = spinButtonWidget.down(); 1542 down.setState(themePartStateFlags(*this, SpinButtonDownButton, renderObject)); 1681 1543 1682 1544 IntRect iconRect = rect; 1683 1545 iconRect.setWidth(iconRect.width() / 2); 1684 1546 if (renderObject.style().direction() == RTL) 1685 buttonUpGadget->render(paintInfo.context().platformContext()->cr(), iconRect);1547 up.render(paintInfo.context().platformContext()->cr(), iconRect); 1686 1548 else 1687 buttonDownGadget->render(paintInfo.context().platformContext()->cr(), iconRect);1549 down.render(paintInfo.context().platformContext()->cr(), iconRect); 1688 1550 iconRect.move(iconRect.width(), 0); 1689 1551 if (renderObject.style().direction() == RTL) 1690 buttonDownGadget->render(paintInfo.context().platformContext()->cr(), iconRect);1552 down.render(paintInfo.context().platformContext()->cr(), iconRect); 1691 1553 else 1692 buttonUpGadget->render(paintInfo.context().platformContext()->cr(), iconRect);1554 up.render(paintInfo.context().platformContext()->cr(), iconRect); 1693 1555 1694 1556 return false; … … 1823 1685 static Color styleColor(RenderThemePart themePart, GtkStateFlags state, StyleColorType colorType) 1824 1686 { 1825 RenderThemeGadget::Info info = { RenderThemeGadget::Type::Generic, nullptr, state, { } }; 1826 std::unique_ptr<RenderThemeGadget> parentGadget; 1827 RenderThemePart part = themePart; 1828 if (themePart == Entry && (state & GTK_STATE_FLAG_SELECTED)) { 1829 info.name = "entry"; 1830 parentGadget = RenderThemeGadget::create(info); 1831 part = EntrySelection; 1832 } 1833 1834 switch (part) { 1835 case Entry: 1836 info.name = "entry"; 1837 break; 1838 case EntrySelection: 1839 info.name = "selection"; 1840 break; 1841 case ListBox: 1842 info.name = "treeview"; 1843 info.classList.append("view"); 1844 break; 1845 case Button: 1846 info.name = "button"; 1847 break; 1687 RenderThemeGadget* gadget = nullptr; 1688 switch (themePart) { 1848 1689 default: 1849 1690 ASSERT_NOT_REACHED(); 1850 info.name = "entry"; 1851 } 1852 1853 auto gadget = RenderThemeGadget::create(info, parentGadget.get()); 1691 FALLTHROUGH; 1692 case Entry: 1693 gadget = &static_cast<RenderThemeEntry&>(RenderThemeWidget::getOrCreate(RenderThemeWidget::Type::Entry)).entry(); 1694 break; 1695 case EntrySelection: 1696 gadget = static_cast<RenderThemeEntry&>(RenderThemeWidget::getOrCreate(RenderThemeWidget::Type::SelectedEntry)).selection(); 1697 break; 1698 case ListBox: 1699 gadget = &static_cast<RenderThemeListView&>(RenderThemeWidget::getOrCreate(RenderThemeWidget::Type::ListView)).treeview(); 1700 break; 1701 case Button: 1702 gadget = &static_cast<RenderThemeButton&>(RenderThemeWidget::getOrCreate(RenderThemeWidget::Type::Button)).button(); 1703 break; 1704 } 1705 1706 ASSERT(gadget); 1707 gadget->setState(state); 1854 1708 return colorType == StyleColorBackground ? gadget->backgroundColor() : gadget->color(); 1855 1709 } … … 1871 1725 Color RenderThemeGtk::platformActiveSelectionBackgroundColor() const 1872 1726 { 1873 return styleColor(Entry , static_cast<GtkStateFlags>(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED), StyleColorBackground);1727 return styleColor(EntrySelection, static_cast<GtkStateFlags>(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED), StyleColorBackground); 1874 1728 } 1875 1729 1876 1730 Color RenderThemeGtk::platformInactiveSelectionBackgroundColor() const 1877 1731 { 1878 return styleColor(Entry , GTK_STATE_FLAG_SELECTED, StyleColorBackground);1732 return styleColor(EntrySelection, GTK_STATE_FLAG_SELECTED, StyleColorBackground); 1879 1733 } 1880 1734 1881 1735 Color RenderThemeGtk::platformActiveSelectionForegroundColor() const 1882 1736 { 1883 return styleColor(Entry , static_cast<GtkStateFlags>(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED), StyleColorForeground);1737 return styleColor(EntrySelection, static_cast<GtkStateFlags>(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED), StyleColorForeground); 1884 1738 } 1885 1739 1886 1740 Color RenderThemeGtk::platformInactiveSelectionForegroundColor() const 1887 1741 { 1888 return styleColor(Entry , GTK_STATE_FLAG_SELECTED, StyleColorForeground);1742 return styleColor(EntrySelection, GTK_STATE_FLAG_SELECTED, StyleColorForeground); 1889 1743 } 1890 1744 … … 1942 1796 bool RenderThemeGtk::paintMediaButton(const RenderObject& renderObject, GraphicsContext& graphicsContext, const IntRect& rect, const char* iconName) 1943 1797 { 1944 RenderThemeGadget::Info info = { RenderThemeGadget::Type::Icon, "image", themePartStateFlags(*this, MediaButton, renderObject), { } };1945 auto gadget = RenderThemeGadget::create(info);1946 auto* gadgetIcon = static_cast<RenderThemeIconGadget*>(gadget.get());1947 gadgetIcon->setIconSize(RenderThemeIconGadget::IconSizeGtk::Menu);1948 gadgetIcon->setIconName(iconName);1949 return ! gadget->render(graphicsContext.platformContext()->cr(), rect);1798 auto& iconWidget = static_cast<RenderThemeIcon&>(RenderThemeWidget::getOrCreate(RenderThemeWidget::Type::Icon)); 1799 auto& icon = static_cast<RenderThemeIconGadget&>(iconWidget.icon()); 1800 icon.setState(themePartStateFlags(*this, MediaButton, renderObject)); 1801 icon.setIconSize(RenderThemeIconGadget::IconSizeGtk::Menu); 1802 icon.setIconName(iconName); 1803 return !icon.render(graphicsContext.platformContext()->cr(), rect); 1950 1804 } 1951 1805 #else -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebKit2/ChangeLog ¶
r217367 r219817 1 2017-07-24 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 Unreviewed. Update OptionsGTK.cmake and NEWS for 2.16.6 release. 4 5 * gtk/NEWS: Add release notes for 2.16.6. 6 7 2017-06-26 Carlos Garcia Campos <cgarcia@igalia.com> 8 9 Unreviewed. Update OptionsGTK.cmake and NEWS for 2.16.5 release. 10 11 * gtk/NEWS: Add release notes for 2.16.5. 12 13 2017-06-25 Michael Catanzaro <mcatanzaro@igalia.com> 14 15 Unreviewed, rolling out r215190. 16 17 Broke product select element on GNOME Bugzilla 18 19 Reverted changeset: 20 21 "[GTK] Misplaced right click menu on web page due to 22 deprecated gtk_menu_popup()" 23 https://bugs.webkit.org/show_bug.cgi?id=170553 24 http://trac.webkit.org/changeset/215190 25 26 2017-06-20 Carlos Garcia Campos <cgarcia@igalia.com> 27 28 Unreviewed. Update OptionsGTK.cmake and NEWS for 2.16.4 release. 29 30 * gtk/NEWS: Add release notes for 2.16.4. 31 32 2017-06-15 Carlos Garcia Campos <cgarcia@igalia.com> 33 34 Unreviewed. Fix copy-paste error in GTK+ WEBKIT_JAVASCRIPT_ERROR definition. 35 36 The print one was copied there. 37 38 * UIProcess/API/gtk/WebKitError.h: 39 40 2017-06-16 Carlos Garcia Campos <cgarcia@igalia.com> 41 42 Unreviewed. Remove wrong headers check from some GTK+ API files. 43 44 Remove the __WEBKIT_WEB_EXTENSION_H_INSIDE__ check since these are not actually shared. 45 46 * UIProcess/API/gtk/WebKitEditorState.h: 47 * UIProcess/API/gtk/WebKitOptionMenu.h: 48 * UIProcess/API/gtk/WebKitPrintCustomWidget.h: 49 50 2017-06-13 Carlos Garcia Campos <cgarcia@igalia.com> 51 52 [GTK] Blob download doesn't work 53 https://bugs.webkit.org/show_bug.cgi?id=172442 54 55 Reviewed by Carlos Alberto Lopez Perez. 56 57 GTK+ API uses URIs for download destination paths, and passes that URIs to the WebKit internals. But WebKit 58 expects download destination location to be a local path. This is not a problem for normal downloads, because 59 the soup backend handles the cases of download destination being a URI and a path. For blob downloads 60 NetworkDataTaskBlob is used, and it always expects the download destination to be a local path, failing in 61 FileSystem::openFile() when a URI is passed. We need to keep using local files internally and convert to URIs 62 only when exposing those paths to the API. 63 64 * NetworkProcess/soup/NetworkDataTaskSoup.cpp: 65 (WebKit::NetworkDataTaskSoup::download): Stop handling URIs here, we should always expect local files. 66 * UIProcess/API/gtk/WebKitDownload.cpp: 67 (webkitDownloadDecideDestinationWithSuggestedFilename): Convert destination URI to filanme before pasing it to DownloadClient. 68 (webkitDownloadDestinationCreated): Convert the destination path to a URI before passing it to WebKitDownload::created-destionation signal. 69 * UIProcess/API/gtk/WebKitDownloadClient.cpp: 70 * UIProcess/API/gtk/WebKitDownloadPrivate.h: 71 72 2017-06-09 Ryosuke Niwa <rniwa@webkit.org> 73 74 Crash inside WebKit::PluginView::getAuthenticationInfo 75 https://bugs.webkit.org/show_bug.cgi?id=173083 76 <rdar://problem/32513144> 77 78 Address Darin's review comment. 79 80 * WebProcess/Plugins/PluginView.cpp: 81 (WebKit::PluginView::getAuthenticationInfo): 82 83 2017-06-07 Ryosuke Niwa <rniwa@webkit.org> 84 85 Crash inside WebKit::PluginView::getAuthenticationInfo 86 https://bugs.webkit.org/show_bug.cgi?id=173083 87 88 Reviewed by Chris Dumez. 89 90 Added a null pointer check. The content document may have went away by the time we get there from IPC. 91 92 * WebProcess/Plugins/PluginView.cpp: 93 (WebKit::PluginView::getAuthenticationInfo): 94 95 2017-06-05 Chris Dumez <cdumez@apple.com> 96 97 ASSERTION FAILED: RunLoop::isMain() in com.apple.WebKit: IPC::Connection::sendSyncMessage + 128 98 https://bugs.webkit.org/show_bug.cgi?id=172943 99 <rdar://problem/31288058> 100 101 Reviewed by Alexey Proskuryakov. 102 103 In Connection::sendMessage(), make sure we only ever transform asynchronous messages into synchronous 104 ones if sendMessage() is called on the main thread. This is necessary because we no longer support 105 sending synchronous messages from a background thread since r205125. 106 107 * Platform/IPC/Connection.cpp: 108 (IPC::Connection::sendMessage): 109 (IPC::Connection::sendSyncMessage): 110 111 2017-06-02 Chris Dumez <cdumez@apple.com> 112 113 REGRESSION (r206386): Xactimate Website Crashes @ com.apple.WebKit: WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant + 255 114 https://bugs.webkit.org/show_bug.cgi?id=172846 115 <rdar://problem/31093005> 116 117 Reviewed by Mark Lam. 118 119 Follow-up to r217695 to deal with exceptions potentially thrown by 120 NPRuntimeObjectMap::convertJSValueToNPVariant() as well. 121 122 * WebProcess/Plugins/Netscape/NPJSObject.cpp: 123 (WebKit::NPJSObject::invoke): 124 125 2017-06-01 Chris Dumez <cdumez@apple.com> 126 127 REGRESSION (r206386): Xactimate Website Crashes @ com.apple.WebKit: WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant + 255 128 https://bugs.webkit.org/show_bug.cgi?id=172846 129 <rdar://problem/31093005> 130 131 Reviewed by Andreas Kling. 132 133 In NPJSObject::invoke(), return early if there was an exception when calling JSC::call(). 134 Using the value returned by JSC::call() when an exception occurred is unsafe. 135 136 * WebProcess/Plugins/Netscape/NPJSObject.cpp: 137 (WebKit::NPJSObject::invoke): 138 139 2017-06-12 Carlos Garcia Campos <cgarcia@igalia.com> 140 141 [GTK] Stop dismissing menus attached to the web view for every injected event 142 https://bugs.webkit.org/show_bug.cgi?id=172708 143 144 Reviewed by Alex Christensen. 145 146 To actually simulate a right-click event we should also send the button release after the press, and let the page 147 handle the events in addition to sending the event to the context menu controller, like we do with normal 148 events. So, this is mostly the same as a real right-click event but without actually showing the menu. 149 150 * WebProcess/WebPage/WebPage.cpp: 151 (WebKit::WebPage::contextMenuAtPointInWindow): 152 153 2017-04-11 Adrian Perez de Castro <aperez@igalia.com> 154 155 [GTK] Attach popup menu to web view widget 156 https://bugs.webkit.org/show_bug.cgi?id=145866 157 158 Use gtk_menu_attach_to_widget() to let GTK+ know that popup menus belong to a certain web view. 159 This improves the positioning choices that the toolkit can do, and solves a long-standing issue 160 that caused long popup menus to hang outside of the available display area under Wayland. 161 162 Based on a patch by Jonas Ådahl <jadahl@gmail.com>. 163 164 Reviewed by Carlos Garcia Campos. 165 166 * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: 167 (WebKit::WebPopupMenuProxyGtk::showPopupMenu): 168 169 2017-04-10 Adrian Perez de Castro <aperez@igalia.com> 170 171 [GTK] Misplaced right click menu on web page due to deprecated gtk_menu_popup() 172 https://bugs.webkit.org/show_bug.cgi?id=170553 173 174 Reviewed by Michael Catanzaro. 175 176 Use gtk_menu_popup_at_pointer() and gtk_menu_popup_at_rect() when building with GTK+ 3.22 or 177 newer. This allows the Wayland GTK+ backend to properly position popup menus, and also avoids 178 using functions which were deprecated starting at that GTK+ release. 179 180 * UIProcess/gtk/WebContextMenuProxyGtk.cpp: 181 (WebKit::WebContextMenuProxyGtk::show): Use gtk_menu_popup_at_pointer() as there is always a 182 pointer event that can be passed to it. 183 * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: 184 (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Use gtk_menu_popup_at_rect(), using the coordinates 185 of the control passed as reference rectangle. Some conditional code is needed because with newer 186 GTK+ versions a relative offset instead of an absolute position is needed. 187 188 2017-04-10 Adrian Perez de Castro <aperez@igalia.com> 189 190 [GTK] Opening a popup menu does not pre-select the active item 191 https://bugs.webkit.org/show_bug.cgi?id=170680 192 193 Reviewed by Michael Catanzaro. 194 195 * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: 196 (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Use gtk_menu_shell_select_item() to 197 ensure that the active item appears selected right after popping up the menu. 198 1 199 2017-05-24 Carlos Garcia Campos <cgarcia@igalia.com> 2 200 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebKit2/NetworkProcess/soup/NetworkDataTaskSoup.cpp ¶
r217367 r219817 849 849 } 850 850 851 if (g_path_is_absolute(m_pendingDownloadLocation.utf8().data())) 852 m_downloadDestinationFile = adoptGRef(g_file_new_for_path(m_pendingDownloadLocation.utf8().data())); 853 else 854 m_downloadDestinationFile = adoptGRef(g_file_new_for_uri(m_pendingDownloadLocation.utf8().data())); 851 CString downloadDestinationPath = m_pendingDownloadLocation.utf8(); 852 m_downloadDestinationFile = adoptGRef(g_file_new_for_path(downloadDestinationPath.data())); 855 853 GRefPtr<GFileOutputStream> outputStream; 856 854 GUniqueOutPtr<GError> error; … … 864 862 } 865 863 866 GUniquePtr<char> downloadDestinationURI(g_file_get_uri(m_downloadDestinationFile.get())); 867 GUniquePtr<char> intermediateURI(g_strdup_printf("%s.wkdownload", downloadDestinationURI.get())); 868 m_downloadIntermediateFile = adoptGRef(g_file_new_for_uri(intermediateURI.get())); 869 outputStream = adoptGRef(g_file_replace(m_downloadIntermediateFile.get(), 0, TRUE, G_FILE_CREATE_NONE, 0, &error.outPtr())); 864 GUniquePtr<char> intermediatePath(g_strdup_printf("%s.wkdownload", downloadDestinationPath.data())); 865 m_downloadIntermediateFile = adoptGRef(g_file_new_for_path(intermediatePath.get())); 866 outputStream = adoptGRef(g_file_replace(m_downloadIntermediateFile.get(), nullptr, TRUE, G_FILE_CREATE_NONE, nullptr, &error.outPtr())); 870 867 if (!outputStream) { 871 868 didFailDownload(platformDownloadDestinationError(m_response, error->message)); … … 878 875 auto* downloadPtr = download.get(); 879 876 downloadManager.dataTaskBecameDownloadTask(m_pendingDownloadID, WTFMove(download)); 880 downloadPtr->didCreateDestination( String::fromUTF8(downloadDestinationURI.get()));877 downloadPtr->didCreateDestination(m_pendingDownloadLocation); 881 878 882 879 ASSERT(!m_client); -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebKit2/Platform/IPC/Connection.cpp ¶
r217367 r219817 380 380 return false; 381 381 382 if ( m_inDispatchMessageMarkedToUseFullySynchronousModeForTesting && !encoder->isSyncMessage() && !(encoder->messageReceiverName() == "IPC")) {382 if (RunLoop::isMain() && m_inDispatchMessageMarkedToUseFullySynchronousModeForTesting && !encoder->isSyncMessage() && !(encoder->messageReceiverName() == "IPC")) { 383 383 uint64_t syncRequestID; 384 384 auto wrappedMessage = createSyncMessageEncoder("IPC", "WrappedAsyncMessageForTesting", encoder->destinationID(), syncRequestID); -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp ¶
r217367 r219817 32 32 #include <wtf/glib/GRefPtr.h> 33 33 #include <wtf/glib/GUniquePtr.h> 34 #include <wtf/text/CString.h> 34 35 35 36 using namespace WebKit; … … 403 404 } 404 405 405 CString webkitDownloadDecideDestinationWithSuggestedFilename(WebKitDownload* download, const CString& suggestedFilename, bool& allowOverwrite)406 String webkitDownloadDecideDestinationWithSuggestedFilename(WebKitDownload* download, const CString& suggestedFilename, bool& allowOverwrite) 406 407 { 407 408 if (download->priv->isCancelled) 408 return "";409 return emptyString(); 409 410 gboolean returnValue; 410 411 g_signal_emit(download, signals[DECIDE_DESTINATION], 0, suggestedFilename.data(), &returnValue); 411 412 allowOverwrite = download->priv->allowOverwrite; 412 return download->priv->destinationURI; 413 } 414 415 void webkitDownloadDestinationCreated(WebKitDownload* download, const CString& destinationURI) 413 GUniquePtr<char> destinationPath(g_filename_from_uri(download->priv->destinationURI.data(), nullptr, nullptr)); 414 if (!destinationPath) 415 return emptyString(); 416 return String::fromUTF8(destinationPath.get()); 417 } 418 419 void webkitDownloadDestinationCreated(WebKitDownload* download, const String& destinationPath) 416 420 { 417 421 if (download->priv->isCancelled) 418 422 return; 419 g_signal_emit(download, signals[CREATED_DESTINATION], 0, destinationURI.data(), nullptr); 423 GUniquePtr<char> destinationURI(g_filename_to_uri(destinationPath.utf8().data(), nullptr, nullptr)); 424 ASSERT(destinationURI); 425 g_signal_emit(download, signals[CREATED_DESTINATION], 0, destinationURI.get()); 420 426 } 421 427 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/API/gtk/WebKitDownloadClient.cpp ¶
r217367 r219817 78 78 { 79 79 GRefPtr<WebKitDownload> download = webkitWebContextGetOrCreateDownload(downloadProxy); 80 return String::fromUTF8(webkitDownloadDecideDestinationWithSuggestedFilename(download.get(), filename.utf8(), allowOverwrite));80 return webkitDownloadDecideDestinationWithSuggestedFilename(download.get(), filename.utf8(), allowOverwrite); 81 81 } 82 82 … … 84 84 { 85 85 GRefPtr<WebKitDownload> download = webkitWebContextGetOrCreateDownload(downloadProxy); 86 webkitDownloadDestinationCreated(download.get(), path .utf8());86 webkitDownloadDestinationCreated(download.get(), path); 87 87 } 88 88 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/API/gtk/WebKitDownloadPrivate.h ¶
r217367 r219817 25 25 #include <WebCore/ResourceError.h> 26 26 #include <WebCore/ResourceRequest.h> 27 #include <wtf/text/CString.h>28 27 29 28 WebKitDownload* webkitDownloadCreate(WebKit::DownloadProxy*); … … 35 34 void webkitDownloadCancelled(WebKitDownload*); 36 35 void webkitDownloadFinished(WebKitDownload*); 37 CString webkitDownloadDecideDestinationWithSuggestedFilename(WebKitDownload*, const CString& suggestedFilename, bool& allowOverwrite);38 void webkitDownloadDestinationCreated(WebKitDownload*, const CString& destinationURI);36 String webkitDownloadDecideDestinationWithSuggestedFilename(WebKitDownload*, const CString& suggestedFilename, bool& allowOverwrite); 37 void webkitDownloadDestinationCreated(WebKitDownload*, const String& destinationPath); 39 38 40 39 #endif // WebKitDownloadPrivate_h -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/API/gtk/WebKitEditorState.h ¶
r217367 r219817 18 18 */ 19 19 20 #if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION) && !defined(__WEBKIT_WEB_EXTENSION_H_INSIDE__)20 #if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION) 21 21 #error "Only <webkit2/webkit2.h> can be included directly." 22 22 #endif -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/API/gtk/WebKitError.h ¶
r217367 r219817 35 35 #define WEBKIT_DOWNLOAD_ERROR webkit_download_error_quark () 36 36 #define WEBKIT_PRINT_ERROR webkit_print_error_quark () 37 #define WEBKIT_JAVASCRIPT_ERROR webkit_ print_error_quark ()37 #define WEBKIT_JAVASCRIPT_ERROR webkit_javascript_error_quark () 38 38 #define WEBKIT_SNAPSHOT_ERROR webkit_snapshot_error_quark () 39 39 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/API/gtk/WebKitPrintCustomWidget.h ¶
r217367 r219817 18 18 */ 19 19 20 #if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION) && !defined(__WEBKIT_WEB_EXTENSION_H_INSIDE__)20 #if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION) 21 21 #error "Only <webkit2/webkit2.h> can be included directly." 22 22 #endif -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.cpp ¶
r217367 r219817 123 123 } 124 124 125 gtk_menu_attach_to_widget(GTK_MENU(m_popup), GTK_WIDGET(m_webView), nullptr); 126 125 127 const GdkEvent* event = m_client->currentlyProcessedMouseDownEvent() ? m_client->currentlyProcessedMouseDownEvent()->nativeEvent() : nullptr; 126 128 gtk_menu_popup_for_device(GTK_MENU(m_popup), event ? gdk_event_get_device(event) : nullptr, nullptr, nullptr, … … 143 145 return; 144 146 } 147 148 // This ensures that the active item gets selected after popping up the menu, and 149 // as it says in "gtkcombobox.c" (line ~1606): it's ugly, but gets the job done. 150 GtkWidget* activeChild = gtk_menu_get_active(GTK_MENU(m_popup)); 151 if (activeChild && gtk_widget_get_visible(activeChild)) 152 gtk_menu_shell_select_item(GTK_MENU_SHELL(m_popup), activeChild); 145 153 } 146 154 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebKit2/WebProcess/Plugins/Netscape/NPJSObject.cpp ¶
r217367 r219817 312 312 JSValue value = JSC::call(exec, function, callType, callData, m_jsObject.get(), argumentList); 313 313 314 if (UNLIKELY(scope.exception())) { 315 scope.clearException(); 316 return false; 317 } 318 314 319 // Convert and return the result of the function call. 315 320 m_objectMap->convertJSValueToNPVariant(exec, value, *result); 316 scope.clearException(); 321 322 if (UNLIKELY(scope.exception())) { 323 scope.clearException(); 324 return false; 325 } 317 326 318 327 return true; -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebKit2/WebProcess/Plugins/PluginView.cpp ¶
r217367 r219817 1594 1594 bool PluginView::getAuthenticationInfo(const ProtectionSpace& protectionSpace, String& username, String& password) 1595 1595 { 1596 String partitionName = m_pluginElement->contentDocument()->topDocument().securityOrigin().domainForCachePartition(); 1596 auto* contentDocument = m_pluginElement->contentDocument(); 1597 if (!contentDocument) 1598 return false; 1599 1600 String partitionName = contentDocument->topDocument().securityOrigin().domainForCachePartition(); 1597 1601 Credential credential = CredentialStorage::defaultCredentialStorage().get(partitionName, protectionSpace); 1598 1602 if (credential.isEmpty()) -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebKit2/WebProcess/WebPage/WebPage.cpp ¶
r217367 r219817 2059 2059 { 2060 2060 corePage()->contextMenuController().clearContextMenu(); 2061 2061 2062 2062 // Simulate a mouse click to generate the correct menu. 2063 PlatformMouseEvent mouseEvent(point, point, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime(), WebCore::ForceAtClick, WebCore::NoTap); 2064 bool handled = corePage()->userInputBridge().handleContextMenuEvent(mouseEvent, &corePage()->mainFrame()); 2065 if (!handled) 2066 return 0; 2067 2068 return contextMenu(); 2063 PlatformMouseEvent mousePressEvent(point, point, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime(), WebCore::ForceAtClick, WebCore::NoTap); 2064 corePage()->userInputBridge().handleMousePressEvent(mousePressEvent); 2065 bool handled = corePage()->userInputBridge().handleContextMenuEvent(mousePressEvent, &corePage()->mainFrame()); 2066 auto* menu = handled ? contextMenu() : nullptr; 2067 PlatformMouseEvent mouseReleaseEvent(point, point, RightButton, PlatformEvent::MouseReleased, 1, false, false, false, false, currentTime(), WebCore::ForceAtClick, WebCore::NoTap); 2068 corePage()->userInputBridge().handleMouseReleaseEvent(mouseReleaseEvent); 2069 2070 return menu; 2069 2071 } 2070 2072 #endif -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/WebKit2/gtk/NEWS ¶
r217367 r219817 1 ================== 2 WebKitGTK+ 2.16.6 3 ================== 4 5 - Fix rendering of spin buttons with GTK+ >= 3.20 when the entry width is too short. 6 - Fix the build when Wayland target is enabled and X11 disabled. 7 - Fix several crashes and rendering issues. 8 - Security fixes: CVE-2017-7039, CVE-2017-7018, CVE-2017-7030, CVE-2017-7037, CVE-2017-7034, 9 CVE-2017-7055, CVE-2017-7056, CVE-2017-7064, CVE-2017-7061, CVE-2017-7048, CVE-2017-7046. 10 11 ================== 12 WebKitGTK+ 2.16.5 13 ================== 14 15 - Fix a web process crash when page finishes loading in several web sites. 16 - Fix the menu of select elements not showing in some cases under Wayland. 17 18 ================== 19 WebKitGTK+ 2.16.4 20 ================== 21 22 - Fix web process deadlock when seeking youtube videos. 23 - Fix blob downloads. 24 - Improve theme rendering performance when using GTK+ >= 3.20. 25 - Fix positioning of popup menus in Wayland. 26 - Fix several crashes and rendering issues. 27 - Security fixes: CVE-2017-2538. 28 1 29 ================== 2 30 WebKitGTK+ 2.16.3 -
TabularUnified releases/WebKitGTK/webkit-2.16/Source/cmake/OptionsGTK.cmake ¶
r217367 r219817 3 3 set(PROJECT_VERSION_MAJOR 2) 4 4 set(PROJECT_VERSION_MINOR 16) 5 set(PROJECT_VERSION_MICRO 3)5 set(PROJECT_VERSION_MICRO 6) 6 6 set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_MICRO}) 7 7 set(WEBKITGTK_API_VERSION 4.0) … … 15 15 # Libtool library version, not to be confused with API version. 16 16 # See http://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html 17 CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(WEBKIT2 56 619)18 CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(JAVASCRIPTCORE 23 1 05)17 CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(WEBKIT2 56 9 19) 18 CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(JAVASCRIPTCORE 23 13 5) 19 19 20 20 # These are shared variables, but we special case their definition so that we can use the -
TabularUnified releases/WebKitGTK/webkit-2.16/Tools/ChangeLog ¶
r217367 r219817 1 2017-06-25 Michael Catanzaro <mcatanzaro@igalia.com> 2 3 Unreviewed, rolling out r215190. 4 5 Broke product select element on GNOME Bugzilla 6 7 Reverted changeset: 8 9 "[GTK] Misplaced right click menu on web page due to 10 deprecated gtk_menu_popup()" 11 https://bugs.webkit.org/show_bug.cgi?id=170553 12 http://trac.webkit.org/changeset/215190 13 14 2017-06-13 Carlos Garcia Campos <cgarcia@igalia.com> 15 16 [GTK] Blob download doesn't work 17 https://bugs.webkit.org/show_bug.cgi?id=172442 18 19 Reviewed by Carlos Alberto Lopez Perez. 20 21 Add a unit test to check blob downloads. 22 23 * TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp: 24 (testBlobDownload): 25 (beforeAll): 26 27 2017-06-12 Carlos Garcia Campos <cgarcia@igalia.com> 28 29 [GTK] Stop dismissing menus attached to the web view for every injected event 30 https://bugs.webkit.org/show_bug.cgi?id=172708 31 32 Reviewed by Alex Christensen. 33 34 It's a workaround we added in r184015 that has worked so far for the context menu, but doesn't really work now 35 that we also attach popup menus to the web view. We really need to be able to show a popup menu, and then send 36 events while the menu is open. 37 38 * WebKitTestRunner/InjectedBundle/EventSendingController.cpp: 39 (WTR::EventSendingController::contextClick): Use WKBundlePageCopyContextMenuAtPointInWindow() also in GTK+ port. 40 * WebKitTestRunner/gtk/EventSenderProxyGtk.cpp: 41 (WTR::EventSenderProxy::dispatchEvent): Stop calling PlatformWebView::dismissAllPopupMenus(). 42 43 2017-04-10 Adrian Perez de Castro <aperez@igalia.com> 44 45 [GTK] Misplaced right click menu on web page due to deprecated gtk_menu_popup() 46 https://bugs.webkit.org/show_bug.cgi?id=170553 47 48 Reviewed by Michael Catanzaro. 49 50 Use gtk_menu_popup_at_pointer() and gtk_menu_popup_at_rect() when 51 building with GTK+ 3.22 or newer. This allows the Wayland GTK+ backend 52 to properly position popup menus, and also avoids using functions 53 which were deprecated starting at that GTK+ release. 54 55 * MiniBrowser/gtk/BrowserSearchBar.c: 56 (searchEntryMenuIconPressedCallback): 57 Update MiniBrowser to use gtk_menu_popup_at_pointer(). 58 59 2017-05-27 Zalan Bujtas <zalan@apple.com> 60 61 enclosingIntRect returns a rect with -1 width/height when the input FloatRect overflows integer. 62 https://bugs.webkit.org/show_bug.cgi?id=172676 63 64 Reviewed by Simon Fraser. 65 66 * TestWebKitAPI/Tests/WebCore/FloatRect.cpp: 67 (TestWebKitAPI::TEST): 68 1 69 2017-05-20 Ting-Wei Lan <lantw44@gmail.com> 2 70 -
TabularUnified releases/WebKitGTK/webkit-2.16/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp ¶
r217367 r219817 728 728 } 729 729 730 static void testBlobDownload(WebViewDownloadTest* test, gconstpointer) 731 { 732 test->showInWindowAndWaitUntilMapped(); 733 734 static const char* linkBlobHTML = 735 "<html><body>" 736 "<a id='downloadLink' style='position:absolute; left:1; top:1' download='foo.pdf'>Download Me</a>" 737 "<script>" 738 " blob = new Blob(['Hello world'], {type: 'text/plain'});" 739 " document.getElementById('downloadLink').href = window.URL.createObjectURL(blob);" 740 "</script>" 741 "</body></html>"; 742 test->loadHtml(linkBlobHTML, kServer->getURIForPath("/").data()); 743 test->waitUntilLoadFinished(); 744 745 g_idle_add([](gpointer userData) -> gboolean { 746 auto* test = static_cast<WebViewDownloadTest*>(userData); 747 test->clickMouseButton(1, 1, 1); 748 return FALSE; 749 }, test); 750 test->waitUntilDownloadStarted(); 751 752 g_assert(test->m_webView == webkit_download_get_web_view(test->m_download.get())); 753 test->waitUntilDownloadFinished(); 754 755 GRefPtr<GFile> downloadFile = adoptGRef(g_file_new_for_uri(webkit_download_get_destination(test->m_download.get()))); 756 GRefPtr<GFileInfo> downloadFileInfo = adoptGRef(g_file_query_info(downloadFile.get(), G_FILE_ATTRIBUTE_STANDARD_SIZE, static_cast<GFileQueryInfoFlags>(0), nullptr, nullptr)); 757 GUniquePtr<char> downloadPath(g_file_get_path(downloadFile.get())); 758 GUniqueOutPtr<char> downloadContents; 759 gsize downloadContentsLength; 760 g_assert(g_file_get_contents(downloadPath.get(), &downloadContents.outPtr(), &downloadContentsLength, nullptr)); 761 g_assert_cmpint(g_file_info_get_size(downloadFileInfo.get()), ==, downloadContentsLength); 762 g_assert_cmpstr(downloadContents.get(), ==, "Hello world"); 763 g_file_delete(downloadFile.get(), nullptr, nullptr); 764 } 765 730 766 void beforeAll() 731 767 { … … 744 780 DownloadTest::add("Downloads", "mime-type", testDownloadMIMEType); 745 781 WebViewDownloadTest::add("Downloads", "contex-menu-download-actions", testContextMenuDownloadActions); 782 WebViewDownloadTest::add("Downloads", "blob-download", testBlobDownload); 746 783 } 747 784 -
TabularUnified releases/WebKitGTK/webkit-2.16/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp ¶
r217367 r219817 548 548 JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame); 549 549 #if ENABLE(CONTEXT_MENUS) 550 #if PLATFORM(GTK) || PLATFORM(EFL)551 // Do mouse context click.552 mouseDown(2, 0);553 mouseUp(2, 0);554 WKRetainPtr<WKArrayRef> menuEntries = adoptWK(WKBundlePageCopyContextMenuItems(page));555 #else556 550 WKRetainPtr<WKArrayRef> menuEntries = adoptWK(WKBundlePageCopyContextMenuAtPointInWindow(page, m_position)); 557 #endif558 551 JSValueRef arrayResult = JSObjectMakeArray(context, 0, 0, 0); 559 552 if (!menuEntries) -
TabularUnified releases/WebKitGTK/webkit-2.16/Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp ¶
r217367 r219817 168 168 { 169 169 ASSERT(m_testController->mainWebView()); 170 171 // If we are sending an escape key to the WebView, this has the side-effect of dismissing172 // any current popups anyway. Chances are that the test is doing this to dismiss the popup173 // anyway. Not all tests properly dismiss popup menus, so we still need to do it manually174 // if this isn't an escape key press.175 if (event->type != GDK_KEY_PRESS || event->key.keyval != GDK_KEY_Escape)176 m_testController->mainWebView()->dismissAllPopupMenus();177 178 170 gtk_main_do_event(event); 179 171 gdk_event_free(event);
Note:
See TracChangeset
for help on using the changeset viewer.