<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>HTML</title><link>https://blog.ast.moe/en/tags/html/</link><description>Recent posts: Gorimuchu</description><generator>Hugo</generator><item><title>Tracing with Omoikane how a URL fragment becomes the CSS :target</title><link>https://blog.ast.moe/en/blog/2026-09-27/</link><pubDate>Sun, 27 Sep 2026 22:31:00 +0900</pubDate><guid>https://blog.ast.moe/en/blog/2026-09-27/</guid><description>&lt;p&gt;Links that jump to headings on the page look simple.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-html" data-lang="html"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;lt;&lt;span style="color:#f92672"&gt;a&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;href&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;#details&amp;#34;&lt;/span&gt;&amp;gt;Go to details&amp;lt;/&lt;span style="color:#f92672"&gt;a&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;lt;&lt;span style="color:#f92672"&gt;section&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;id&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;details&amp;#34;&lt;/span&gt;&amp;gt;...&amp;lt;/&lt;span style="color:#f92672"&gt;section&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;When you click this link, the URL’s end changes to &lt;code&gt;#details&lt;/code&gt;, and the corresponding element becomes the destination within the page. By using &lt;code&gt;:target&lt;/code&gt; in CSS, you can highlight only that element.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-css" data-lang="css"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;:&lt;span style="color:#a6e22e"&gt;target&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;outline&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;2&lt;/span&gt;&lt;span style="color:#66d9ef"&gt;px&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;solid&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;red&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Usually, understanding that “the part of the URL after &lt;code&gt;#&lt;/code&gt; matches &lt;code&gt;id&lt;/code&gt;” is sufficient. However, when trying to incorporate &lt;code&gt;:target&lt;/code&gt; into my own browser, &lt;a href="https://github.com/ieee0824/omoikane"&gt;Omoikane&lt;/a&gt;, that wasn’t enough. The URL‑parsing logic, the HTML rules for selecting the target, the document’s internal state, CSS selector matching, and the updates after changing &lt;code&gt;location.hash&lt;/code&gt; are all handled in separate places.&lt;/p&gt;</description></item><item><title>I advanced browser compatibility for cookies and scrolling in Omoikane.</title><link>https://blog.ast.moe/en/blog/2026-09-23-2/</link><pubDate>Wed, 23 Sep 2026 21:39:00 +0900</pubDate><guid>https://blog.ast.moe/en/blog/2026-09-23-2/</guid><description>&lt;p&gt;In my custom browser
&lt;span&gt;
&lt;a target="_blank" href="https://github.com/ieee0824/omoikane"&gt;
Omoikane
&lt;/a&gt;
&lt;img class="external-link-icon" src="https://blog.ast.moe/images/outer-link.png" width="12" height="12" alt="" aria-hidden="true" loading="lazy"&gt;
&lt;/span&gt;
, I made several changes related to Web API and CSS compatibility.&lt;/p&gt;
&lt;p&gt;Looking at these changes, many of them went beyond simply adding APIs visible to JavaScript. It was necessary to convey the page’s state to the host, reflect JavaScript actions in HTTP communication, and preserve the scroll position set by CSS until the input processing is finished.&lt;/p&gt;
&lt;h2 id="cookies-were-handled-separately-for-javascript-and-http"&gt;Cookies were handled separately for JavaScript and HTTP&lt;/h2&gt;
&lt;p&gt;The first thing we fixed was how cookies are managed.&lt;/p&gt;</description></item><item><title>I'm fixing subtle web‑compatibility differences in Omoikane.</title><link>https://blog.ast.moe/en/blog/2026-09-22/</link><pubDate>Tue, 22 Sep 2026 07:09:00 +0900</pubDate><guid>https://blog.ast.moe/en/blog/2026-09-22/</guid><description>&lt;p&gt;When I’m tinkering with my own browser,
&lt;span&gt;
&lt;a target="_blank" href="https://github.com/ieee0824/omoikane"&gt;
Omoikane
&lt;/a&gt;
&lt;img class="external-link-icon" src="https://blog.ast.moe/images/outer-link.png" width="12" height="12" alt="" aria-hidden="true" loading="lazy"&gt;
&lt;/span&gt;
, I’ve found that the tiny differences that are taken for granted in existing browsers can be more troublesome than implementing a single large web API.&lt;/p&gt;
&lt;p&gt;The changes I added this time are the default margin for &lt;code&gt;body&lt;/code&gt;, declarative Shadow DOM, and the orientation of characters in vertical text. Each of these looks like a small visual tweak, but each relies on assumptions in the CSS cascade, HTML parsing, and text rendering, respectively.&lt;/p&gt;</description></item><item><title>Implemented Pointer Lock and form‑related custom elements in Omoikane.</title><link>https://blog.ast.moe/en/blog/2026-09-20/</link><pubDate>Sun, 20 Sep 2026 11:25:48 +0900</pubDate><guid>https://blog.ast.moe/en/blog/2026-09-20/</guid><description>&lt;p&gt;I added Pointer Lock support and custom form‑related elements to my self‑made browser (
&lt;span&gt;
&lt;a target="_blank" href="https://github.com/ieee0824/omoikane"&gt;
Omoikane
&lt;/a&gt;
&lt;img class="external-link-icon" src="https://blog.ast.moe/images/outer-link.png" width="12" height="12" alt="" aria-hidden="true" loading="lazy"&gt;
&lt;/span&gt;
).&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.ast.moe/en/blog/2026-09-19-3/"&gt;In the previous post I wrote about Fullscreen API and character‑encoding conversion streams&lt;/a&gt;. This time I’m covering the pathway for delivering mouse input to the page and the logic for integrating my custom input components into HTML forms.&lt;/p&gt;
&lt;p&gt;Neither of these is a huge undertaking if you only consider the entry‑point APIs. However, when we actually hooked everything up, we ran into issues such as mouse input being delivered twice on X11, iframe callbacks executing in a different runtime environment, and even pages that don’t use forms becoming sluggish. In the end, the macOS tests caused the entire process to crash.&lt;/p&gt;</description></item><item><title>Implemented the Fullscreen API and character‑encoding conversion streams in Omoikane.</title><link>https://blog.ast.moe/en/blog/2026-09-19-3/</link><pubDate>Sat, 19 Sep 2026 20:46:07 +0900</pubDate><guid>https://blog.ast.moe/en/blog/2026-09-19-3/</guid><description>&lt;p&gt;I added the Fullscreen API and &lt;code&gt;TextEncoderStream&lt;/code&gt;/&lt;code&gt;TextDecoderStream&lt;/code&gt; to my custom browser,
&lt;span&gt;
&lt;a target="_blank" href="https://github.com/ieee0824/omoikane"&gt;
Omoikane
&lt;/a&gt;
&lt;img class="external-link-icon" src="https://blog.ast.moe/images/outer-link.png" width="12" height="12" alt="" aria-hidden="true" loading="lazy"&gt;
&lt;/span&gt;
.&lt;/p&gt;
&lt;p&gt;Previously, I implemented the Popover API and a top layer (see /blog/2026-09-14/). This time, I connected that rendering pipeline to the Fullscreen API and, as a separate task, made character‑encoding conversion usable via the Streams API. (&lt;a href="https://blog.ast.moe/en/blog/2026-09-14/"&gt;source&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Fullscreen display and character‑encoding conversion are fairly unrelated features. However, neither could be completed simply by adding a JavaScript method.&lt;/p&gt;</description></item><item><title>Implemented the Popover API and top layer in the custom browser Omoikane.</title><link>https://blog.ast.moe/en/blog/2026-09-14/</link><pubDate>Mon, 14 Sep 2026 16:34:41 +0900</pubDate><guid>https://blog.ast.moe/en/blog/2026-09-14/</guid><description>&lt;p&gt;I have implemented the HTML Popover API in my custom browser, Omoikane (&lt;a href="https://github.com/ieee0824/omoikane"&gt;source&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;With the Popover API, you can open and close popovers using only HTML, without needing to manage their visibility state with JavaScript.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-html" data-lang="html"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;lt;&lt;span style="color:#f92672"&gt;button&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;popovertarget&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;menu&amp;#34;&lt;/span&gt;&amp;gt;Open menu&amp;lt;/&lt;span style="color:#f92672"&gt;button&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;lt;&lt;span style="color:#f92672"&gt;div&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;id&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;menu&amp;#34;&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;popover&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;lt;&lt;span style="color:#f92672"&gt;button&lt;/span&gt;&amp;gt;Item 1&amp;lt;/&lt;span style="color:#f92672"&gt;button&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;lt;&lt;span style="color:#f92672"&gt;button&lt;/span&gt;&amp;gt;Item 2&amp;lt;/&lt;span style="color:#f92672"&gt;button&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;lt;/&lt;span style="color:#f92672"&gt;div&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;At first glance, it seems all you’d need to do is add an API to toggle the element’s &lt;code&gt;display&lt;/code&gt; state.&lt;/p&gt;
&lt;p&gt;In reality, popovers are rendered on a top layer that lies outside the normal stacking order. There are considerations such as light dismissal when clicking outside, closing with the Escape key, focus movement and restoration, &lt;code&gt;::backdrop&lt;/code&gt;, and the ordering relationship with dialogs.&lt;/p&gt;</description></item><item><title>I made significant progress on the HTML and CSS implementation of my custom browser, Omoikane.</title><link>https://blog.ast.moe/en/blog/2026-09-12/</link><pubDate>Sat, 12 Sep 2026 19:51:40 +0900</pubDate><guid>https://blog.ast.moe/en/blog/2026-09-12/</guid><description>&lt;p&gt;These past few days, I’ve been working on advancing the implementation of HTML and CSS in my custom browser, Omoikane (&lt;a href="https://github.com/ieee0824/omoikane"&gt;source&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;At first, I displayed the same HTML as Firefox and investigated where any rendering discrepancies remained.&lt;/p&gt;
&lt;p&gt;When I began the comparison, I discovered not only simple color differences but also fundamental shortcomings, such as inline elements not having their bounding boxes correctly calculated, web fonts not being manageable from JavaScript, and HTML fragments not being parsed according to the context.&lt;/p&gt;</description></item></channel></rss>