Changeset 206926 in webkit
- Timestamp:
- Oct 7, 2016 12:37:30 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r206925 r206926 1 2016-10-07 Chris Dumez <cdumez@apple.com> 2 3 Regression(r201970): productSub / vendor / vendorSub should not be exposed on WorkerNavigator 4 https://bugs.webkit.org/show_bug.cgi?id=163124 5 6 Reviewed by Ryosuke Niwa. 7 8 Update existing test to reflect behavior change. 9 10 * fast/workers/resources/worker-navigator.js: 11 * fast/workers/worker-navigator-expected.txt: 12 1 13 2016-10-07 Ryan Haddad <ryanhaddad@apple.com> 2 14 -
trunk/LayoutTests/fast/workers/resources/worker-navigator.js
r201970 r206926 22 22 worker.postMessage("eval typeof navigator.platform == 'string'"); 23 23 worker.postMessage("eval navigator.product === 'Gecko'"); 24 worker.postMessage("eval navigator.productSub === '20030107'");24 worker.postMessage("eval navigator.productSub === undefined"); 25 25 worker.postMessage("eval navigator.userAgent.indexOf('WebKit') != 0"); 26 worker.postMessage("eval navigator.vendor === 'Apple Computer, Inc.'");27 worker.postMessage("eval navigator.vendorSub === ''");26 worker.postMessage("eval navigator.vendor === undefined"); 27 worker.postMessage("eval navigator.vendorSub === undefined"); 28 28 29 29 // NavigatorLanguage -
trunk/LayoutTests/fast/workers/worker-navigator-expected.txt
r201970 r206926 9 9 typeof navigator.platform == 'string': true 10 10 navigator.product === 'Gecko': true 11 navigator.productSub === '20030107': true11 navigator.productSub === undefined: true 12 12 navigator.userAgent.indexOf('WebKit') != 0: true 13 navigator.vendor === 'Apple Computer, Inc.': true14 navigator.vendorSub === '': true13 navigator.vendor === undefined: true 14 navigator.vendorSub === undefined: true 15 15 typeof navigator.language == 'string': true 16 16 typeof navigator.onLine == 'boolean': true -
trunk/Source/WebCore/ChangeLog
r206924 r206926 1 2016-10-07 Chris Dumez <cdumez@apple.com> 2 3 Regression(r201970): productSub / vendor / vendorSub should not be exposed on WorkerNavigator 4 https://bugs.webkit.org/show_bug.cgi?id=163124 5 6 Reviewed by Ryosuke Niwa. 7 8 productSub / vendor / vendorSub should not be exposed on WorkerNavigator: 9 - https://html.spec.whatwg.org/#navigatorid 10 11 Test case: 12 - http://w3c-test.org/submissions/3881/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.worker 13 14 Note that the specification also restricts NavigatorID's appCodeName and 15 product attributes to Window. However, it seems the HTML specification is 16 about to get updated so that these get exposed to workers: 17 - https://github.com/whatwg/html/pull/1870 18 19 No new tests, updated existing test. 20 21 * bindings/scripts/generate-bindings.pl: 22 (shouldPropertyBeExposed): 23 * page/NavigatorID.idl: 24 1 25 2016-10-07 Alex Christensen <achristensen@webkit.org> 2 26 -
trunk/Source/WebCore/bindings/scripts/generate-bindings.pl
r206904 r206926 144 144 if (!$interface->isPartial || $interface->name eq $targetInterfaceName) { 145 145 my $targetDataNode; 146 my @targetGlobalContexts; 146 147 foreach my $interface (@{$targetDocument->interfaces}) { 147 148 if ($interface->name eq $targetInterfaceName) { 148 149 $targetDataNode = $interface; 150 my $exposedAttribute = $targetDataNode->extendedAttributes->{"Exposed"} || "Window"; 151 $exposedAttribute = substr($exposedAttribute, 1, -1) if substr($exposedAttribute, 0, 1) eq "("; 152 @targetGlobalContexts = split(",", $exposedAttribute); 149 153 last; 150 154 } … … 154 158 # Support for attributes of partial interfaces. 155 159 foreach my $attribute (@{$interface->attributes}) { 160 next unless shouldPropertyBeExposed($attribute->signature, \@targetGlobalContexts); 161 156 162 # Record that this attribute is implemented by $interfaceName. 157 163 $attribute->signature->extendedAttributes->{"ImplementedBy"} = $interfaceName if $interface->isPartial; … … 166 172 # Support for methods of partial interfaces. 167 173 foreach my $function (@{$interface->functions}) { 174 next unless shouldPropertyBeExposed($function->signature, \@targetGlobalContexts); 175 168 176 # Record that this method is implemented by $interfaceName. 169 177 $function->signature->extendedAttributes->{"ImplementedBy"} = $interfaceName if $interface->isPartial; … … 178 186 # Support for constants of partial interfaces. 179 187 foreach my $constant (@{$interface->constants}) { 188 next unless shouldPropertyBeExposed($constant, \@targetGlobalContexts); 189 180 190 # Record that this constant is implemented by $interfaceName. 181 191 $constant->extendedAttributes->{"ImplementedBy"} = $interfaceName if $interface->isPartial; … … 196 206 my $codeGen = CodeGenerator->new(\@idlDirectories, $generator, $outputDirectory, $outputHeadersDirectory, $preprocessor, $writeDependencies, $verbose, $targetIdlFile); 197 207 $codeGen->ProcessDocument($targetDocument, $defines); 208 209 # Attributes / Operations / Constants of supplemental interfaces can have an [Exposed=XX] attribute which restricts 210 # on which global contexts they should be exposed. 211 sub shouldPropertyBeExposed 212 { 213 my ($signature, $targetGlobalContexts) = @_; 214 215 my $exposed = $signature->extendedAttributes->{Exposed}; 216 217 return 1 unless $exposed; 218 219 $exposed = substr($exposed, 1, -1) if substr($exposed, 0, 1) eq "("; 220 my @sourceGlobalContexts = split(",", $exposed); 221 222 for my $targetGlobalContext (@$targetGlobalContexts) { 223 return 1 if grep(/^$targetGlobalContext$/, @sourceGlobalContexts); 224 } 225 return 0; 226 } 198 227 199 228 sub generateEmptyHeaderAndCpp -
trunk/Source/WebCore/page/NavigatorID.idl
r201970 r206926 35 35 [Nondeterministic] readonly attribute DOMString platform; 36 36 [Nondeterministic] readonly attribute DOMString product; 37 [Nondeterministic ] readonly attribute DOMString productSub;37 [Nondeterministic, Exposed=Window] readonly attribute DOMString productSub; 38 38 [Nondeterministic] readonly attribute DOMString userAgent; 39 [Nondeterministic ] readonly attribute DOMString vendor;40 [Nondeterministic ] readonly attribute DOMString vendorSub;39 [Nondeterministic, Exposed=Window] readonly attribute DOMString vendor; 40 [Nondeterministic, Exposed=Window] readonly attribute DOMString vendorSub; 41 41 };
Note: See TracChangeset
for help on using the changeset viewer.