Skip to content

Commit a19605f

Browse files
committed
YARN-1868. YARN status web ui does not show correctly in IE 11. Contributed by Chuan Liu.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1598686 13f79535-47bb-0310-9956-ffa450edef68
1 parent c77bda9 commit a19605f

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

hadoop-yarn-project/CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ Release 2.5.0 - UNRELEASED
171171
that both Timeline Server and client can access them. (Zhijie Shen via
172172
vinodkv)
173173

174+
YARN-1868. YARN status web ui does not show correctly in IE 11.
175+
(Chuan Liu via cnauroth)
176+
174177
Release 2.4.1 - UNRELEASED
175178

176179
INCOMPATIBLE CHANGES

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/view/HtmlPage.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ protected HtmlPage(ViewContext ctx) {
7979
@Override
8080
public void render() {
8181
puts(DOCTYPE);
82-
render(page().html().meta_http("Content-type", MimeType.HTML));
82+
render(page().html().meta_http("X-UA-Compatible", "IE=8")
83+
.meta_http("Content-type", MimeType.HTML));
8384
if (page().nestLevel() != 0) {
8485
throw new WebAppException("Error rendering page: nestLevel="+
8586
page().nestLevel());

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/webapp/TestSubViews.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,6 @@ public void render(Block html) {
7070
out.flush();
7171
verify(out).print("sub1 text");
7272
verify(out).print("sub2 text");
73-
verify(out, times(15)).println(); // test inline transition across views
73+
verify(out, times(16)).println(); // test inline transition across views
7474
}
7575
}

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/webapp/view/TestHtmlPage.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@
2222

2323
import java.io.PrintWriter;
2424

25+
import org.apache.hadoop.yarn.webapp.MimeType;
2526
import org.apache.hadoop.yarn.webapp.WebAppException;
2627
import org.apache.hadoop.yarn.webapp.test.WebAppTests;
2728
import org.apache.hadoop.yarn.webapp.view.HtmlPage;
28-
2929
import org.junit.Test;
30+
3031
import static org.mockito.Mockito.*;
3132

3233
public class TestHtmlPage {
@@ -53,6 +54,12 @@ public void render(Page.HTML<_> html) {
5354
Injector injector = WebAppTests.testPage(TestView.class);
5455
PrintWriter out = injector.getInstance(PrintWriter.class);
5556

57+
// Verify the HTML page has correct meta tags in the header
58+
verify(out).print(" http-equiv=\"X-UA-Compatible\"");
59+
verify(out).print(" content=\"IE=8\"");
60+
verify(out).print(" http-equiv=\"Content-type\"");
61+
verify(out).print(String.format(" content=\"%s\"", MimeType.HTML));
62+
5663
verify(out).print("test");
5764
verify(out).print(" id=\"testid\"");
5865
verify(out).print("test note");

0 commit comments

Comments
 (0)