mutateElementToAffectOffsetTop(someElement);
// (1) We don't know the value of someElement.offsetTop here because we compute it lazily.
var y = (new DOMTransaction(function () {
// (2) We need to remember the "old value" of someElement.offsetTop here.
mutateElementToAffectOffsetTop(someElement);
return someElement.offsetTop;
})).execute();
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<div><button id="button" type="submit" disabled><span>Go</span></button></div> | |
<pre id="log"></pre> | |
<script> | |
function logEventCapturing(event) { document.getElementById('log').textContent += `${event.type} on ${this.localName} capturing path:${event.composedPath().length}\n`; } | |
function logEventBubbling(event) { document.getElementById('log').textContent += `${event.type} on ${this.localName} bubbling path:${event.composedPath().length}\n`; } |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<pre id="log"></pre> | |
<script> | |
let lastSize = null; | |
function updateSize() { | |
const width = window.innerWidth; | |
const height = window.innerHeight; |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<input type="radio"> | |
<script> | |
const input = document.querySelector('input'); | |
const clickEvent = new MouseEvent('click', {button: 0, which: 1}); | |
input.addEventListener('change', () => { | |
alert(clickEvent.eventPhase); |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<form id="outer-form" action="javascript:doAction(outerForm)"> | |
</form> | |
<form id="inner-form" method="GET" action="javascript:doAction(innerForm)"> | |
<div id="buttonParent"> | |
<input> | |
<button id="submitButton" type="submit">Go</button> | |
</div> |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<pre id="result"></pre> | |
<script> | |
async function createTree(shadowContent) | |
{ | |
const host = document.createElement('div'); | |
host.innerHTML = '<span></span>'; |
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
<!doctype html> | |
<html> | |
<body> | |
<pre id="log"></pre> | |
<script> | |
function log(text) { | |
document.getElementById('log').textContent += `${text}\n`; | |
} |
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
transaction = new DOMTransaction(function (container, articleList) { | |
var childCount = container.childNodes.length; | |
for (let article of articleList) | |
container.append(article); | |
// No DOM mutation is made until this function exits. | |
console.assert(childCount == container.childNodes.length); | |
}); | |
transaction.commit(element, articles); |
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
Index: Source/WebCore/rendering/RenderBlock.cpp | |
=================================================================== | |
--- Source/WebCore/rendering/RenderBlock.cpp (revision 148625) | |
+++ Source/WebCore/rendering/RenderBlock.cpp (working copy) | |
@@ -3703,13 +3703,49 @@ | |
(state == RenderObject::SelectionEnd && !ltr); | |
} | |
+#define LSO_LOG 1 | |
+ |
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
Process: Safari [30260] | |
Path: /Applications/Safari.app/Contents/MacOS/Safari | |
Identifier: org.webkit.nightly.WebKit | |
Version: r117439 (117439) | |
Code Type: X86-64 (Native) | |
Parent Process: launchd [1832] | |
Date/Time: 2012-05-17 13:52:51.722 -0700 | |
OS Version: Mac OS X 10.6.8 (10K549) | |
Report Version: 6 |
NewerOlder