-
-
Notifications
You must be signed in to change notification settings - Fork 926
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
1,194 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
</head> | ||
<body> | ||
<p>This is a test for special case-handling of attribute and style properties. (#2988).</p> | ||
<p>Open your browser's Developer Console and follow these steps:</p> | ||
<ol> | ||
<li>Check the background color of the "foo" below.</li> | ||
<ul> | ||
<li>If it is light green, it is correct. The style has been updated properly.</li> | ||
<li>If it is red or yellow, the style has not been updated properly.</li> | ||
</ul> | ||
<li>Check the logs displayed in the console.</li> | ||
<ul> | ||
<li>If the attribute has been updated correctly, you should see the following message: "If you see this message, the update process is correct."</li> | ||
<li>If "null" is displayed, the attribute has not been updated properly.</li> | ||
</ul> | ||
</ol> | ||
|
||
<div id="root" style="background-color: red;"></div> | ||
<script src="../../../mithril.js"></script> | ||
<script> | ||
// data-*** is NOT case-sensitive | ||
// style properties have two cases (camelCase and dash-case) | ||
var a = m("div#a", {"data-sampleId": "If you see this message, something is wrong.", style: {backgroundColor: "yellow"}}, "foo") | ||
var b = m("div#a", {"data-sampleid": "If you see this message, the update process is correct.", style: {"background-color": "lightgreen"}}, "foo") | ||
|
||
// background color is yellow | ||
m.render(document.getElementById("root"), a) | ||
|
||
// background color is lightgreen? | ||
m.render(document.getElementById("root"), b) | ||
|
||
// data-sampleid is "If you see this message, the update process is correct."? | ||
console.log(document.querySelector("#a").getAttribute("data-sampleid")) | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.