"매 browser 의 매 4-stage pipeline + 매 3-language stack + 매 1 event loop". 매 HTML(structure) → 매 CSS(presentation) → 매 JS(behavior) 의 매 stack 위 에서 매 browser 의 매 Parse → Style → Layout → Paint → Composite pipeline 이 매 60Hz/120Hz frame budget 안 에 매 실행 — 매 이 underlying model 의 매 이해가 매 모든 매 framework 의 매 root.
매 핵심
매 3-Language Stack
HTML: 매 semantic structure — 매 accessibility tree · 매 SEO · 매 progressive enhancement 의 매 base.
CSS: 매 declarative styling — 매 cascade · 매 specificity · 매 box model · 매 flex/grid · 매 container query.
JS: 매 imperative behavior — 매 event-driven · 매 single-thread · 매 async runtime.
매 Browser Rendering Pipeline
Parse — HTML → DOM tree, CSS → CSSOM tree.
Style — DOM + CSSOM → render tree (매 computed styles).
Layout (reflow) — 매 geometry 계산 (position, size).
Paint — 매 pixel 의 매 fill (color, shadow, gradient).
Composite — 매 GPU 의 매 layer 합성 (transform, opacity).
매 Event Loop & Concurrency
매 single-threaded JS — 매 macrotask queue + 매 microtask queue.
매 microtask (Promise, queueMicrotask) — 매 current task 후 즉시 drain.
매 macrotask (setTimeout, I/O) — 매 다음 tick.
매 rAF — 매 paint 직전 매 호출.
매 응용
매 모든 framework 의 매 fundament — React/Vue/Svelte/Solid 의 매 underlying.
매 performance debugging.
매 accessibility & SEO.
💻 패턴
Pattern 1: 매 Semantic HTML
<!-- BAD — 매 div soup --><divclass="header"><divclass="nav"><divclass="link">Home</div></div></div><!-- GOOD — 매 semantic + accessible --><header><navaria-label="Primary"><ul><li><ahref="/">Home</a></li></ul></nav></header>
Pattern 2: 매 CSS Cascade & Specificity
/* 매 specificity: inline > id > class > element *//* 매 0,0,0,1 */p{color:black;}/* 매 0,0,1,0 */.text{color:blue;}/* 매 0,1,0,0 */#intro{color:red;}/* 매 1,0,0,0 *//* style="color: green" *//* !important — 매 last resort */
Pattern 3: 매 Modern Layout (Grid + Flex)
.layout{display:grid;grid-template-columns:240px1fr;gap:1rem;min-height:100dvh;}.toolbar{display:flex;gap:.5rem;align-items:center;}/* 매 container query — 매 component-level responsive */@container(min-width:600px){.card{display:grid;grid-template-columns:1fr2fr;}}
Pattern 4: 매 DOM API
// 매 query
constbtn=document.querySelector<HTMLButtonElement>('#submit');// 매 event delegation — 매 single listener for many children
document.querySelector('.list')!.addEventListener('click',(e)=>{consttarget=(e.targetasHTMLElement).closest<HTMLElement>('[data-id]');if(target)handleClick(target.dataset.id!);});
Pattern 5: 매 Async / Event Loop
asyncfunctionfetchUser(id: string){constres=awaitfetch(`/api/user/${id}`);if(!res.ok)thrownewError(`HTTP ${res.status}`);returnres.json();}// 매 parallel
const[user,posts]=awaitPromise.all([fetchUser(id),fetch(`/api/posts?user=${id}`).then(r=>r.json()),]);
Pattern 6: 매 Web API 활용
// IntersectionObserver — 매 scroll-based lazy load
constio=newIntersectionObserver((entries)=>{for(consteofentries){if(e.isIntersecting){(e.targetasHTMLImageElement).src=(e.targetasHTMLImageElement).dataset.src!;io.unobserve(e.target);}}});document.querySelectorAll('img[data-src]').forEach(img=>io.observe(img));
Pattern 7: 매 Accessibility 기본
<buttontype="button"aria-pressed="false"aria-label="Toggle menu"><svgaria-hidden="true">...</svg></button><!-- 매 focus visible, 매 keyboard navigation, 매 ARIA only when semantic HTML insufficient -->
매 결정 기준
상황
Approach
매 component layout
Flex (1D) / Grid (2D)
매 reactive style
CSS custom property + JS update
매 list rendering
Event delegation, IntersectionObserver
매 animation
transform + opacity (composite-only)
매 form
Native form + constraint validation API
기본값: 매 semantic HTML → 매 modern CSS (Grid/Flex/container query) → 매 minimal JS.
언제: 매 fundamentals teaching, 매 framework-agnostic debugging, 매 accessibility audit, 매 performance root-cause.
언제 X: 매 framework-specific pattern (React hook, Vue composable) — 매 그 framework 문서 참조.
❌ 안티패턴
매 div soup: 매 semantic 무시 — 매 a11y / SEO 손실.
매 !important spam: 매 specificity war — 매 maintainability 붕괴.
매 inline event handler 의 다수: 매 onclick="..." 의 spread — 매 CSP / 매 separation 위반.
매 layout thrashing: 매 read-write-read 의 매 mix in 매 loop.
매 sync XHR: 매 main thread block — 매 fetch async 사용.
🧪 검증 / 중복
Verified (MDN, WHATWG HTML spec, W3C CSS spec, web.dev 2026).