@@ -172,8 +172,11 @@ require(["core/pubsubhub"], function( respecEvents ) {
172
172
propList [ title ] = { is : type , title : title , name : content , desc : desc , roles : [ ] } ;
173
173
var abstract = container . querySelector ( "." + type + "-applicability" ) ;
174
174
if ( ( abstract . textContent || abstract . innerText ) === "All elements of the base markup" ) {
175
- globalSP . push ( { is : type , title : title , name : content , desc : desc } ) ;
176
- }
175
+ globalSP . push ( { is : type , title : title , name : content , desc : desc , prohibited : false } ) ;
176
+ }
177
+ else if ( ( abstract . textContent || abstract . innerText ) === "All elements of the base markup except for some roles or elements that prohibit its use" ) {
178
+ globalSP . push ( { is : type , title : title , name : content , desc : desc , prohibited : true } ) ;
179
+ }
177
180
178
181
// the rdef is gone. if we are in a div, convert that div to a section
179
182
@@ -223,6 +226,9 @@ require(["core/pubsubhub"], function( respecEvents ) {
223
226
} else {
224
227
globalSPIndex += "<pref>" + lItem . name + "</pref>" ;
225
228
}
229
+ if ( lItem . prohibited ) {
230
+ globalSPIndex += " (Except where prohibited)" ;
231
+ }
226
232
globalSPIndex += "</li>\n" ;
227
233
}
228
234
parentNode = document . querySelector ( "#global_states" ) ;
@@ -259,6 +265,9 @@ require(["core/pubsubhub"], function( respecEvents ) {
259
265
var roleIndex = "" ;
260
266
var fromAuthor = "" ;
261
267
var fromContent = "" ;
268
+ var fromEncapsulation = "" ;
269
+ var fromLegend = "" ;
270
+ var fromProhibited = "" ;
262
271
263
272
$ . each ( document . querySelectorAll ( "rdef" ) , function ( i , item ) {
264
273
var container = item . parentNode ;
@@ -310,7 +319,7 @@ require(["core/pubsubhub"], function( respecEvents ) {
310
319
}
311
320
// are there supported states / properties in this role?
312
321
var attrs = [ ] ;
313
- $ . each ( container . querySelectorAll ( ".role-properties, .role-required-properties" ) , function ( i , node ) {
322
+ $ . each ( container . querySelectorAll ( ".role-properties, .role-required-properties, .role-disallowed " ) , function ( i , node ) {
314
323
if ( node && ( ( node . textContent && node . textContent . length !== 1 ) || ( node . innerText && node . innerText . length !== 1 ) ) ) {
315
324
// looks like we do
316
325
$ . each ( node . querySelectorAll ( "pref,sref" ) , function ( i , item ) {
@@ -319,11 +328,10 @@ require(["core/pubsubhub"], function( respecEvents ) {
319
328
name = item . textContent || item . innerText ;
320
329
}
321
330
var type = ( item . localName === "pref" ? "property" : "state" ) ;
322
- var req = false ;
323
- if ( $ ( node ) . hasClass ( "role-required-properties" ) ) {
324
- req = true ;
325
- }
326
- attrs . push ( { is : type , name : name , required : req } ) ;
331
+ var req = $ ( node ) . hasClass ( "role-required-properties" ) ;
332
+ var dis = $ ( node ) . hasClass ( "role-disallowed" ) ;
333
+ attrs . push ( { is : type , name : name , required : req , disallowed : dis } ) ;
334
+
327
335
// remember that the state or property is
328
336
// referenced by this role
329
337
propList [ name ] . roles . push ( title ) ;
@@ -341,22 +349,21 @@ require(["core/pubsubhub"], function( respecEvents ) {
341
349
req = " (name required)" ;
342
350
}
343
351
344
- if ( $ ( node ) . find ( "li" ) . length ) {
345
- // there is a list; put it in both lists
352
+ if ( node . textContent . indexOf ( "author" ) !== - 1 ) {
346
353
fromAuthor += "<li><a href=\"#" + pnID + "\" class=\"role-reference\"><code>" + content + "</code></a>" + req + "</li>" ;
347
- if ( ! isAbstract ) {
348
- fromContent += "<li><a href=\"#" + pnID + "\" class=\"role-reference\"><code>" + content + "</code></a>" + "</li>" ;
349
- }
350
- } else {
351
- // it is a text node; use that
352
- if ( node . textContent . indexOf ( "author" ) !== - 1 ) {
353
- fromAuthor += "<li><a href=\"#" + pnID + "\" class=\"role-reference\"><code>" + content + "</code></a>" + req + "</li>" ;
354
- } else if ( node . textContent . indexOf ( "content" ) !== - 1 ) {
355
- if ( ! isAbstract ) {
356
- fromContent += "<li><a href=\"#" + pnID + "\" class=\"role-reference\"><code>" + content + "</code></a>" + "</li>" ;
357
- }
358
- }
354
+ }
355
+ if ( ! isAbstract && node . textContent . indexOf ( "content" ) !== - 1 ) {
356
+ fromContent += "<li><a href=\"#" + pnID + "\" class=\"role-reference\"><code>" + content + "</code></a>" + "</li>" ;
357
+ }
358
+ if ( node . textContent . indexOf ( "prohibited" ) !== - 1 ) {
359
+ fromProhibited += "<li><a href=\"#" + pnID + "\" class=\"role-reference\"><code>" + content + "</code></a>" + req + "</li>" ;
359
360
}
361
+ if ( node . textContent . indexOf ( "encapsulation" ) !== - 1 ) {
362
+ fromEncapsulation += "<li><a href=\"#" + pnID + "\" class=\"role-reference\"><code>" + content + "</code></a>" + req + "</li>" ;
363
+ }
364
+ if ( node . textContent . indexOf ( "legend" ) !== - 1 ) {
365
+ fromLegend += "<li><a href=\"#" + pnID + "\" class=\"role-reference\"><code>" + content + "</code></a>" + req + "</li>" ;
366
+ }
360
367
} ) ;
361
368
}
362
369
if ( container . nodeName . toLowerCase ( ) == "div" ) {
@@ -535,6 +542,35 @@ require(["core/pubsubhub"], function( respecEvents ) {
535
542
parentNode . replaceChild ( list , node ) ;
536
543
}
537
544
545
+ node = document . getElementById ( "index_fromencapsulation" ) ;
546
+ if ( node ) {
547
+ parentNode = node . parentNode ;
548
+ list = document . createElement ( "ul" ) ;
549
+ list . id = "index_fromencapsulation" ;
550
+ list . className = "compact" ;
551
+ list . innerHTML = fromEncapsulation ;
552
+ parentNode . replaceChild ( list , node ) ;
553
+ }
554
+
555
+ node = document . getElementById ( "index_fromlegend" ) ;
556
+ if ( node ) {
557
+ parentNode = node . parentNode ;
558
+ list = document . createElement ( "ul" ) ;
559
+ list . id = "index_fromlegend" ;
560
+ list . className = "compact" ;
561
+ list . innerHTML = fromLegend ;
562
+ parentNode . replaceChild ( list , node ) ;
563
+ }
564
+
565
+ node = document . getElementById ( "index_fromprohibited" ) ;
566
+ if ( node ) {
567
+ parentNode = node . parentNode ;
568
+ list = document . createElement ( "ul" ) ;
569
+ list . id = "index_fromprohibited" ;
570
+ list . className = "compact" ;
571
+ list . innerHTML = fromProhibited ;
572
+ parentNode . replaceChild ( list , node ) ;
573
+ }
538
574
// assuming we found some parent roles, update those parents with their children
539
575
for ( var i = 0 ; i < subRoles . length ; i ++ ) {
540
576
var item = subRoles [ subRoles [ i ] ] ;
0 commit comments