@@ -172,8 +172,11 @@ require(["core/pubsubhub"], function( respecEvents ) {
172172 propList [ title ] = { is : type , title : title , name : content , desc : desc , roles : [ ] } ;
173173 var abstract = container . querySelector ( "." + type + "-applicability" ) ;
174174 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+ }
177180
178181 // the rdef is gone. if we are in a div, convert that div to a section
179182
@@ -223,6 +226,9 @@ require(["core/pubsubhub"], function( respecEvents ) {
223226 } else {
224227 globalSPIndex += "<pref>" + lItem . name + "</pref>" ;
225228 }
229+ if ( lItem . prohibited ) {
230+ globalSPIndex += " (Except where prohibited)" ;
231+ }
226232 globalSPIndex += "</li>\n" ;
227233 }
228234 parentNode = document . querySelector ( "#global_states" ) ;
@@ -259,6 +265,9 @@ require(["core/pubsubhub"], function( respecEvents ) {
259265 var roleIndex = "" ;
260266 var fromAuthor = "" ;
261267 var fromContent = "" ;
268+ var fromEncapsulation = "" ;
269+ var fromLegend = "" ;
270+ var fromProhibited = "" ;
262271
263272 $ . each ( document . querySelectorAll ( "rdef" ) , function ( i , item ) {
264273 var container = item . parentNode ;
@@ -310,7 +319,7 @@ require(["core/pubsubhub"], function( respecEvents ) {
310319 }
311320 // are there supported states / properties in this role?
312321 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 ) {
314323 if ( node && ( ( node . textContent && node . textContent . length !== 1 ) || ( node . innerText && node . innerText . length !== 1 ) ) ) {
315324 // looks like we do
316325 $ . each ( node . querySelectorAll ( "pref,sref" ) , function ( i , item ) {
@@ -319,11 +328,10 @@ require(["core/pubsubhub"], function( respecEvents ) {
319328 name = item . textContent || item . innerText ;
320329 }
321330 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+
327335 // remember that the state or property is
328336 // referenced by this role
329337 propList [ name ] . roles . push ( title ) ;
@@ -341,22 +349,21 @@ require(["core/pubsubhub"], function( respecEvents ) {
341349 req = " (name required)" ;
342350 }
343351
344- if ( $ ( node ) . find ( "li" ) . length ) {
345- // there is a list; put it in both lists
352+ if ( node . textContent . indexOf ( "author" ) !== - 1 ) {
346353 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>" ;
359360 }
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+ }
360367 } ) ;
361368 }
362369 if ( container . nodeName . toLowerCase ( ) == "div" ) {
@@ -535,6 +542,35 @@ require(["core/pubsubhub"], function( respecEvents ) {
535542 parentNode . replaceChild ( list , node ) ;
536543 }
537544
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+ }
538574 // assuming we found some parent roles, update those parents with their children
539575 for ( var i = 0 ; i < subRoles . length ; i ++ ) {
540576 var item = subRoles [ subRoles [ i ] ] ;
0 commit comments