View Javadoc
1   /*
2    * Copyright (c) 2002-2017 Gargoyle Software Inc.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * http://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software
10   * distributed under the License is distributed on an "AS IS" BASIS,
11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   * See the License for the specific language governing permissions and
13   * limitations under the License.
14   */
15  package com.gargoylesoftware.htmlunit.javascript.host.html;
16  
17  import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_BGSOUND_AS_UNKNOWN;
18  import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF;
19  import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE;
20  
21  import com.gargoylesoftware.htmlunit.html.HtmlBackgroundSound;
22  import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass;
23  
24  /**
25   * The JavaScript object {@code HTMLBGSoundElement}.
26   *
27   * @author Ahmed Ashour
28   */
29  @JsxClass(domClass = HtmlBackgroundSound.class, value = IE)
30  @JsxClass(isJSObject = false, domClass = HtmlBackgroundSound.class, value = FF)
31  public class HTMLBGSoundElement extends HTMLElement {
32  
33      /**
34       * {@inheritDoc}
35       */
36      @Override
37      public String getClassName() {
38          if (getWindow().getWebWindow() != null) {
39              if (getBrowserVersion().hasFeature(JS_BGSOUND_AS_UNKNOWN)) {
40                  return "HTMLUnknownElement";
41              }
42          }
43          return super.getClassName();
44      }
45  
46      /**
47       * {@inheritDoc}
48       */
49      @Override
50      protected boolean isEndTagForbidden() {
51          return true;
52      }
53  
54  }