Rename FontDescriptionFontDataCacheKey to FontDescriptionKey
[WebKit-https.git] / Source / WebCore / Resources / plugIns.js
1
2 // Function called from WebCore.
3 function createOverlay(shadowRoot, titleText, subtitleText)
4 {
5     // Generate the following structure:
6     //
7     // <div pseudo="-webkit-snapshotted-plugin-content">
8     //     <div class="snapshot-overlay" aria-label="[Title]: [Subtitle]" role="button">
9     //         <div class="snapshot-label">
10     //             <div class="snapshot-title">[Title]</div>
11     //             <div class="snapshot-subtitle">[Subtitle]</div>
12     //         </div>
13     //     </div>
14     // </div>
15
16     var shadowContainer = document.createElement("div");
17     shadowContainer.setAttribute("pseudo", "-webkit-snapshotted-plugin-content");
18
19     var overlay = shadowContainer.appendChild(document.createElement("div"));
20     overlay.setAttribute("aria-label", titleText + ": " + subtitleText);
21     overlay.setAttribute("role", "button");
22     overlay.className = "snapshot-overlay";
23
24     var snapshotLabel = overlay.appendChild(document.createElement("div"));
25     snapshotLabel.className = "snapshot-label";
26
27     var title = snapshotLabel.appendChild(document.createElement("div"));
28     title.className = "snapshot-title";
29     title.textContent = titleText;
30
31     var subtitle = snapshotLabel.appendChild(document.createElement("div"));
32     subtitle.className = "snapshot-subtitle";
33     subtitle.textContent = subtitleText;
34
35     shadowRoot.appendChild(shadowContainer);
36 };